// RegisterNode registers the node in the etcd
RegisterNode registers the node in the etcd
// RegisterNode registers the node in the etcd
func (r *EtcdRegistry) RegisterNode(pctx context.Context, prefix, nodeID, host string) error {
	ctx, cancel := context.WithTimeout(pctx, r.reqTimeout)
	defer cancel()
	if exists, err := r.checkNodeExists(ctx, prefix, nodeID); err != nil {
		return errors.Trace(err)
	} else if !exists {
		return r.createNode(ctx, prefix, nodeID, host)
	} else {
		return r.updateNode(ctx, prefix, nodeID, host)
	}
}
func ( r * EtcdRegistry ) RegisterNode ( pctx context . Context , prefix , nodeID , host string ) error { ctx , cancel := context . WithTimeout ( pctx , r . reqTimeout ) defer cancel ( ) if exists , err := r . checkNodeExists ( ctx , prefix , nodeID ) ; err != nil { return errors . Trace ( err ) } else if ! exists { return r . createNode ( ctx , prefix , nodeID , host ) } else { return r . updateNode ( ctx , prefix , nodeID , host ) } }
RegisterNode registers the node in the etcd
RegisterNode registers the node in the etcd
// not found then create a new  node // found it, update host infomation of the node