Documentation ¶
Overview ¶
Package protocol is a generated protocol buffer package. It is generated from these files: internal/protocol/commands.proto It has these top-level messages: Command Open Begin Frames FramesPage Undo End Checkpoint
package protocol implements serialization and deserialization logic for dqlite-specific Raft commands, that will be exeuted by the dqlite's FSM.
Index ¶
- Variables
- func MarshalCommand(command *Command) ([]byte, error)
- type Begin
- func (*Begin) Descriptor() ([]byte, []int)
- func (m *Begin) GetName() string
- func (m *Begin) GetTxid() uint64
- func (m *Begin) Marshal() (dAtA []byte, err error)
- func (m *Begin) MarshalTo(dAtA []byte) (int, error)
- func (*Begin) ProtoMessage()
- func (m *Begin) Reset()
- func (m *Begin) Size() (n int)
- func (m *Begin) String() string
- func (m *Begin) Unmarshal(dAtA []byte) error
- type Checkpoint
- func (*Checkpoint) Descriptor() ([]byte, []int)
- func (m *Checkpoint) GetName() string
- func (m *Checkpoint) Marshal() (dAtA []byte, err error)
- func (m *Checkpoint) MarshalTo(dAtA []byte) (int, error)
- func (*Checkpoint) ProtoMessage()
- func (m *Checkpoint) Reset()
- func (m *Checkpoint) Size() (n int)
- func (m *Checkpoint) String() string
- func (m *Checkpoint) Unmarshal(dAtA []byte) error
- type Command
- func NewBegin(txid uint64, name string) *Command
- func NewCheckpoint(name string) *Command
- func NewEnd(txid uint64) *Command
- func NewFrames(txid uint64, filename string, list bindings.WalReplicationFrameList) *Command
- func NewOpen(name string) *Command
- func NewUndo(txid uint64) *Command
- func UnmarshalCommand(data []byte) (*Command, error)
- func (*Command) Descriptor() ([]byte, []int)
- func (m *Command) GetBegin() *Begin
- func (m *Command) GetCheckpoint() *Checkpoint
- func (m *Command) GetEnd() *End
- func (m *Command) GetFrames() *Frames
- func (m *Command) GetOpen() *Open
- func (m *Command) GetPayload() isCommand_Payload
- func (m *Command) GetUndo() *Undo
- func (m *Command) Marshal() (dAtA []byte, err error)
- func (m *Command) MarshalTo(dAtA []byte) (int, error)
- func (c *Command) Name() string
- func (*Command) ProtoMessage()
- func (m *Command) Reset()
- func (m *Command) Size() (n int)
- func (m *Command) String() string
- func (m *Command) Unmarshal(dAtA []byte) error
- func (*Command) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type Command_Begin
- type Command_Checkpoint
- type Command_End
- type Command_Frames
- type Command_Open
- type Command_Undo
- type End
- func (*End) Descriptor() ([]byte, []int)
- func (m *End) GetTxid() uint64
- func (m *End) Marshal() (dAtA []byte, err error)
- func (m *End) MarshalTo(dAtA []byte) (int, error)
- func (*End) ProtoMessage()
- func (m *End) Reset()
- func (m *End) Size() (n int)
- func (m *End) String() string
- func (m *End) Unmarshal(dAtA []byte) error
- type Frames
- func (*Frames) Descriptor() ([]byte, []int)
- func (m *Frames) GetFilename() string
- func (m *Frames) GetIsCommit() int32
- func (m *Frames) GetPageData() []byte
- func (m *Frames) GetPageNumbers() []uint32
- func (m *Frames) GetPageSize() int32
- func (m *Frames) GetPages() []*FramesPage
- func (m *Frames) GetSyncFlags() uint32
- func (m *Frames) GetTruncate() uint32
- func (m *Frames) GetTxid() uint64
- func (m *Frames) Marshal() (dAtA []byte, err error)
- func (m *Frames) MarshalTo(dAtA []byte) (int, error)
- func (*Frames) ProtoMessage()
- func (m *Frames) Reset()
- func (m *Frames) Size() (n int)
- func (m *Frames) String() string
- func (m *Frames) Unmarshal(dAtA []byte) error
- type FramesPage
- func (*FramesPage) Descriptor() ([]byte, []int)
- func (m *FramesPage) GetData() []byte
- func (m *FramesPage) GetFlags() uint32
- func (m *FramesPage) GetNumber() uint32
- func (m *FramesPage) Marshal() (dAtA []byte, err error)
- func (m *FramesPage) MarshalTo(dAtA []byte) (int, error)
- func (*FramesPage) ProtoMessage()
- func (m *FramesPage) Reset()
- func (m *FramesPage) Size() (n int)
- func (m *FramesPage) String() string
- func (m *FramesPage) Unmarshal(dAtA []byte) error
- type Open
- func (*Open) Descriptor() ([]byte, []int)
- func (m *Open) GetName() string
- func (m *Open) Marshal() (dAtA []byte, err error)
- func (m *Open) MarshalTo(dAtA []byte) (int, error)
- func (*Open) ProtoMessage()
- func (m *Open) Reset()
- func (m *Open) Size() (n int)
- func (m *Open) String() string
- func (m *Open) Unmarshal(dAtA []byte) error
- type Undo
- func (*Undo) Descriptor() ([]byte, []int)
- func (m *Undo) GetTxid() uint64
- func (m *Undo) Marshal() (dAtA []byte, err error)
- func (m *Undo) MarshalTo(dAtA []byte) (int, error)
- func (*Undo) ProtoMessage()
- func (m *Undo) Reset()
- func (m *Undo) Size() (n int)
- func (m *Undo) String() string
- func (m *Undo) Unmarshal(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthCommands = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCommands = fmt.Errorf("proto: integer overflow") )
Functions ¶
func MarshalCommand ¶
MarshalCommand marshals a dqlite FSM command.
Types ¶
type Begin ¶
type Begin struct { Txid uint64 `protobuf:"varint,1,opt,name=txid,proto3" json:"txid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` }
Parameters to begin a new write transaction.
This command is not used anymore, but it's kept for backward-compatibility.
func (*Begin) Descriptor ¶
func (*Begin) ProtoMessage ¶
func (*Begin) ProtoMessage()
type Checkpoint ¶
type Checkpoint struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
Parameters to perform a WAL checkpoint.
func (*Checkpoint) Descriptor ¶
func (*Checkpoint) Descriptor() ([]byte, []int)
func (*Checkpoint) GetName ¶
func (m *Checkpoint) GetName() string
func (*Checkpoint) Marshal ¶
func (m *Checkpoint) Marshal() (dAtA []byte, err error)
func (*Checkpoint) ProtoMessage ¶
func (*Checkpoint) ProtoMessage()
func (*Checkpoint) Reset ¶
func (m *Checkpoint) Reset()
func (*Checkpoint) Size ¶
func (m *Checkpoint) Size() (n int)
func (*Checkpoint) String ¶
func (m *Checkpoint) String() string
func (*Checkpoint) Unmarshal ¶
func (m *Checkpoint) Unmarshal(dAtA []byte) error
type Command ¶
type Command struct { // Types that are valid to be assigned to Payload: // *Command_Open // *Command_Begin // *Command_Frames // *Command_Undo // *Command_End // *Command_Checkpoint Payload isCommand_Payload `protobuf_oneof:"Payload"` }
Command encapsulates the payload fo a dqlite Raft FSM command.
On the wire this will be a varint indentifying the command type, followed by the command payload.
func NewCheckpoint ¶
NewCheckpoint returns a new Checkpoint protobuf message.
func NewFrames ¶
func NewFrames(txid uint64, filename string, list bindings.WalReplicationFrameList) *Command
NewFrames returns a new WalFrames protobuf message.
func UnmarshalCommand ¶
UnmarshalCommand unmarshals a dqlite FSM command.
func (*Command) Descriptor ¶
func (*Command) GetCheckpoint ¶
func (m *Command) GetCheckpoint() *Checkpoint
func (*Command) GetPayload ¶
func (m *Command) GetPayload() isCommand_Payload
func (*Command) Name ¶
Name returns a human readable name for the command, based on its Params type.
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
type Command_Begin ¶
type Command_Begin struct {
Begin *Begin `protobuf:"bytes,2,opt,name=begin,oneof"`
}
func (*Command_Begin) Size ¶
func (m *Command_Begin) Size() (n int)
type Command_Checkpoint ¶
type Command_Checkpoint struct {
Checkpoint *Checkpoint `protobuf:"bytes,6,opt,name=checkpoint,oneof"`
}
func (*Command_Checkpoint) MarshalTo ¶
func (m *Command_Checkpoint) MarshalTo(dAtA []byte) (int, error)
func (*Command_Checkpoint) Size ¶
func (m *Command_Checkpoint) Size() (n int)
type Command_End ¶
type Command_End struct {
End *End `protobuf:"bytes,5,opt,name=end,oneof"`
}
func (*Command_End) Size ¶
func (m *Command_End) Size() (n int)
type Command_Frames ¶
type Command_Frames struct {
Frames *Frames `protobuf:"bytes,3,opt,name=frames,oneof"`
}
func (*Command_Frames) Size ¶
func (m *Command_Frames) Size() (n int)
type Command_Open ¶
type Command_Open struct {
Open *Open `protobuf:"bytes,1,opt,name=open,oneof"`
}
func (*Command_Open) Size ¶
func (m *Command_Open) Size() (n int)
type Command_Undo ¶
type Command_Undo struct {
Undo *Undo `protobuf:"bytes,4,opt,name=undo,oneof"`
}
func (*Command_Undo) Size ¶
func (m *Command_Undo) Size() (n int)
type End ¶
type End struct {
Txid uint64 `protobuf:"varint,1,opt,name=txid,proto3" json:"txid,omitempty"`
}
Parameters to end a write transaction, and update the WAL commit pointer.
This command is not used anymore, but it's kept for backward-compatibility.
func (*End) Descriptor ¶
func (*End) ProtoMessage ¶
func (*End) ProtoMessage()
type Frames ¶
type Frames struct { Txid uint64 `protobuf:"varint,1,opt,name=txid,proto3" json:"txid,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` Pages []*FramesPage `protobuf:"bytes,3,rep,name=pages" json:"pages,omitempty"` Truncate uint32 `protobuf:"varint,4,opt,name=truncate,proto3" json:"truncate,omitempty"` IsCommit int32 `protobuf:"varint,5,opt,name=is_commit,json=isCommit,proto3" json:"is_commit,omitempty"` SyncFlags uint32 `protobuf:"varint,6,opt,name=sync_flags,json=syncFlags,proto3" json:"sync_flags,omitempty"` Filename string `protobuf:"bytes,7,opt,name=filename,proto3" json:"filename,omitempty"` PageNumbers []uint32 `protobuf:"varint,8,rep,packed,name=page_numbers,json=pageNumbers" json:"page_numbers,omitempty"` PageData []byte `protobuf:"bytes,9,opt,name=page_data,json=pageData,proto3" json:"page_data,omitempty"` }
Parameters to append new frames to the WAL within a write transaction.
func (*Frames) Descriptor ¶
func (*Frames) GetFilename ¶
func (*Frames) GetIsCommit ¶
func (*Frames) GetPageData ¶
func (*Frames) GetPageNumbers ¶
func (*Frames) GetPageSize ¶
func (*Frames) GetPages ¶
func (m *Frames) GetPages() []*FramesPage
func (*Frames) GetSyncFlags ¶
func (*Frames) GetTruncate ¶
func (*Frames) ProtoMessage ¶
func (*Frames) ProtoMessage()
type FramesPage ¶
type FramesPage struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Flags uint32 `protobuf:"varint,2,opt,name=flags,proto3" json:"flags,omitempty"` Number uint32 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` }
A single frame of data in a Frames command.
FIXME: this is a legacy message only used in v1 of the protocol.
func (*FramesPage) Descriptor ¶
func (*FramesPage) Descriptor() ([]byte, []int)
func (*FramesPage) GetData ¶
func (m *FramesPage) GetData() []byte
func (*FramesPage) GetFlags ¶
func (m *FramesPage) GetFlags() uint32
func (*FramesPage) GetNumber ¶
func (m *FramesPage) GetNumber() uint32
func (*FramesPage) Marshal ¶
func (m *FramesPage) Marshal() (dAtA []byte, err error)
func (*FramesPage) ProtoMessage ¶
func (*FramesPage) ProtoMessage()
func (*FramesPage) Reset ¶
func (m *FramesPage) Reset()
func (*FramesPage) Size ¶
func (m *FramesPage) Size() (n int)
func (*FramesPage) String ¶
func (m *FramesPage) String() string
func (*FramesPage) Unmarshal ¶
func (m *FramesPage) Unmarshal(dAtA []byte) error
type Open ¶
type Open struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
Parameters to open a new database and setup the needed data structures for replication.
func (*Open) Descriptor ¶
func (*Open) ProtoMessage ¶
func (*Open) ProtoMessage()
type Undo ¶
type Undo struct {
Txid uint64 `protobuf:"varint,1,opt,name=txid,proto3" json:"txid,omitempty"`
}
Parameters to undo any previous WAL change in a write transaction.
func (*Undo) Descriptor ¶
func (*Undo) ProtoMessage ¶
func (*Undo) ProtoMessage()