models

package
v0.0.0-...-7295f39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterChordServer

func RegisterChordServer(s *grpc.Server, srv ChordServer)

Types

type ChordClient

type ChordClient interface {
	// GetPredecessor returns the node believed to be the current predecessor.
	GetPredecessor(ctx context.Context, in *ER, opts ...grpc.CallOption) (*Node, error)
	// GetSuccessor returns the node believed to be the current successor.
	GetSuccessor(ctx context.Context, in *ER, opts ...grpc.CallOption) (*Node, error)
	// Notify notifies Chord that Node thinks it is our predecessor. This has
	// the potential to initiate the transferring of keys.
	Notify(ctx context.Context, in *Node, opts ...grpc.CallOption) (*ER, error)
	// FindSuccessor finds the node the succedes ID. May initiate RPC calls to
	// other nodes.
	FindSuccessor(ctx context.Context, in *ID, opts ...grpc.CallOption) (*Node, error)
	// CheckPredecessor checkes whether predecessor has failed.
	CheckPredecessor(ctx context.Context, in *ID, opts ...grpc.CallOption) (*ER, error)
	// SetPredecessor sets predecessor for a node.
	SetPredecessor(ctx context.Context, in *Node, opts ...grpc.CallOption) (*ER, error)
	// SetPredecessor sets predecessor for a node.
	SetSuccessor(ctx context.Context, in *Node, opts ...grpc.CallOption) (*ER, error)
	// Get returns the value in Chord ring for the given key.
	XGet(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	// Set writes a key value pair to the Chord ring.
	XSet(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error)
	// Delete returns the value in Chord ring for the given key.
	XDelete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	// Multiple delete returns the value in Chord ring between the given keys.
	XMultiDelete(ctx context.Context, in *MultiDeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	// RequestKeys returns the keys between given range from the Chord ring.
	XRequestKeys(ctx context.Context, in *RequestKeysRequest, opts ...grpc.CallOption) (*RequestKeysResponse, error)
}

func NewChordClient

func NewChordClient(cc *grpc.ClientConn) ChordClient

type ChordServer

type ChordServer interface {
	// GetPredecessor returns the node believed to be the current predecessor.
	GetPredecessor(context.Context, *ER) (*Node, error)
	// GetSuccessor returns the node believed to be the current successor.
	GetSuccessor(context.Context, *ER) (*Node, error)
	// Notify notifies Chord that Node thinks it is our predecessor. This has
	// the potential to initiate the transferring of keys.
	Notify(context.Context, *Node) (*ER, error)
	// FindSuccessor finds the node the succedes ID. May initiate RPC calls to
	// other nodes.
	FindSuccessor(context.Context, *ID) (*Node, error)
	// CheckPredecessor checkes whether predecessor has failed.
	CheckPredecessor(context.Context, *ID) (*ER, error)
	// SetPredecessor sets predecessor for a node.
	SetPredecessor(context.Context, *Node) (*ER, error)
	// SetPredecessor sets predecessor for a node.
	SetSuccessor(context.Context, *Node) (*ER, error)
	// Get returns the value in Chord ring for the given key.
	XGet(context.Context, *GetRequest) (*GetResponse, error)
	// Set writes a key value pair to the Chord ring.
	XSet(context.Context, *SetRequest) (*SetResponse, error)
	// Delete returns the value in Chord ring for the given key.
	XDelete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	// Multiple delete returns the value in Chord ring between the given keys.
	XMultiDelete(context.Context, *MultiDeleteRequest) (*DeleteResponse, error)
	// RequestKeys returns the keys between given range from the Chord ring.
	XRequestKeys(context.Context, *RequestKeysRequest) (*RequestKeysResponse, error)
}

type DeleteRequest

type DeleteRequest struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeleteRequest) Descriptor

func (*DeleteRequest) Descriptor() ([]byte, []int)

func (*DeleteRequest) GetKey

func (m *DeleteRequest) GetKey() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) Reset

func (m *DeleteRequest) Reset()

func (*DeleteRequest) String

func (m *DeleteRequest) String() string

func (*DeleteRequest) XXX_DiscardUnknown

func (m *DeleteRequest) XXX_DiscardUnknown()

func (*DeleteRequest) XXX_Marshal

func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteRequest) XXX_Merge

func (dst *DeleteRequest) XXX_Merge(src proto.Message)

func (*DeleteRequest) XXX_Size

func (m *DeleteRequest) XXX_Size() int

func (*DeleteRequest) XXX_Unmarshal

func (m *DeleteRequest) XXX_Unmarshal(b []byte) error

type DeleteResponse

type DeleteResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeleteResponse) Descriptor

func (*DeleteResponse) Descriptor() ([]byte, []int)

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) Reset

func (m *DeleteResponse) Reset()

func (*DeleteResponse) String

func (m *DeleteResponse) String() string

func (*DeleteResponse) XXX_DiscardUnknown

func (m *DeleteResponse) XXX_DiscardUnknown()

func (*DeleteResponse) XXX_Marshal

func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteResponse) XXX_Merge

