-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type RmrEndpointList struct {
- Endpoints []RmrEndpoint
-}
-
-func (eplist *RmrEndpointList) String() string {
- valuesText := eplist.StringList()
- return strings.Join(valuesText, ",")
-}
-
-func (eplist *RmrEndpointList) StringList() []string {
- tmpList := eplist.Endpoints
- valuesText := []string{}
- for i := range tmpList {
- valuesText = append(valuesText, tmpList[i].String())
- }
- return valuesText
-}
-
-func (eplist *RmrEndpointList) Size() int {
- return len(eplist.Endpoints)
-}
-
-func (eplist *RmrEndpointList) AddEndpoint(ep *RmrEndpoint) bool {
- for i := range eplist.Endpoints {
- if eplist.Endpoints[i].Equal(ep) {
- return false
- }
- }
- eplist.Endpoints = append(eplist.Endpoints, *ep)
- return true
-}