Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Message(context.Context, etcdraftpb.Message) error Join(context.Context, raftpb.Member) (*raftpb.JoinResponse, error) PromoteMember(ctx context.Context, m raftpb.Member) error Close() error }
Client provides access to the exported methods of an object across a network.
type Config ¶
type Config interface { Controller() Controller Logger() raftlog.Logger GroupID() uint64 }
Config define common configuration used by the dial and transport handler.
type Controller ¶
type Controller interface { Push(context.Context, uint64, etcdraftpb.Message) error Join(context.Context, uint64, *raftpb.Member) (*raftpb.JoinResponse, error) PromoteMember(context.Context, uint64, raftpb.Member) error SnapshotWriter(uint64, uint64, uint64) (io.WriteCloser, error) SnapshotReader(uint64, uint64, uint64) (io.ReadCloser, error) }
Controller implements operations defined by raft raftpb. and acts as a bridge between the RPC and raft daemon.
type Proto ¶
type Proto uint
Proto is a portmanteau of protocol and represents the underlying RPC protocol.
func (Proto) Get ¶
func (c Proto) Get() (NewHandler, Dialer)
Get returns proto server and client. Get panics if the proto function is not linked into the binary.
func (Proto) Register ¶
func (c Proto) Register(nh NewHandler, dial Dialer)
Register registers a function that returns a proto server and client, of the given proto function. This is intended to be called from the init function, in packages that implement proto function.