Versions in this module Expand all Collapse all v0 v0.2.0 Jan 1, 2017 Changes in this version + func RegisterChordServer(s *grpc.Server, srv ChordServer) + type BlackholeTransport struct + func (*BlackholeTransport) ClearPredecessor(target, self *Vnode) error + func (*BlackholeTransport) FindSuccessors(vn *Vnode, n int, key []byte) ([]*Vnode, error) + func (*BlackholeTransport) GetPredecessor(vn *Vnode) (*Vnode, error) + func (*BlackholeTransport) ListVnodes(host string) ([]*Vnode, error) + func (*BlackholeTransport) Notify(vn, self *Vnode) ([]*Vnode, error) + func (*BlackholeTransport) Ping(vn *Vnode) (bool, error) + func (*BlackholeTransport) Register(v *Vnode, o VnodeRPC) + func (*BlackholeTransport) SkipSuccessor(target, self *Vnode) error + type BoolErr struct + Err string + Ok bool + func (*BoolErr) Descriptor() ([]byte, []int) + func (*BoolErr) ProtoMessage() + func (m *BoolErr) GetErr() string + func (m *BoolErr) GetOk() bool + func (m *BoolErr) Reset() + func (m *BoolErr) String() string + type ChordClient interface + ClearPredecessorServe func(ctx context.Context, in *VnodePair, opts ...grpc.CallOption) (*ErrResponse, error) + FindSuccessorsServe func(ctx context.Context, in *FindSuccReq, opts ...grpc.CallOption) (*VnodeListErr, error) + GetPredecessorServe func(ctx context.Context, in *Vnode, opts ...grpc.CallOption) (*VnodeError, error) + ListVnodesServe func(ctx context.Context, in *StringParam, opts ...grpc.CallOption) (*VnodeListErr, error) + NotifyServe func(ctx context.Context, in *VnodePair, opts ...grpc.CallOption) (*VnodeListErr, error) + PingServe func(ctx context.Context, in *Vnode, opts ...grpc.CallOption) (*BoolErr, error) + SkipSuccessorServe func(ctx context.Context, in *VnodePair, opts ...grpc.CallOption) (*ErrResponse, error) + func NewChordClient(cc *grpc.ClientConn) ChordClient + type ChordServer interface + ClearPredecessorServe func(context.Context, *VnodePair) (*ErrResponse, error) + FindSuccessorsServe func(context.Context, *FindSuccReq) (*VnodeListErr, error) + GetPredecessorServe func(context.Context, *Vnode) (*VnodeError, error) + ListVnodesServe func(context.Context, *StringParam) (*VnodeListErr, error) + NotifyServe func(context.Context, *VnodePair) (*VnodeListErr, error) + PingServe func(context.Context, *Vnode) (*BoolErr, error) + SkipSuccessorServe func(context.Context, *VnodePair) (*ErrResponse, error) + type Config struct + Delegate Delegate + HashFunc func() hash.Hash + Hostname string + NumSuccessors int + NumVnodes int + StabilizeMax time.Duration + StabilizeMin time.Duration + func DefaultConfig(hostname string) *Config + type Delegate interface + Leaving func(local, pred, succ *Vnode) + NewPredecessor func(local, remoteNew, remotePrev *Vnode) + PredecessorLeaving func(local, remote *Vnode) + Shutdown func() + SuccessorLeaving func(local, remote *Vnode) + type ErrResponse struct + Err string + func (*ErrResponse) Descriptor() ([]byte, []int) + func (*ErrResponse) ProtoMessage() + func (m *ErrResponse) GetErr() string + func (m *ErrResponse) Reset() + func (m *ErrResponse) String() string + type FindSuccReq struct + Count int32 + Key []byte + VN *Vnode + func (*FindSuccReq) Descriptor() ([]byte, []int) + func (*FindSuccReq) ProtoMessage() + func (m *FindSuccReq) GetCount() int32 + func (m *FindSuccReq) GetKey() []byte + func (m *FindSuccReq) GetVN() *Vnode + func (m *FindSuccReq) Reset() + func (m *FindSuccReq) String() string + type GRPCTransport struct + func NewGRPCTransport(sock net.Listener, gserver *grpc.Server, rpcTimeout, connMaxIdle time.Duration) *GRPCTransport + func (cs *GRPCTransport) ClearPredecessor(target, self *Vnode) error + func (cs *GRPCTransport) ClearPredecessorServe(ctx context.Context, in *VnodePair) (*ErrResponse, error) + func (cs *GRPCTransport) FindSuccessors(vn *Vnode, n int, k []byte) ([]*Vnode, error) + func (cs *GRPCTransport) FindSuccessorsServe(ctx context.Context, in *FindSuccReq) (*VnodeListErr, error) + func (cs *GRPCTransport) GetPredecessor(vn *Vnode) (*Vnode, error) + func (cs *GRPCTransport) GetPredecessorServe(ctx context.Context, in *Vnode) (*VnodeError, error) + func (cs *GRPCTransport) ListVnodes(host string) ([]*Vnode, error) + func (cs *GRPCTransport) ListVnodesServe(ctx context.Context, in *StringParam) (*VnodeListErr, error) + func (cs *GRPCTransport) Notify(target, self *Vnode) ([]*Vnode, error) + func (cs *GRPCTransport) NotifyServe(ctx context.Context, in *VnodePair) (*VnodeListErr, error) + func (cs *GRPCTransport) Ping(target *Vnode) (bool, error) + func (cs *GRPCTransport) PingServe(ctx context.Context, in *Vnode) (*BoolErr, error) + func (cs *GRPCTransport) Register(v *Vnode, o VnodeRPC) + func (cs *GRPCTransport) Shutdown() + func (cs *GRPCTransport) SkipSuccessor(target, self *Vnode) error + func (cs *GRPCTransport) SkipSuccessorServe(ctx context.Context, in *VnodePair) (*ErrResponse, error) + func (cs *GRPCTransport) Status() map[string]interface{} + type IDecoder interface + Decode func(interface{}) error + type IEncoder interface + Encode func(interface{}) error + type LocalTransport struct + func (lt *LocalTransport) ClearPredecessor(target, self *Vnode) error + func (lt *LocalTransport) Deregister(v *Vnode) + func (lt *LocalTransport) FindSuccessors(vn *Vnode, n int, key []byte) ([]*Vnode, error) + func (lt *LocalTransport) GetPredecessor(vn *Vnode) (*Vnode, error) + func (lt *LocalTransport) ListVnodes(host string) ([]*Vnode, error) + func (lt *LocalTransport) Notify(vn, self *Vnode) ([]*Vnode, error) + func (lt *LocalTransport) Ping(vn *Vnode) (bool, error) + func (lt *LocalTransport) Register(v *Vnode, o VnodeRPC) + func (lt *LocalTransport) SkipSuccessor(target, self *Vnode) error + type Ring struct + func Create(conf *Config, trans Transport) (*Ring, error) + func Join(conf *Config, trans Transport, existing string) (*Ring, error) + func (r *Ring) Leave() error + func (r *Ring) Len() int + func (r *Ring) Less(i, j int) bool + func (r *Ring) ListVnodes(host string) ([]*Vnode, error) + func (r *Ring) Lookup(n int, key []byte) ([]*Vnode, error) + func (r *Ring) Shutdown() + func (r *Ring) Swap(i, j int) + type StringParam struct + Value string + func (*StringParam) Descriptor() ([]byte, []int) + func (*StringParam) ProtoMessage() + func (m *StringParam) GetValue() string + func (m *StringParam) Reset() + func (m *StringParam) String() string + type Transport interface + ClearPredecessor func(target, self *Vnode) error + FindSuccessors func(*Vnode, int, []byte) ([]*Vnode, error) + GetPredecessor func(*Vnode) (*Vnode, error) + ListVnodes func(string) ([]*Vnode, error) + Notify func(target, self *Vnode) ([]*Vnode, error) + Ping func(*Vnode) (bool, error) + Register func(*Vnode, VnodeRPC) + SkipSuccessor func(target, self *Vnode) error + func InitLocalTransport(remote Transport) Transport + type UTPTransport struct + RPCServe func(IEncoder, IDecoder) (interface{}, error) + func InitUTPTransport(layer *mux.Layer, dialTimeout, rpcTimeout, maxConnIdle time.Duration) (*UTPTransport, error) + func (t *UTPTransport) ClearPredecessor(target, self *Vnode) error + func (t *UTPTransport) FindSuccessors(vn *Vnode, n int, k []byte) ([]*Vnode, error) + func (t *UTPTransport) GetPredecessor(vn *Vnode) (*Vnode, error) + func (t *UTPTransport) ListVnodes(host string) ([]*Vnode, error) + func (t *UTPTransport) Notify(target, self *Vnode) ([]*Vnode, error) + func (t *UTPTransport) Ping(vn *Vnode) (bool, error) + func (t *UTPTransport) Register(v *Vnode, o VnodeRPC) + func (t *UTPTransport) Shutdown() + func (t *UTPTransport) SkipSuccessor(target, self *Vnode) error + type Vnode struct + Host string + Id []byte + func (*Vnode) Descriptor() ([]byte, []int) + func (*Vnode) ProtoMessage() + func (m *Vnode) GetHost() string + func (m *Vnode) GetId() []byte + func (m *Vnode) Reset() + func (m *Vnode) String() string + func (vn *Vnode) StringID() string + type VnodeError struct + Err string + VN *Vnode + func (*VnodeError) Descriptor() ([]byte, []int) + func (*VnodeError) ProtoMessage() + func (m *VnodeError) GetErr() string + func (m *VnodeError) GetVN() *Vnode + func (m *VnodeError) Reset() + func (m *VnodeError) String() string + type VnodeListErr struct + Err string + Vnodes []*Vnode + func (*VnodeListErr) Descriptor() ([]byte, []int) + func (*VnodeListErr) ProtoMessage() + func (m *VnodeListErr) GetErr() string + func (m *VnodeListErr) GetVnodes() []*Vnode + func (m *VnodeListErr) Reset() + func (m *VnodeListErr) String() string + type VnodePair struct + Self *Vnode + Target *Vnode + func (*VnodePair) Descriptor() ([]byte, []int) + func (*VnodePair) ProtoMessage() + func (m *VnodePair) GetSelf() *Vnode + func (m *VnodePair) GetTarget() *Vnode + func (m *VnodePair) Reset() + func (m *VnodePair) String() string + type VnodeRPC interface + ClearPredecessor func(*Vnode) error + FindSuccessors func(int, []byte) ([]*Vnode, error) + GetPredecessor func() (*Vnode, error) + Notify func(*Vnode) ([]*Vnode, error) + SkipSuccessor func(*Vnode) error