Documentation
¶
Index ¶
- Constants
- func EncodeDel(key string) []byte
- func EncodePut(key string, value []byte) []byte
- type KVNode
- func (nd *KVNode) AddNode(serverID, bind string, prevIndex uint64)
- func (nd *KVNode) Apply(l *raft.Log) interface{}
- func (nd *KVNode) Del(key string) error
- func (nd *KVNode) Get(key string, level rpc.ReadLevel) ([]byte, error)
- func (nd *KVNode) GetMeta() ([]kv.ServerConfig, error)
- func (nd *KVNode) Put(key string, value []byte) error
- func (nd *KVNode) RemoveNode(serverID, bind string, prevIndex uint64)
- func (nd *KVNode) Restore(snapshot io.ReadCloser) error
- func (nd *KVNode) Shutdown()
- func (nd *KVNode) Snapshot() (raft.FSMSnapshot, error)
- func (nd *KVNode) WaitApplied(timeout time.Duration) error
- func (nd *KVNode) WaitForLeader(timeout time.Duration) error
- type LogEvent
- type NodeOption
- type SKVServerImpl
- func (skv *SKVServerImpl) Del(ctx context.Context, req *rpc.DelRequest) (*rpc.DelReply, error)
- func (skv *SKVServerImpl) Get(ctx context.Context, req *rpc.GetRequest) (*rpc.GetReply, error)
- func (skv *SKVServerImpl) GetMeta(ctx context.Context, req *rpc.GetMetaRequest) (*rpc.GetMetaReply, error)
- func (skv *SKVServerImpl) Join(ctx context.Context, req *rpc.PeerRequest) (*rpc.PeerReply, error)
- func (skv *SKVServerImpl) Put(ctx context.Context, req *rpc.KeyValuePair) (*rpc.PutReply, error)
- func (skv *SKVServerImpl) Quit(ctx context.Context, req *rpc.PeerRequest) (*rpc.PeerReply, error)
- func (skv *SKVServerImpl) Scan(opts *rpc.ScanOption, stream rpc.SKV_ScanServer) error
- func (skv *SKVServerImpl) Shutdown()
- type SKVSnapshot
Constants ¶
View Source
const ( EventPut = 1 << iota EventDel )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KVNode ¶
type KVNode struct {
// contains filtered or unexported fields
}
func (*KVNode) RemoveNode ¶
Can only the leader do this
type LogEvent ¶
type LogEvent struct {
// contains filtered or unexported fields
}
func DecodeLogEvent ¶
type NodeOption ¶
type NodeOption func(kv *KVNode)
func WithBind ¶
func WithBind(bind string) NodeOption
func WithBootstrap ¶
func WithBootstrap(b bool) NodeOption
func WithBootstrapAddress ¶
func WithBootstrapAddress(addr string) NodeOption
func WithDebug ¶
func WithDebug(b bool) NodeOption
func WithID ¶
func WithID(id string) NodeOption
func WithRpcAddress ¶
func WithRpcAddress(addr string) NodeOption
func WithStorageRoot ¶
func WithStorageRoot(path string) NodeOption
type SKVServerImpl ¶
type SKVServerImpl struct { rpc.UnimplementedSKVServer rpc.UnimplementedPeerServer // contains filtered or unexported fields }
func NewSKVServer ¶
func NewSKVServer(opts []kv.KVOption, ndopts []NodeOption) *SKVServerImpl
func (*SKVServerImpl) Del ¶
func (skv *SKVServerImpl) Del(ctx context.Context, req *rpc.DelRequest) (*rpc.DelReply, error)
func (*SKVServerImpl) Get ¶
func (skv *SKVServerImpl) Get(ctx context.Context, req *rpc.GetRequest) (*rpc.GetReply, error)
func (*SKVServerImpl) GetMeta ¶
func (skv *SKVServerImpl) GetMeta(ctx context.Context, req *rpc.GetMetaRequest) (*rpc.GetMetaReply, error)
func (*SKVServerImpl) Join ¶
func (skv *SKVServerImpl) Join(ctx context.Context, req *rpc.PeerRequest) (*rpc.PeerReply, error)
func (*SKVServerImpl) Put ¶
func (skv *SKVServerImpl) Put(ctx context.Context, req *rpc.KeyValuePair) (*rpc.PutReply, error)
func (*SKVServerImpl) Quit ¶
func (skv *SKVServerImpl) Quit(ctx context.Context, req *rpc.PeerRequest) (*rpc.PeerReply, error)
func (*SKVServerImpl) Scan ¶
func (skv *SKVServerImpl) Scan(opts *rpc.ScanOption, stream rpc.SKV_ScanServer) error
func (*SKVServerImpl) Shutdown ¶
func (skv *SKVServerImpl) Shutdown()
type SKVSnapshot ¶
type SKVSnapshot struct {
// contains filtered or unexported fields
}
func (*SKVSnapshot) Persist ¶
func (ss *SKVSnapshot) Persist(sink raft.SnapshotSink) error
func (*SKVSnapshot) Release ¶
func (ss *SKVSnapshot) Release()
Click to show internal directories.
Click to hide internal directories.