Documentation ¶
Overview ¶
Package protocol implements Olric Binary Protocol.
Index ¶
- Constants
- Variables
- type AtomicExtra
- type BytesToConn
- type DMapMessage
- func (d *DMapMessage) Buffer() *bytes.Buffer
- func (d *DMapMessage) DMap() string
- func (d *DMapMessage) Decode() error
- func (d *DMapMessage) Encode() error
- func (d *DMapMessage) Extra() interface{}
- func (d *DMapMessage) Key() string
- func (d *DMapMessage) OpCode() OpCode
- func (d *DMapMessage) Response(buf *bytes.Buffer) EncodeDecoder
- func (d *DMapMessage) SetBuffer(buf *bytes.Buffer)
- func (d *DMapMessage) SetDMap(dmap string)
- func (d *DMapMessage) SetExtra(extra interface{})
- func (d *DMapMessage) SetKey(key string)
- func (d *DMapMessage) SetStatus(code StatusCode)
- func (d *DMapMessage) SetValue(value []byte)
- func (d *DMapMessage) Status() StatusCode
- func (d *DMapMessage) Value() []byte
- type DMapMessageHeader
- type DTopicAddListenerExtra
- type DTopicMessage
- func (d *DTopicMessage) Buffer() *bytes.Buffer
- func (d *DTopicMessage) DTopic() string
- func (d *DTopicMessage) Decode() error
- func (d *DTopicMessage) Encode() error
- func (d *DTopicMessage) Extra() interface{}
- func (d *DTopicMessage) OpCode() OpCode
- func (d *DTopicMessage) Response(buf *bytes.Buffer) EncodeDecoder
- func (d *DTopicMessage) SetBuffer(buf *bytes.Buffer)
- func (d *DTopicMessage) SetDTopic(dtopic string)
- func (d *DTopicMessage) SetExtra(extra interface{})
- func (d *DTopicMessage) SetStatus(code StatusCode)
- func (d *DTopicMessage) SetValue(value []byte)
- func (d *DTopicMessage) Status() StatusCode
- func (d *DTopicMessage) Value() []byte
- type DTopicMessageHeader
- type DTopicRemoveListenerExtra
- type EncodeDecoder
- type ExpireExtra
- type Header
- type LengthOfPartExtra
- type LocalQueryExtra
- type LockExtra
- type LockWithTimeoutExtra
- type MagicCode
- type OpCode
- type PipelineMessage
- func (d *PipelineMessage) Buffer() *bytes.Buffer
- func (d *PipelineMessage) Decode() error
- func (d *PipelineMessage) Encode() error
- func (d *PipelineMessage) Extra() interface{}
- func (d *PipelineMessage) OpCode() OpCode
- func (d *PipelineMessage) Response(buf *bytes.Buffer) EncodeDecoder
- func (d *PipelineMessage) SetBuffer(buf *bytes.Buffer)
- func (d *PipelineMessage) SetExtra(extra interface{})
- func (d *PipelineMessage) SetStatus(code StatusCode)
- func (d *PipelineMessage) SetValue(value []byte)
- func (d *PipelineMessage) Status() StatusCode
- func (d *PipelineMessage) Value() []byte
- type PipelineMessageHeader
- type PutExExtra
- type PutExtra
- type PutIfExExtra
- type PutIfExtra
- type QueryExtra
- type StatusCode
- type StreamCreatedExtra
- type StreamMessage
- func (d *StreamMessage) Buffer() *bytes.Buffer
- func (d *StreamMessage) Close()
- func (d *StreamMessage) Conn() io.ReadWriteCloser
- func (d *StreamMessage) Decode() error
- func (d *StreamMessage) Encode() error
- func (d *StreamMessage) Extra() interface{}
- func (d *StreamMessage) OpCode() OpCode
- func (d *StreamMessage) Response(buf *bytes.Buffer) EncodeDecoder
- func (d *StreamMessage) SetBuffer(buf *bytes.Buffer)
- func (d *StreamMessage) SetCancelFunc(f context.CancelFunc)
- func (d *StreamMessage) SetConn(conn io.ReadWriteCloser)
- func (d *StreamMessage) SetExtra(extra interface{})
- func (d *StreamMessage) SetStatus(code StatusCode)
- func (d *StreamMessage) SetValue(value []byte)
- func (d *StreamMessage) Status() StatusCode
- func (d *StreamMessage) Value() []byte
- type StreamMessageExtra
- type StreamMessageHeader
- type SystemMessage
- func (d *SystemMessage) Buffer() *bytes.Buffer
- func (d *SystemMessage) Decode() error
- func (d *SystemMessage) Encode() error
- func (d *SystemMessage) Extra() interface{}
- func (d *SystemMessage) OpCode() OpCode
- func (d *SystemMessage) Response(buf *bytes.Buffer) EncodeDecoder
- func (d *SystemMessage) SetBuffer(buf *bytes.Buffer)
- func (d *SystemMessage) SetExtra(extra interface{})
- func (d *SystemMessage) SetStatus(code StatusCode)
- func (d *SystemMessage) SetValue(value []byte)
- func (d *SystemMessage) Status() StatusCode
- func (d *SystemMessage) Value() []byte
- type SystemMessageHeader
- type UpdateRoutingExtra
Constants ¶
const ( OpPut = OpCode(iota) + 1 OpPutEx OpPutIf OpPutIfEx OpGet OpDelete OpDestroy OpLock OpLockWithTimeout OpUnlock OpIncr OpDecr OpGetPut OpUpdateRouting OpPutReplica OpPutIfReplica OpPutExReplica OpPutIfExReplica OpDeletePrev OpGetPrev OpGetBackup OpDeleteBackup OpDestroyDMap OpMoveDMap OpLengthOfPart OpPipeline OpPing OpStats OpExpire OpExpireReplica OpQuery OpLocalQuery OpPublishDTopicMessage OpDestroyDTopic OpDTopicPublish OpDTopicAddListener OpDTopicRemoveListener OpDTopicDestroy OpCreateStream OpStreamCreated OpStreamMessage OpStreamPing OpStreamPong )
ops
const ( StatusOK = StatusCode(iota) + 1 StatusInternalServerError StatusErrKeyNotFound StatusErrNoSuchLock StatusErrLockNotAcquired StatusErrWriteQuorum StatusErrReadQuorum StatusErrOperationTimeout StatusErrKeyFound StatusErrClusterQuorum StatusErrUnknownOperation StatusErrEndOfQuery StatusErrServerGone StatusErrInvalidArgument StatusErrKeyTooLarge StatusErrNotImplemented )
status codes
const DMapMessageHeaderSize uint32 = 7
DMapMessageHeaderSize defines total count of bytes in a DMapMessage
const DTopicMessageHeaderSize uint32 = 5
DTopicMessageHeaderSize defines total count of bytes in a DTopicMessage
const PipelineMessageHeaderSize uint32 = 3
PipelineMessageHeaderSize defines total count of bytes in a PipelineMessage
const StreamMessageHeaderSize uint32 = 3
StreamMessageHeaderSize defines total count of bytes in a StreamMessage
const SystemMessageHeaderSize uint32 = 3
Variables ¶
var ErrConnClosed = errors.New("connection closed")
ErrConnClosed means that the underlying TCP connection has been closed by the client or operating system.
var Version1 uint8 = 1
Version1 denotes the first public version of Olric Binary Protocol.
Functions ¶
This section is empty.
Types ¶
type AtomicExtra ¶
type AtomicExtra struct {
Timestamp int64
}
AtomicExtra defines extra values for this operation.
type BytesToConn ¶ added in v0.3.0
BytesToConn translates bytes.Buffer into io.ReadWriteCloser interface. It's useful to implement pipeline in OBP.
func NewBytesToConn ¶ added in v0.3.0
func NewBytesToConn(data []byte) *BytesToConn
NewBytesToConn returns a new BytesToConn. The underlying bytes.Buffer retrieves from the pool.
func (*BytesToConn) Close ¶ added in v0.3.0
func (b *BytesToConn) Close() error
Close resets and recycles underlying bytes.Buffer.
type DMapMessage ¶ added in v0.3.0
type DMapMessage struct { Header DMapMessageHeader // contains filtered or unexported fields }
DMapMessage is a message type in OBP. It can be used to access and modify DMap data structure.
func NewDMapMessage ¶ added in v0.3.0
func NewDMapMessage(opcode OpCode) *DMapMessage
NewDMapMessage returns a new DMapMessage with the given operation code.
func NewDMapMessageFromRequest ¶ added in v0.3.0
func NewDMapMessageFromRequest(buf *bytes.Buffer) *DMapMessage
NewDMapMessageFromRequest returns a new DMapMessage for the given bytes.Buffer. The caller can use Decode method to read message from the raw data.
func (*DMapMessage) Buffer ¶ added in v0.3.0
func (d *DMapMessage) Buffer() *bytes.Buffer
Buffer returns the underlying bytes.Buffer
func (*DMapMessage) DMap ¶ added in v0.3.0
func (d *DMapMessage) DMap() string
Returns the DMap name.
func (*DMapMessage) Decode ¶ added in v0.3.0
func (d *DMapMessage) Decode() error
Decode decodes message from byte form into DMapMessage.
func (*DMapMessage) Encode ¶ added in v0.3.0
func (d *DMapMessage) Encode() error
Encode encodes the message into byte form.
func (*DMapMessage) Extra ¶ added in v0.3.0
func (d *DMapMessage) Extra() interface{}
Extra returns the extra section of the message, if there is any.
func (*DMapMessage) Key ¶ added in v0.3.0
func (d *DMapMessage) Key() string
Key returns the key for this DMap message.
func (*DMapMessage) OpCode ¶ added in v0.3.0
func (d *DMapMessage) OpCode() OpCode
OpCode returns operation code of the message
func (*DMapMessage) Response ¶ added in v0.3.0
func (d *DMapMessage) Response(buf *bytes.Buffer) EncodeDecoder
Response generates a response message for the request. This is a shortcut function to reduce boilerplate code.
func (*DMapMessage) SetBuffer ¶ added in v0.3.0
func (d *DMapMessage) SetBuffer(buf *bytes.Buffer)
SetBuffer sets the underlying bytes.Buffer. It should be recycled by the caller.
func (*DMapMessage) SetDMap ¶ added in v0.3.0
func (d *DMapMessage) SetDMap(dmap string)
SetDMap sets the DMap name for this message.
func (*DMapMessage) SetExtra ¶ added in v0.3.0
func (d *DMapMessage) SetExtra(extra interface{})
SetExtra sets the extra section for the message, if there is any.
func (*DMapMessage) SetKey ¶ added in v0.3.0
func (d *DMapMessage) SetKey(key string)
SetKey sets the key for this DMap message.
func (*DMapMessage) SetStatus ¶ added in v0.3.0
func (d *DMapMessage) SetStatus(code StatusCode)
SetStatus sets a status code for the message.
func (*DMapMessage) SetValue ¶ added in v0.3.0
func (d *DMapMessage) SetValue(value []byte)
SetValue writes the given byte slice into the underlying bytes.Buffer
func (*DMapMessage) Status ¶ added in v0.3.0
func (d *DMapMessage) Status() StatusCode
Status returns status code.
func (*DMapMessage) Value ¶ added in v0.3.0
func (d *DMapMessage) Value() []byte
Value returns the value
type DMapMessageHeader ¶ added in v0.3.0
type DMapMessageHeader struct { Op OpCode // 1 DMapLen uint16 // 2 KeyLen uint16 // 2 ExtraLen uint8 // 1 StatusCode StatusCode // 1 }
Header defines a message header for both request and response.
type DTopicAddListenerExtra ¶ added in v0.3.0
type DTopicMessage ¶ added in v0.3.0
type DTopicMessage struct { Header DTopicMessageHeader // contains filtered or unexported fields }
DTopicMessage is a message type in OBP. It can be used to access and modify DTopic data structure.
func NewDTopicMessage ¶ added in v0.3.0
func NewDTopicMessage(opcode OpCode) *DTopicMessage
NewDTopicMessage returns a new DTopicMessage with the given operation code.
func NewDTopicMessageFromRequest ¶ added in v0.3.0
func NewDTopicMessageFromRequest(buf *bytes.Buffer) *DTopicMessage
NewDTopicMessageFromRequest returns a new DTopicMessage for the given bytes.Buffer. The caller can use Decode method to read message from the raw data.
func (*DTopicMessage) Buffer ¶ added in v0.3.0
func (d *DTopicMessage) Buffer() *bytes.Buffer
Buffer returns the underlying bytes.Buffer
func (*DTopicMessage) DTopic ¶ added in v0.3.0
func (d *DTopicMessage) DTopic() string
Returns the DTopic name.
func (*DTopicMessage) Decode ¶ added in v0.3.0
func (d *DTopicMessage) Decode() error
Decode decodes message from byte form into DTopicMessage.
func (*DTopicMessage) Encode ¶ added in v0.3.0
func (d *DTopicMessage) Encode() error
Encode encodes the message into byte form.
func (*DTopicMessage) Extra ¶ added in v0.3.0
func (d *DTopicMessage) Extra() interface{}
Extra returns the extra section of the message, if there is any.
func (*DTopicMessage) OpCode ¶ added in v0.3.0
func (d *DTopicMessage) OpCode() OpCode
OpCode returns operation code of the message
func (*DTopicMessage) Response ¶ added in v0.3.0
func (d *DTopicMessage) Response(buf *bytes.Buffer) EncodeDecoder
Response generates a response message for the request. This is a shortcut function to reduce boilerplate code.
func (*DTopicMessage) SetBuffer ¶ added in v0.3.0
func (d *DTopicMessage) SetBuffer(buf *bytes.Buffer)
SetBuffer sets the underlying bytes.Buffer. It should be recycled by the caller.
func (*DTopicMessage) SetDTopic ¶ added in v0.3.0
func (d *DTopicMessage) SetDTopic(dtopic string)
SetDTopic sets the DTopic name for this message.
func (*DTopicMessage) SetExtra ¶ added in v0.3.0
func (d *DTopicMessage) SetExtra(extra interface{})
SetExtra sets the extra section for the message, if there is any.
func (*DTopicMessage) SetStatus ¶ added in v0.3.0
func (d *DTopicMessage) SetStatus(code StatusCode)
SetStatus sets a status code for the message.
func (*DTopicMessage) SetValue ¶ added in v0.3.0
func (d *DTopicMessage) SetValue(value []byte)
SetValue writes the given byte slice into the underlying bytes.Buffer
func (*DTopicMessage) Status ¶ added in v0.3.0
func (d *DTopicMessage) Status() StatusCode
Status returns status code.
func (*DTopicMessage) Value ¶ added in v0.3.0
func (d *DTopicMessage) Value() []byte
Value returns the value
type DTopicMessageHeader ¶ added in v0.3.0
type DTopicMessageHeader struct { Op OpCode // 1 DTopicLen uint16 // 2 ExtraLen uint8 // 1 StatusCode StatusCode // 1 }
Header defines a message header for both request and response.
type DTopicRemoveListenerExtra ¶ added in v0.3.0
type DTopicRemoveListenerExtra struct {
ListenerID uint64
}
type EncodeDecoder ¶ added in v0.3.0
type EncodeDecoder interface { // Encode encodes the message and writes into a bytes.Buffer. Encode() error // Decode decodes the message from the given bytes.Buffer. Decode() error // SetStatus sets a status code for the message. SetStatus(StatusCode) // Status returns status code. Status() StatusCode // SetValue writes the given byte slice into the underlying bytes.Buffer SetValue([]byte) // Value returns the value Value() []byte // OpCode returns operation code of the message OpCode() OpCode // SetBuffer sets the underlying bytes.Buffer. It should be recycled by the caller. SetBuffer(*bytes.Buffer) // Buffer returns the underlying bytes.Buffer Buffer() *bytes.Buffer // SetExtra sets the extra section for the message, if there is any. SetExtra(interface{}) // Extra returns the extra section of the message, if there is any. Extra() interface{} // Response generates a response message for the message. Response(*bytes.Buffer) EncodeDecoder }
EncodeDecoder is an interface that defines methods for encoding/decoding a messages in OBP.
type ExpireExtra ¶
ExpireExtrrea defines extra values for this operation.
type Header ¶
type Header struct { Magic MagicCode // 1 byte Version uint8 // 1 byte MessageLength uint32 // 4 bytes }
Header is a shared message header for all the message types in Olric Binary Protocol.
func ReadMessage ¶ added in v0.3.0
ReadMessage reads the whole message from src into the given bytes.Buffer. Header can be used to determine message. Then you can pick an appropriate message type and decode it.
type LengthOfPartExtra ¶
LengthOfPartExtra defines extra values for this operation.
type LocalQueryExtra ¶
type LocalQueryExtra struct {
PartID uint64
}
type LockExtra ¶
type LockExtra struct {
Deadline int64
}
LockExtra defines extra values for this operation.
type LockWithTimeoutExtra ¶
LockWithTimeoutExtra defines extra values for this operation.
type MagicCode ¶
type MagicCode uint8
MagicCode defines an unique code to distinguish a request message from a response message in Olric Binary Protocol.
type PipelineMessage ¶ added in v0.3.0
type PipelineMessage struct { Header PipelineMessageHeader // contains filtered or unexported fields }
PipelineMessage is a message type in OBP. It can be used to access and modify Pipeline data structure.
func NewPipelineMessage ¶ added in v0.3.0
func NewPipelineMessage(opcode OpCode) *PipelineMessage
NewPipelineMessage returns a new PipelineMessage with the given operation code.
func NewPipelineMessageFromRequest ¶ added in v0.3.0
func NewPipelineMessageFromRequest(buf *bytes.Buffer) *PipelineMessage
NewPipelineMessageFromRequest returns a new PipelineMessage for the given bytes.Buffer. The caller can use Decode method to read message from the raw data.
func (*PipelineMessage) Buffer ¶ added in v0.3.0
func (d *PipelineMessage) Buffer() *bytes.Buffer
Buffer returns the underlying bytes.Buffer
func (*PipelineMessage) Decode ¶ added in v0.3.0
func (d *PipelineMessage) Decode() error
Decode decodes message from byte form into PipelineMessage.
func (*PipelineMessage) Encode ¶ added in v0.3.0
func (d *PipelineMessage) Encode() error
Encode encodes the message into byte form.
func (*PipelineMessage) Extra ¶ added in v0.3.0
func (d *PipelineMessage) Extra() interface{}
Extra returns the extra section of the message, if there is any.
func (*PipelineMessage) OpCode ¶ added in v0.3.0
func (d *PipelineMessage) OpCode() OpCode
OpCode returns operation code of the message
func (*PipelineMessage) Response ¶ added in v0.3.0
func (d *PipelineMessage) Response(buf *bytes.Buffer) EncodeDecoder
Response generates a response message for the request. This is a shortcut function to reduce boilerplate code.
func (*PipelineMessage) SetBuffer ¶ added in v0.3.0
func (d *PipelineMessage) SetBuffer(buf *bytes.Buffer)
SetBuffer sets the underlying bytes.Buffer. It should be recycled by the caller.
func (*PipelineMessage) SetExtra ¶ added in v0.3.0
func (d *PipelineMessage) SetExtra(extra interface{})
SetExtra sets the extra section for the message, if there is any.
func (*PipelineMessage) SetStatus ¶ added in v0.3.0
func (d *PipelineMessage) SetStatus(code StatusCode)
SetStatus sets a status code for the message.
func (*PipelineMessage) SetValue ¶ added in v0.3.0
func (d *PipelineMessage) SetValue(value []byte)
SetValue writes the given byte slice into the underlying bytes.Buffer
func (*PipelineMessage) Status ¶ added in v0.3.0
func (d *PipelineMessage) Status() StatusCode
Status returns status code.
func (*PipelineMessage) Value ¶ added in v0.3.0
func (d *PipelineMessage) Value() []byte
Value returns the value
type PipelineMessageHeader ¶ added in v0.3.0
type PipelineMessageHeader struct { Op OpCode // 1 ExtraLen uint8 // 1 StatusCode StatusCode // 1 }
Header defines a message header for both request and response.
type PutExExtra ¶
PutExExtra defines extra values for this operation.
type PutExtra ¶
type PutExtra struct {
Timestamp int64
}
PutExtra defines extra values for this operation.
type PutIfExExtra ¶
PutIfExExtra defines extra values for this operation.
type PutIfExtra ¶
PutIfExtra defines extra values for this operation.
type QueryExtra ¶
type QueryExtra struct {
PartID uint64
}
type StatusCode ¶
type StatusCode uint8
type StreamCreatedExtra ¶ added in v0.3.0
type StreamCreatedExtra struct {
StreamID uint64
}
type StreamMessage ¶ added in v0.3.0
type StreamMessage struct { Header StreamMessageHeader // contains filtered or unexported fields }
StreamMessage is a message type in OBP. It can be used to access and modify Stream data structure.
func ConvertToStreamMessage ¶ added in v0.3.0
func ConvertToStreamMessage(msg EncodeDecoder, listenerID uint64) *StreamMessage
func NewStreamMessage ¶ added in v0.3.0
func NewStreamMessage(opcode OpCode) *StreamMessage
NewStreamMessage returns a new StreamMessage with the given operation code.
func NewStreamMessageFromRequest ¶ added in v0.3.0
func NewStreamMessageFromRequest(buf *bytes.Buffer) *StreamMessage
NewStreamMessageFromRequest returns a new StreamMessage for the given bytes.Buffer. The caller can use Decode method to read message from the raw data.
func (*StreamMessage) Buffer ¶ added in v0.3.0
func (d *StreamMessage) Buffer() *bytes.Buffer
Buffer returns the underlying bytes.Buffer
func (*StreamMessage) Close ¶ added in v0.3.0
func (d *StreamMessage) Close()
func (*StreamMessage) Conn ¶ added in v0.3.0
func (d *StreamMessage) Conn() io.ReadWriteCloser
func (*StreamMessage) Decode ¶ added in v0.3.0
func (d *StreamMessage) Decode() error
Decode decodes message from byte form into StreamMessage.
func (*StreamMessage) Encode ¶ added in v0.3.0
func (d *StreamMessage) Encode() error
Encode encodes the message into byte form.
func (*StreamMessage) Extra ¶ added in v0.3.0
func (d *StreamMessage) Extra() interface{}
Extra returns the extra section of the message, if there is any.
func (*StreamMessage) OpCode ¶ added in v0.3.0
func (d *StreamMessage) OpCode() OpCode
OpCode returns operation code of the message
func (*StreamMessage) Response ¶ added in v0.3.0
func (d *StreamMessage) Response(buf *bytes.Buffer) EncodeDecoder
Response generates a response message for the request. This is a shortcut function to reduce boilerplate code.
func (*StreamMessage) SetBuffer ¶ added in v0.3.0
func (d *StreamMessage) SetBuffer(buf *bytes.Buffer)
SetBuffer sets the underlying bytes.Buffer. It should be recycled by the caller.
func (*StreamMessage) SetCancelFunc ¶ added in v0.3.0
func (d *StreamMessage) SetCancelFunc(f context.CancelFunc)
func (*StreamMessage) SetConn ¶ added in v0.3.0
func (d *StreamMessage) SetConn(conn io.ReadWriteCloser)
func (*StreamMessage) SetExtra ¶ added in v0.3.0
func (d *StreamMessage) SetExtra(extra interface{})
SetExtra sets the extra section for the message, if there is any.
func (*StreamMessage) SetStatus ¶ added in v0.3.0
func (d *StreamMessage) SetStatus(code StatusCode)
SetStatus sets a status code for the message.
func (*StreamMessage) SetValue ¶ added in v0.3.0
func (d *StreamMessage) SetValue(value []byte)
SetValue writes the given byte slice into the underlying bytes.Buffer
func (*StreamMessage) Status ¶ added in v0.3.0
func (d *StreamMessage) Status() StatusCode
Status returns status code.
func (*StreamMessage) Value ¶ added in v0.3.0
func (d *StreamMessage) Value() []byte
Value returns the value
type StreamMessageExtra ¶ added in v0.3.0
type StreamMessageExtra struct {
ListenerID uint64
}
type StreamMessageHeader ¶ added in v0.3.0
type StreamMessageHeader struct { Op OpCode // 1 ExtraLen uint8 // 1 StatusCode StatusCode // 1 }
Header defines a message header for both request and response.
type SystemMessage ¶ added in v0.3.0
type SystemMessage struct { Header SystemMessageHeader // contains filtered or unexported fields }
func NewSystemMessage ¶ added in v0.3.0
func NewSystemMessage(opcode OpCode) *SystemMessage
func NewSystemMessageFromRequest ¶ added in v0.3.0
func NewSystemMessageFromRequest(buf *bytes.Buffer) *SystemMessage
func (*SystemMessage) Buffer ¶ added in v0.3.0
func (d *SystemMessage) Buffer() *bytes.Buffer
func (*SystemMessage) Decode ¶ added in v0.3.0
func (d *SystemMessage) Decode() error
func (*SystemMessage) Encode ¶ added in v0.3.0
func (d *SystemMessage) Encode() error
Encode writes a protocol message to given TCP connection by encoding it.
func (*SystemMessage) Extra ¶ added in v0.3.0
func (d *SystemMessage) Extra() interface{}
func (*SystemMessage) OpCode ¶ added in v0.3.0
func (d *SystemMessage) OpCode() OpCode
func (*SystemMessage) Response ¶ added in v0.3.0
func (d *SystemMessage) Response(buf *bytes.Buffer) EncodeDecoder
func (*SystemMessage) SetBuffer ¶ added in v0.3.0
func (d *SystemMessage) SetBuffer(buf *bytes.Buffer)
func (*SystemMessage) SetExtra ¶ added in v0.3.0
func (d *SystemMessage) SetExtra(extra interface{})
func (*SystemMessage) SetStatus ¶ added in v0.3.0
func (d *SystemMessage) SetStatus(code StatusCode)
func (*SystemMessage) SetValue ¶ added in v0.3.0
func (d *SystemMessage) SetValue(value []byte)
func (*SystemMessage) Status ¶ added in v0.3.0
func (d *SystemMessage) Status() StatusCode
func (*SystemMessage) Value ¶ added in v0.3.0
func (d *SystemMessage) Value() []byte
type SystemMessageHeader ¶ added in v0.3.0
type SystemMessageHeader struct { Op OpCode // 1 ExtraLen uint8 // 1 StatusCode StatusCode // 1 }
Header defines a message header for both request and response.
type UpdateRoutingExtra ¶
type UpdateRoutingExtra struct {
CoordinatorID uint64
}
UpdateRoutingExtra defines extra values for this operation.