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 {
ServiceName string
ServiceNodes []*ConsulNode
}
func (c *ConsulService) Name() string {
return c.ServiceName
}
func (c *ConsulService) Nodes() []Node {
var nodes []Node
for _, node := range c.ServiceNodes {
nodes = append(nodes, node)
}
return nodes
}