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