2015-01-14 02:31:27 +03:00
|
|
|
package registry
|
|
|
|
|
2015-05-23 22:04:16 +03:00
|
|
|
type consulService struct {
|
2015-01-14 02:31:27 +03:00
|
|
|
ServiceName string
|
2015-05-23 22:04:16 +03:00
|
|
|
ServiceNodes []*consulNode
|
2015-01-14 02:31:27 +03:00
|
|
|
}
|
|
|
|
|
2015-05-23 22:04:16 +03:00
|
|
|
func (c *consulService) Name() string {
|
2015-01-14 02:31:27 +03:00
|
|
|
return c.ServiceName
|
|
|
|
}
|
|
|
|
|
2015-05-23 22:04:16 +03:00
|
|
|
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
|
|
|
|
}
|