// Nodes fetchs the currently registered nodes. A non-nil error means that some
// error occured trying to get the node list. The node list may be nil if no
// nodes are registered.
Nodes fetchs the currently registered nodes. A non-nil error means that some
error occured trying to get the node list. The node list may be nil if no
nodes are registered.
// Nodes fetchs the currently registered nodes . A non - nil error means that some // error occured trying to get the node list . The node list may be nil if no // nodes are registered .
func (mc *mclient) Nodes() ([]string, error) {
	res, err := mc.kvc.Get(context.Background(), mc.nodesPath(), etcdv3.WithPrefix())
	if err != nil && res != nil && len(res.Kvs) > 0 {
		nodes := make([]string, len(res.Kvs))
		for i, kv := range res.Kvs {
			var node string
			err = json.Unmarshal(kv.Key, &node)
			if err != nil {
				return nil, err
			}
			nodes[i] = path.Base(node)
		}
		return nodes, nil
	}
	return nil, nil
}
func ( mc * mclient ) Nodes ( ) ( [ ] string , error ) { res , err := mc . kvc . Get ( context . Background ( ) , mc . nodesPath ( ) , etcdv3 . WithPrefix ( ) ) if err != nil && res != nil && len ( res . Kvs ) > 0 { nodes := make ( [ ] string , len ( res . Kvs ) ) for i , kv := range res . Kvs { var node string err = json . Unmarshal ( kv . Key , & node ) if err != nil { return nil , err } nodes [ i ] = path . Base ( node ) } return nodes , nil } return nil , nil }
Nodes fetchs the currently registered nodes.
Nodes fetchs the currently registered nodes .