kvtp

package
v0.0.0-...-fbe9487 Latest Latest
Warning

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

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

Documentation

Overview

Warning: Unexpected API changes will happen.

Index

Constants

View Source
const (
	CMD_Cancel = iota

	/* Coordinator Server. */
	CMD_Get
	CMD_Put

	/* Replication Server. */
	CMD_RsGet
	CMD_RsPut
	CMD_ReadRepair
	CMD_HintedHandoff
)

Commands.

View Source
const (
	RESP_None = iota

	RESP_WriteResponse
	RESP_ReadFound
	RESP_ReadNotFound
	RESP_Exception
)

Response Codes.

View Source
const (
	CL_NONE = iota
	CL_ONE
	CL_TWO
)

Consistency Levels.

Variables

This section is empty.

Functions

func NewRequest

func NewRequest() interface{}

func NewResponse

func NewResponse() interface{}

func ReqCancel

func ReqCancel(p *sync.Pool) func() rpcmux.Message

func ReqIsCancel

func ReqIsCancel(m rpcmux.Message) bool

Types

type Entry

type Entry struct {
	Time time.Time
	Val  []byte
}

func (*Entry) DecodeMsgpack

func (r *Entry) DecodeMsgpack(m *msgpack.Decoder) error

func (*Entry) EncodeMsgpack

func (r *Entry) EncodeMsgpack(m *msgpack.Encoder) error

type Request

type Request struct {
	Cmd         uint8
	Consistency uint8
	Time        time.Time
	Key         []byte
	Val         []byte
	// contains filtered or unexported fields
}

func (*Request) DecodeMsgpack

func (r *Request) DecodeMsgpack(m *msgpack.Decoder) error

func (*Request) EncodeMsgpack

func (r *Request) EncodeMsgpack(m *msgpack.Encoder) error

func (*Request) FromEntry

func (r *Request) FromEntry(e *Entry)

func (*Request) GetEntry

func (r *Request) GetEntry(e *Entry) *Entry

func (*Request) Seq

func (r *Request) Seq() uint64

func (*Request) SetSeq

func (r *Request) SetSeq(u uint64)

type Response

type Response struct {
	Code uint8
	Time time.Time
	Val  []byte
	// contains filtered or unexported fields
}

func (*Response) DecodeMsgpack

func (r *Response) DecodeMsgpack(m *msgpack.Decoder) error

func (*Response) EncodeMsgpack

func (r *Response) EncodeMsgpack(m *msgpack.Encoder) error

func (*Response) FromEntry

func (r *Response) FromEntry(e *Entry)

func (*Response) GetEntry

func (r *Response) GetEntry(e *Entry) *Entry

func (*Response) Seq

func (r *Response) Seq() uint64

func (*Response) SetSeq

func (r *Response) SetSeq(u uint64)

Jump to

Keyboard shortcuts

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