func (dst *DeleteResponse) XXX_Merge(src proto.Message)

func (*DeleteResponse) XXX_Size

func (m *DeleteResponse) XXX_Size() int

func (*DeleteResponse) XXX_Unmarshal

func (m *DeleteResponse) XXX_Unmarshal(b []byte) error

type ER

type ER struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ER) Descriptor

func (*ER) Descriptor() ([]byte, []int)

func (*ER) ProtoMessage

func (*ER) ProtoMessage()

func (*ER) Reset

func (m *ER) Reset()

func (*ER) String

func (m *ER) String() string

func (*ER) XXX_DiscardUnknown

func (m *ER) XXX_DiscardUnknown()

func (*ER) XXX_Marshal

func (m *ER) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ER) XXX_Merge

func (dst *ER) XXX_Merge(src proto.Message)

func (*ER) XXX_Size

func (m *ER) XXX_Size() int

func (*ER) XXX_Unmarshal

func (m *ER) XXX_Unmarshal(b []byte) error

type GetRequest

type GetRequest struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetRequest) Descriptor

func (*GetRequest) Descriptor() ([]byte, []int)

func (*GetRequest) GetKey

func (m *GetRequest) GetKey() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetRequest) XXX_Merge

func (dst *GetRequest) XXX_Merge(src proto.Message)

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

func (m *GetRequest) XXX_Unmarshal(b []byte) error

type GetResponse

type GetResponse struct {
	Value                []byte   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetResponse) Descriptor

func (*GetResponse) Descriptor() ([]byte, []int)

func (*GetResponse) GetValue

func (m *GetResponse) GetValue() []byte

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) String

func (m *GetResponse) String() string

func (*GetResponse) XXX_DiscardUnknown

func (m *GetResponse) XXX_DiscardUnknown()

func (*GetResponse) XXX_Marshal

func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetResponse) XXX_Merge

func (dst *GetResponse) XXX_Merge(src proto.Message)

func (*GetResponse) XXX_Size

func (m *GetResponse) XXX_Size() int

func (*GetResponse) XXX_Unmarshal

func (m *GetResponse) XXX_Unmarshal(b []byte) error

type ID

type ID struct {
	Id                   []byte   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ID) Descriptor

func (*ID) Descriptor() ([]byte, []int)

func (*ID) GetId

func (m *ID) GetId() []byte

func (*ID) ProtoMessage

func (*ID) ProtoMessage()

func (*ID) Reset

func (m *ID) Reset()

func (*ID) String

func (m *ID) String() string

func (*ID) XXX_DiscardUnknown

func (m *ID) XXX_DiscardUnknown()

func (*ID) XXX_Marshal

func (m *ID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ID) XXX_Merge

func (dst *ID) XXX_Merge(src proto.Message)

func (*ID) XXX_Size

func (m *ID) XXX_Size() int

func (*ID) XXX_Unmarshal

func (m *ID) XXX_Unmarshal(b []byte) error

type KV

type KV struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*KV) Descriptor

func (*KV) Descriptor() ([]byte, []int)

func (*KV) GetKey

func (m *KV) GetKey() string

func (*KV) GetValue

func (m *KV) GetValue() string

func (*KV) ProtoMessage

func (*KV) ProtoMessage()

func (*KV) Reset

func (m *KV) Reset()

func (*KV) String

func (m *KV) String() string

func (*KV) XXX_DiscardUnknown

func (m *KV) XXX_DiscardUnknown()

func (*KV) XXX_Marshal

func (m *KV) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KV) XXX_Merge

func (dst *KV) XXX_Merge(src proto.Message)

func (*KV) XXX_Size

func (m *KV) XXX_Size() int

func (*KV) XXX_Unmarshal

func (m *KV) XXX_Unmarshal(b []byte) error

type MultiDeleteRequest

type MultiDeleteRequest struct {
	Keys                 []string `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MultiDeleteRequest) Descriptor

func (*MultiDeleteRequest) Descriptor() ([]byte, []int)

func (*MultiDeleteRequest) GetKeys

func (m *MultiDeleteRequest) GetKeys() []string

func (*MultiDeleteRequest) ProtoMessage

func (*MultiDeleteRequest) ProtoMessage()

func (*MultiDeleteRequest) Reset

func (m *MultiDeleteRequest) Reset()

func (*MultiDeleteRequest) String

func (m *MultiDeleteRequest) String() string

func (*MultiDeleteRequest) XXX_DiscardUnknown

func (m *MultiDeleteRequest) XXX_DiscardUnknown()

func (*MultiDeleteRequest) XXX_Marshal

func (m *MultiDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MultiDeleteRequest) XXX_Merge

func (dst *MultiDeleteRequest) XXX_Merge(src proto.Message)

func (*MultiDeleteRequest) XXX_Size

func (m *MultiDeleteRequest) XXX_Size() int

func (*MultiDeleteRequest) XXX_Unmarshal

func (m *MultiDeleteRequest) XXX_Unmarshal(b []byte) error

type Node

type Node struct {
	Id                   []byte   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Addr                 string   `protobuf:"bytes,2,opt,name=addr" json:"addr,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Node contains a node ID and address.

func (*Node) Descriptor

func (*Node) Descriptor() ([]byte, []int)

func (*Node) GetAddr

func (m *Node) GetAddr() string

func (*Node) GetId

func (m *Node) GetId() []byte

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) Reset

