micro/registry/consul_service.go

21 lines
312 B
Go
Raw Normal View History

2015-01-14 02:31:27 +03:00
package registry
type consulService struct {
2015-01-14 02:31:27 +03:00
ServiceName string
ServiceNodes []*consulNode
2015-01-14 02:31:27 +03:00
}
func (c *consulService) Name() string {
2015-01-14 02:31:27 +03:00
return c.ServiceName
}
func (c *consulService) Nodes() []Node {
2015-01-14 02:31:27 +03:00
var nodes []Node
for _, node := range c.ServiceNodes {
nodes = append(nodes, node)
}
return nodes
}