mirror of
https://github.com/go-micro/go-micro.git
synced 2024-11-30 08:06:40 +02:00
21 lines
312 B
Go
21 lines
312 B
Go
|
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
|
||
|
}
|