func (m *Node) Reset()

func (*Node) String

func (m *Node) String() string

func (*Node) XXX_DiscardUnknown

func (m *Node) XXX_DiscardUnknown()

func (*Node) XXX_Marshal

func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Node) XXX_Merge

func (dst *Node) XXX_Merge(src proto.Message)

func (*Node) XXX_Size

func (m *Node) XXX_Size() int

func (*Node) XXX_Unmarshal

func (m *Node) XXX_Unmarshal(b []byte) error

type RequestKeysRequest

type RequestKeysRequest struct {
	From                 []byte   `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	To                   []byte   `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RequestKeysRequest) Descriptor

func (*RequestKeysRequest) Descriptor() ([]byte, []int)

func (*RequestKeysRequest) GetFrom

func (m *RequestKeysRequest) GetFrom() []byte

func (*RequestKeysRequest) GetTo

func (m *RequestKeysRequest) GetTo() []byte

func (*RequestKeysRequest) ProtoMessage

func (*RequestKeysRequest) ProtoMessage()

func (*RequestKeysRequest) Reset

func (m *RequestKeysRequest) Reset()

func (*RequestKeysRequest) String

func (m *RequestKeysRequest) String() string

func (*RequestKeysRequest) XXX_DiscardUnknown

func (m *RequestKeysRequest) XXX_DiscardUnknown()

func (*RequestKeysRequest) XXX_Marshal

func (m *RequestKeysRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestKeysRequest) XXX_Merge

func (dst *RequestKeysRequest) XXX_Merge(src proto.Message)

func (*RequestKeysRequest) XXX_Size

func (m *RequestKeysRequest) XXX_Size() int

func (*RequestKeysRequest) XXX_Unmarshal

func (m *RequestKeysRequest) XXX_Unmarshal(b []byte) error

type RequestKeysResponse

type RequestKeysResponse struct {
	Values               []*KV    `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RequestKeysResponse) Descriptor

func (*RequestKeysResponse) Descriptor() ([]byte, []int)

func (*RequestKeysResponse) GetValues

func (m *RequestKeysResponse) GetValues() []*KV

func (*RequestKeysResponse) ProtoMessage

func (*RequestKeysResponse) ProtoMessage()

func (*RequestKeysResponse) Reset

func (m *RequestKeysResponse) Reset()

func (*RequestKeysResponse) String

func (m *RequestKeysResponse) String() string

func (*RequestKeysResponse) XXX_DiscardUnknown

func (m *RequestKeysResponse) XXX_DiscardUnknown()

func (*RequestKeysResponse) XXX_Marshal

func (m *RequestKeysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestKeysResponse) XXX_Merge

func (dst *RequestKeysResponse) XXX_Merge(src proto.Message)

func (*RequestKeysResponse) XXX_Size

func (m *RequestKeysResponse) XXX_Size() int

func (*RequestKeysResponse) XXX_Unmarshal

func (m *RequestKeysResponse) XXX_Unmarshal(b []byte) error

type SetRequest

type SetRequest struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SetRequest) Descriptor

func (*SetRequest) Descriptor() ([]byte, []int)

func (*SetRequest) GetKey

func (m *SetRequest) GetKey() string

func (*SetRequest) GetValue

func (m *SetRequest) GetValue() string

func (*SetRequest) ProtoMessage

func (*SetRequest) ProtoMessage()

func (*SetRequest) Reset

func (m *SetRequest) Reset()

func (*SetRequest) String

func (m *SetRequest) String() string

func (*SetRequest) XXX_DiscardUnknown

func (m *SetRequest) XXX_DiscardUnknown()

func (*SetRequest) XXX_Marshal

func (m *SetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetRequest) XXX_Merge

func (dst *SetRequest) XXX_Merge(src proto.Message)

func (*SetRequest) XXX_Size

func (m *SetRequest) XXX_Size() int

func (*SetRequest) XXX_Unmarshal

func (m *SetRequest) XXX_Unmarshal(b []byte) error

type SetResponse

type SetResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SetResponse) Descriptor

func (*SetResponse) Descriptor() ([]byte, []int)

func (*SetResponse) ProtoMessage

func (*SetResponse) ProtoMessage()

func (*SetResponse) Reset

func (m *SetResponse) Reset()

func (*SetResponse) String

func (m *SetResponse) String() string

func (*SetResponse) XXX_DiscardUnknown

func (m *SetResponse) XXX_DiscardUnknown()

func (*SetResponse) XXX_Marshal

func (m *SetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetResponse) XXX_Merge

func (dst *SetResponse) XXX_Merge(src proto.Message)

func (*SetResponse) XXX_Size

func (m *SetResponse) XXX_Size() int

func (*SetResponse) XXX_Unmarshal

func (m *SetResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL