micro/registry/consul_service.go

21 lines
312 B
Go
Raw Normal View History

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