// NewClientWithDial uses the provided dial and services to dial the cluster // leader and returns a client. If dial is nil, the default network dialer is // used. If services is nil, the default discoverd client is used. func NewClientWithDial(dial rpcplus.DialFunc, services ServiceSetFunc) (*Client, error) { client, err := newClient(services) if err != nil { return nil, err } client.dial = dial return client, client.start() }
// NewClientWithSelf returns a client configured to use self to talk to the // leader with the identifier id. func NewClientWithSelf(id string, self LocalClient) (*Client, error) { client, err := newClient(nil) if err != nil { return nil, err } client.selfID = id client.self = self return client, client.start() }