pgproto

package
v0.0.0-...-d4c7a2f Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthTypeOk                = 0
	AuthTypeCleartextPassword = 3
	AuthTypeMD5Password       = 5
)
View Source
const (

	// PgAuthentication is just a general authentication byte prefix.
	PgAuthentication = 'R'

	PgAuthenticationOk                = 'R'
	PgAuthenticationKerberosV5        = 'R'
	PgAuthenticationCleartextPassword = 'R'
	PgAuthenticationMD5Password       = 'R'
	PgAuthenticationSCMCredential     = 'R'
	PgAuthenticationGSS               = 'R'
	PgAuthenticationSSPI              = 'R'
	PgAuthenticationGSSContinue       = 'R'
	PgAuthenticationSASL              = 'R'
	PgAuthenticationSASLContinue      = 'R'
	PgAuthenticationSASLFinal         = 'R'
	PgBackendKeyData                  = 'K'
	PgBindComplete                    = '2'
	PgCloseComplete                   = '3'
	PgCommandComplete                 = 'C'
	PgCopyInResponse                  = 'G'
	PgCopyOutResponse                 = 'H'
	PgCopyBothResponse                = 'W'
	PgDataRow                         = 'D'
	PgEmptyQueryResponse              = 'I'
	PgErrorResponse                   = 'E'
	PgFunctionCallResponse            = 'B'
	PgNegotiateProtocolVersion        = 'v'
	PgNoData                          = 'n'
	PgNoticeResponse                  = 'N'
	PgNotificationResponse            = 'A'
	PgParameterDescription            = 't'
	PgParameterStatus                 = 'S'
	PgParseComplete                   = '1'
	PgPortialSuspended                = 's'
	PgReadyForQuery                   = 'Z'
	PgRowDescription                  = 'T'

	// PgBind is the byte prefix for bind messages from the client.
	PgBind                = 'B'
	PgClose               = 'C'
	PgCopyFail            = 'f'
	PgDescribe            = 'D'
	PgExecute             = 'E'
	PgFlush               = 'H'
	PgFunctionCall        = 'F'
	PgGSSResponse         = 'p'
	PgParse               = 'P'
	PgPasswordMessage     = 'p'
	PgQuery               = 'Q'
	PgSASLInitialResponse = 'p'
	PgSASLResponse        = 'p'
	PgSync                = 'S'
	PgTerminate           = 'X'

	// RaftAppendEntriesRequest is the byte prefix for append entries from the leader.
	RaftAppendEntriesRequest   = 'a'
	RaftRequestVoteRequest     = 'v'
	RaftInstallSnapshotRequest = 'i'

	// RaftRPCResponse is a generic tag
	RaftRPCResponse             = 'r'
	RaftAppendEntriesResponse   = 'Y'
	RaftRequestVoteResponse     = 'V'
	RaftInstallSnapshotResponse = 'M'

	// RpcSequenceResponse indicates sequence metadata.
	RpcSequenceRequest  = '*'
	RpcSequenceResponse = '`'
	RpcJoinRequest      = 'j'
	RpcDiscoveryRequest = 'm'
	RpcCommandRequest   = '$'
	RpcCommandResponse  = '~'

	// Both
	PgCopyData = 'd'
	PgCopyDone = 'c'
)
View Source
const (
	TextFormat   = 0
	BinaryFormat = 1
)
View Source
const (
	RaftNumber            = 20190109
	RpcNumber             = 19950202
	ProtocolVersionNumber = 196608 // 3.0

)

Variables

View Source
var (
	RaftStartupMessageError = errors.New("startup message is raft")
	RpcStartupMessageError  = errors.New("startup message is rpc")
)

Functions

This section is empty.

Types

type AppendEntriesRequest

type AppendEntriesRequest struct {
	raft.AppendEntriesRequest
}

func (*AppendEntriesRequest) Decode

func (appendEntries *AppendEntriesRequest) Decode(src []byte) error

func (*AppendEntriesRequest) Encode

func (appendEntries *AppendEntriesRequest) Encode(dst []byte) []byte

func (AppendEntriesRequest) Frontend

func (AppendEntriesRequest) Frontend()

func (AppendEntriesRequest) Raft

func (AppendEntriesRequest) Raft()

type AppendEntriesResponse

type AppendEntriesResponse struct {
	raft.AppendEntriesResponse
	Error error
}

func (AppendEntriesResponse) Backend

func (AppendEntriesResponse) Backend()

func (*AppendEntriesResponse) Decode

func (response *AppendEntriesResponse) Decode(src []byte) error

func (*AppendEntriesResponse) Encode

func (response *AppendEntriesResponse) Encode(dst []byte) []byte

func (AppendEntriesResponse) Raft

func (AppendEntriesResponse) Raft()

type Authentication

type Authentication struct {
	Type uint32

	// MD5Password fields
	Salt [4]byte
}

func (*Authentication) Backend

func (*Authentication) Backend()

func (*Authentication) Decode

func (dst *Authentication) Decode(src []byte) error

func (*Authentication) Encode

func (src *Authentication) Encode(dst []byte) []byte

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

func NewBackend

func NewBackend(r io.Reader, w io.Writer) (*Backend, error)

func (*Backend) Flush

func (b *Backend) Flush() error

func (*Backend) Receive

func (b *Backend) Receive() (FrontendMessage, error)

func (*Backend) ReceiveInitialMessage

func (b *Backend) ReceiveInitialMessage() (int, error)

func (*Backend) ReceiveStartupMessage

func (b *Backend) ReceiveStartupMessage() (*StartupMessage, error)

func (*Backend) Send

func (b *Backend) Send(msg BackendMessage) error

type BackendKeyData

type BackendKeyData struct {
	ProcessID uint32
	SecretKey uint32
}

func (*BackendKeyData) Backend

func (*BackendKeyData) Backend()

func (*BackendKeyData) Decode

func (dst *BackendKeyData) Decode(src []byte) error

func (*BackendKeyData) Encode

func (src *BackendKeyData) Encode(dst []byte) []byte

func (*BackendKeyData) MarshalJSON

func (src *BackendKeyData) MarshalJSON() ([]byte, error)

type BackendMessage

type BackendMessage interface {
	Message
	Backend() // no-op method to distinguish frontend from backend methods
}

type BackendMessages

type BackendMessages []BackendMessage

func (BackendMessages) Backend

func (BackendMessages) Backend()

Implement backend.

func (BackendMessages) Decode

func (msgs BackendMessages) Decode(data []byte) error

func (BackendMessages) Encode

func (msgs BackendMessages) Encode(dst []byte) []byte

type BigEndianBuf

type BigEndianBuf [8]byte

func (BigEndianBuf) Int16

func (b BigEndianBuf) Int16(n int16) []byte

func (BigEndianBuf) Int32

func (b BigEndianBuf) Int32(n int32) []byte

func (BigEndianBuf) Int64

func (b BigEndianBuf) Int64(n int64) []byte

func (BigEndianBuf) Uint16

func (b BigEndianBuf) Uint16(n uint16) []byte

func (BigEndianBuf) Uint32

func (b BigEndianBuf) Uint32(n uint32) []byte

type Bind

type Bind struct {
	DestinationPortal    string
	PreparedStatement    string
	ParameterFormatCodes []int16
	Parameters           [][]byte
	ResultFormatCodes    []pgwirebase.FormatCode
}

func (*Bind) Decode

func (dst *Bind) Decode(src []byte) error

func (*Bind) Encode

func (src *Bind) Encode(dst []byte) []byte

func (*Bind) Frontend

func (*Bind) Frontend()

func (*Bind) MarshalJSON

func (src *Bind) MarshalJSON() ([]byte, error)

type BindComplete

type BindComplete struct{}

func (*BindComplete) Backend

func (*BindComplete) Backend()

func (*BindComplete) Decode

func (dst *BindComplete) Decode(src []byte) error

func (*BindComplete) Encode

func (src *BindComplete) Encode(dst []byte) []byte

func (*BindComplete) MarshalJSON

func (src *BindComplete) MarshalJSON() ([]byte, error)

type Close

type Close struct {
	ObjectType byte // 'S' = prepared statement, 'P' = portal
	Name       string
}

func (*Close) Decode

func (dst *Close) Decode(src []byte) error

func (*Close) Encode

func (src *Close) Encode(dst []byte) []byte

func (*Close) Frontend

func (*Close) Frontend()

func (*Close) MarshalJSON

func (src *Close) MarshalJSON() ([]byte, error)

type CloseComplete

type CloseComplete struct{}

func (*CloseComplete) Backend

func (*CloseComplete) Backend()

func (*CloseComplete) Decode

func (dst *CloseComplete) Decode(src []byte) error

func (*CloseComplete) Encode

func (src *CloseComplete) Encode(dst []byte) []byte

func (*CloseComplete) MarshalJSON

func (src *CloseComplete) MarshalJSON() ([]byte, error)

type CommandComplete

type CommandComplete struct {
	CommandTag string
}

func (*CommandComplete) Backend

func (*CommandComplete) Backend()

func (*CommandComplete) Decode

func (dst *CommandComplete) Decode(src []byte) error

func (*CommandComplete) Encode

func (src *CommandComplete) Encode(dst []byte) []byte

func (*CommandComplete) MarshalJSON

func (src *CommandComplete) MarshalJSON() ([]byte, error)

type CommandRequest

type CommandRequest struct {
	CommandType     RpcCommandType
	Queries         []string
	KeyValueSets    []KeyValue
	KeyValueDeletes [][]byte
}

func (*CommandRequest) Decode

func (item *CommandRequest) Decode(src []byte) error

func (*CommandRequest) Encode

func (item *CommandRequest) Encode(dst []byte) []byte

func (CommandRequest) Frontend

func (CommandRequest) Frontend()

func (CommandRequest) RpcFrontend

func (CommandRequest) RpcFrontend()

type CopyBothResponse

type CopyBothResponse struct {
	OverallFormat     byte
	ColumnFormatCodes []uint16
}

func (*CopyBothResponse) Backend

func (*CopyBothResponse) Backend()

func (*CopyBothResponse) Decode

func (dst *CopyBothResponse) Decode(src []byte) error

func (*CopyBothResponse) Encode

func (src *CopyBothResponse) Encode(dst []byte) []byte

func (*CopyBothResponse) MarshalJSON

func (src *CopyBothResponse) MarshalJSON() ([]byte, error)

type CopyData

type CopyData struct {
	Data []byte
}

func (*CopyData) Backend

func (*CopyData) Backend()

func (*CopyData) Decode

func (dst *CopyData) Decode(src []byte) error

func (*CopyData) Encode

func (src *CopyData) Encode(dst []byte) []byte

func (*CopyData) Frontend

func (*CopyData) Frontend()

func (*CopyData) MarshalJSON

func (src *CopyData) MarshalJSON() ([]byte, error)

type CopyInResponse

type CopyInResponse struct {
	OverallFormat     byte
	ColumnFormatCodes []uint16
}

func (*CopyInResponse) Backend

func (*CopyInResponse) Backend()

func (*CopyInResponse) Decode

func (dst *CopyInResponse) Decode(src []byte) error

func (*CopyInResponse) Encode

func (src *CopyInResponse) Encode(dst []byte) []byte

func (*CopyInResponse) MarshalJSON

func (src *CopyInResponse) MarshalJSON() ([]byte, error)

type CopyOutResponse

type CopyOutResponse struct {
	OverallFormat     byte
	ColumnFormatCodes []uint16
}

func (*CopyOutResponse) Backend

func (*CopyOutResponse) Backend()

func (*CopyOutResponse) Decode

func (dst *CopyOutResponse) Decode(src []byte) error

func (*CopyOutResponse) Encode

func (src *CopyOutResponse) Encode(dst []byte) []byte

func (*CopyOutResponse) MarshalJSON

func (src *CopyOutResponse) MarshalJSON() ([]byte, error)

type DataRow

type DataRow struct {
	Values [][]byte
}

func (*DataRow) Backend

func (*DataRow) Backend()

func (*DataRow) Decode

func (dst *DataRow) Decode(src []byte) error

func (*DataRow) Encode

func (src *DataRow) Encode(dst []byte) []byte

func (*DataRow) MarshalJSON

func (src *DataRow) MarshalJSON() ([]byte, error)

type Describe

type Describe struct {
	ObjectType byte // 'S' = prepared statement, 'P' = portal
	Name       string
}

func (*Describe) Decode

func (dst *Describe) Decode(src []byte) error

func (*Describe) Encode

func (src *Describe) Encode(dst []byte) []byte

func (*Describe) Frontend

func (*Describe) Frontend()

func (*Describe) MarshalJSON

func (src *Describe) MarshalJSON() ([]byte, error)

type DiscoveryRequest

type DiscoveryRequest struct{}

func (*DiscoveryRequest) Decode

func (discovery *DiscoveryRequest) Decode(src []byte) error

func (*DiscoveryRequest) Encode

func (discovery *DiscoveryRequest) Encode(dst []byte) []byte

func (DiscoveryRequest) Frontend

func (DiscoveryRequest) Frontend()

func (DiscoveryRequest) RpcFrontend

func (DiscoveryRequest) RpcFrontend()

type DiscoveryResponse

type DiscoveryResponse struct {
	LeaderAddr string
}

func (DiscoveryResponse) Backend

func (DiscoveryResponse) Backend()

func (*DiscoveryResponse) Decode

func (discovery *DiscoveryResponse) Decode(src []byte) error

func (*DiscoveryResponse) Encode

func (discovery *DiscoveryResponse) Encode(dst []byte) []byte

func (DiscoveryResponse) RpcBackend

func (DiscoveryResponse) RpcBackend()

type EmptyQueryResponse

type EmptyQueryResponse struct{}

func (*EmptyQueryResponse) Backend

func (*EmptyQueryResponse) Backend()

func (*EmptyQueryResponse) Decode

func (dst *EmptyQueryResponse) Decode(src []byte) error

func (*EmptyQueryResponse) Encode

func (src *EmptyQueryResponse) Encode(dst []byte) []byte

func (*EmptyQueryResponse) MarshalJSON

func (src *EmptyQueryResponse) MarshalJSON() ([]byte, error)

type ErrorResponse

type ErrorResponse struct {
	Severity         string
	Code             string
	Message          string
	Detail           string
	Hint             string
	Position         int32
	InternalPosition int32
	InternalQuery    string
	Where            string
	SchemaName       string
	TableName        string
	ColumnName       string
	DataTypeName     string
	ConstraintName   string
	File             string
	Line             int32
	Routine          string

	UnknownFields map[byte]string
}

func (*ErrorResponse) Backend

func (*ErrorResponse) Backend()

func (*ErrorResponse) Decode

func (dst *ErrorResponse) Decode(src []byte) error

func (*ErrorResponse) Encode

func (src *ErrorResponse) Encode(dst []byte) []byte

func (ErrorResponse) Raft

func (ErrorResponse) Raft()

type Execute

type Execute struct {
	Portal  string
	MaxRows uint32
}

func (*Execute) Decode

func (dst *Execute) Decode(src []byte) error

func (*Execute) Encode

func (src *Execute) Encode(dst []byte) []byte

func (*Execute) Frontend

func (*Execute) Frontend()

func (*Execute) MarshalJSON

func (src *Execute) MarshalJSON() ([]byte, error)

type FieldDescription

type FieldDescription struct {
	Name                 string
	TableOID             uint32
	TableAttributeNumber uint16
	DataTypeOID          uint32
	DataTypeSize         int16
	TypeModifier         uint32
	Format               int16
}

type Flush

type Flush struct{}

func (*Flush) Decode

func (dst *Flush) Decode(src []byte) error

func (*Flush) Encode

func (src *Flush) Encode(dst []byte) []byte

func (*Flush) Frontend

func (*Flush) Frontend()

func (*Flush) MarshalJSON

func (src *Flush) MarshalJSON() ([]byte, error)

type Frontend

type Frontend struct {
	// contains filtered or unexported fields
}

func NewFrontend

func NewFrontend(r io.Reader, w io.Writer) (*Frontend, error)

func (*Frontend) Receive

func (b *Frontend) Receive() (BackendMessage, error)

func (*Frontend) Send

func (b *Frontend) Send(msg FrontendMessage) error

type FrontendMessage

type FrontendMessage interface {
	Message
	Frontend() // no-op method to distinguish frontend from backend methods
}

type FunctionCallResponse

type FunctionCallResponse struct {
	Result []byte
}

func (*FunctionCallResponse) Backend

func (*FunctionCallResponse) Backend()

func (*FunctionCallResponse) Decode

func (dst *FunctionCallResponse) Decode(src []byte) error

func (*FunctionCallResponse) Encode

func (src *FunctionCallResponse) Encode(dst []byte) []byte

func (*FunctionCallResponse) MarshalJSON

func (src *FunctionCallResponse) MarshalJSON() ([]byte, error)

type InitialMessage

type InitialMessage interface {
	Message
	Initial()
}

type InstallSnapshotRequest

type InstallSnapshotRequest struct {
	raft.InstallSnapshotRequest

	SnapshotData []byte
}

func (*InstallSnapshotRequest) Decode

func (installSnapshot *InstallSnapshotRequest) Decode(src []byte) error

func (*InstallSnapshotRequest) Encode

func (installSnapshot *InstallSnapshotRequest) Encode(dst []byte) []byte

func (InstallSnapshotRequest) Frontend

func (InstallSnapshotRequest) Frontend()

func (InstallSnapshotRequest) Raft

func (InstallSnapshotRequest) Raft()

func (*InstallSnapshotRequest) Reader

func (installSnapshot *InstallSnapshotRequest) Reader() io.Reader

type InstallSnapshotResponse

type InstallSnapshotResponse struct {
	raft.InstallSnapshotResponse
	Error error
}

func (InstallSnapshotResponse) Backend

func (InstallSnapshotResponse) Backend()

func (*InstallSnapshotResponse) Decode

func (response *InstallSnapshotResponse) Decode(src []byte) error

func (*InstallSnapshotResponse) Encode

func (response *InstallSnapshotResponse) Encode(dst []byte) []byte

func (InstallSnapshotResponse) Raft

func (InstallSnapshotResponse) Raft()

type JoinRequest

type JoinRequest struct {
	NodeID  string
	Address string
}

func (*JoinRequest) Decode

func (join *JoinRequest) Decode(src []byte) error

func (*JoinRequest) Encode

func (join *JoinRequest) Encode(dst []byte) []byte

func (JoinRequest) Frontend

func (JoinRequest) Frontend()

func (JoinRequest) RpcFrontend

func (JoinRequest) RpcFrontend()

type KeyValue

type KeyValue struct {
	Key   []byte
	Value []byte
}

type Message

type Message interface {
	// Decode is allowed and expected to retain a reference to data after
	// returning (unlike encoding.BinaryUnmarshaler).
	Decode(data []byte) error

	// Encode appends itself to dst and returns the new buffer.
	Encode(dst []byte) []byte
}

Message is the interface implemented by an object that can decode and encode a particular PostgreSQL message.

type NoData

type NoData struct{}

func (*NoData) Backend

func (*NoData) Backend()

func (*NoData) Decode

func (dst *NoData) Decode(src []byte) error

func (*NoData) Encode

func (src *NoData) Encode(dst []byte) []byte

func (*NoData) MarshalJSON

func (src *NoData) MarshalJSON() ([]byte, error)

type NoticeResponse

type NoticeResponse ErrorResponse

func (*NoticeResponse) Backend

func (*NoticeResponse) Backend()

func (*NoticeResponse) Decode

func (dst *NoticeResponse) Decode(src []byte) error

func (*NoticeResponse) Encode

func (src *NoticeResponse) Encode(dst []byte) []byte

type NotificationResponse

type NotificationResponse struct {
	PID     uint32
	Channel string
	Payload string
}

func (*NotificationResponse) Backend

func (*NotificationResponse) Backend()

func (*NotificationResponse) Decode

func (dst *NotificationResponse) Decode(src []byte) error

func (*NotificationResponse) Encode

func (src *NotificationResponse) Encode(dst []byte) []byte

func (*NotificationResponse) MarshalJSON

func (src *NotificationResponse) MarshalJSON() ([]byte, error)

type ParameterDescription

type ParameterDescription struct {
	ParameterOIDs []uint32
}

func (*ParameterDescription) Backend

func (*ParameterDescription) Backend()

func (*ParameterDescription) Decode

func (dst *ParameterDescription) Decode(src []byte) error

func (*ParameterDescription) Encode

func (src *ParameterDescription) Encode(dst []byte) []byte

func (*ParameterDescription) MarshalJSON

func (src *ParameterDescription) MarshalJSON() ([]byte, error)

type ParameterStatus

type ParameterStatus struct {
	Name  string
	Value string
}

func (*ParameterStatus) Backend

func (*ParameterStatus) Backend()

func (*ParameterStatus) Decode

func (dst *ParameterStatus) Decode(src []byte) error

func (*ParameterStatus) Encode

func (src *ParameterStatus) Encode(dst []byte) []byte

func (*ParameterStatus) MarshalJSON

func (ps *ParameterStatus) MarshalJSON() ([]byte, error)

type Parse

type Parse struct {
	Name          string
	Query         string
	ParameterOIDs []uint32
}

func (*Parse) Decode

func (dst *Parse) Decode(src []byte) error

func (*Parse) Encode

func (src *Parse) Encode(dst []byte) []byte

func (*Parse) Frontend

func (*Parse) Frontend()

func (*Parse) MarshalJSON

func (src *Parse) MarshalJSON() ([]byte, error)

type ParseComplete

type ParseComplete struct{}

func (*ParseComplete) Backend

func (*ParseComplete) Backend()

func (*ParseComplete) Decode

func (dst *ParseComplete) Decode(src []byte) error

func (*ParseComplete) Encode

func (src *ParseComplete) Encode(dst []byte) []byte

func (*ParseComplete) MarshalJSON

func (src *ParseComplete) MarshalJSON() ([]byte, error)

type PasswordMessage

type PasswordMessage struct {
	Password string
}

func (*PasswordMessage) Decode

func (dst *PasswordMessage) Decode(src []byte) error

func (*PasswordMessage) Encode

func (src *PasswordMessage) Encode(dst []byte) []byte

func (*PasswordMessage) Frontend

func (*PasswordMessage) Frontend()

func (*PasswordMessage) MarshalJSON

func (src *PasswordMessage) MarshalJSON() ([]byte, error)

type Query

type Query struct {
	String string
}

func (*Query) Decode

func (dst *Query) Decode(src []byte) error

func (*Query) Encode

func (src *Query) Encode(dst []byte) []byte

func (*Query) Frontend

func (*Query) Frontend()

func (*Query) MarshalJSON

func (src *Query) MarshalJSON() ([]byte, error)

type RaftMessage

type RaftMessage interface {
	Message
	Raft() // no-op method to distinguish raft frontend from backend methods
}

type RaftStartupMessage

type RaftStartupMessage struct {
}

func (*RaftStartupMessage) Decode

func (dst *RaftStartupMessage) Decode(src []byte) error

func (*RaftStartupMessage) Encode

func (src *RaftStartupMessage) Encode(dst []byte) []byte

func (RaftStartupMessage) Frontend

func (RaftStartupMessage) Frontend()

func (RaftStartupMessage) Initial

func (RaftStartupMessage) Initial()

func (RaftStartupMessage) RaftFrontend

func (RaftStartupMessage) RaftFrontend()

type RaftWire

type RaftWire struct {
	// contains filtered or unexported fields
}

func NewRaftWire

func NewRaftWire(r io.Reader, w io.Writer) (*RaftWire, error)

func (*RaftWire) Receive

func (b *RaftWire) Receive() (RaftMessage, error)

func (*RaftWire) Send

func (b *RaftWire) Send(msg RaftMessage) error

type ReadyForQuery

type ReadyForQuery struct {
	TxStatus byte
}

func (*ReadyForQuery) Backend

func (*ReadyForQuery) Backend()

func (*ReadyForQuery) Decode

func (dst *ReadyForQuery) Decode(src []byte) error

func (*ReadyForQuery) Encode

func (src *ReadyForQuery) Encode(dst []byte) []byte

func (*ReadyForQuery) MarshalJSON

func (src *ReadyForQuery) MarshalJSON() ([]byte, error)

type RequestVoteRequest

type RequestVoteRequest struct {
	raft.RequestVoteRequest
}

func (*RequestVoteRequest) Decode

func (requestVote *RequestVoteRequest) Decode(src []byte) error

func (*RequestVoteRequest) Encode

func (requestVote *RequestVoteRequest) Encode(dst []byte) []byte

func (RequestVoteRequest) Frontend

func (RequestVoteRequest) Frontend()

func (RequestVoteRequest) Raft

func (RequestVoteRequest) Raft()

type RequestVoteResponse

type RequestVoteResponse struct {
	raft.RequestVoteResponse
	Error error
}

func (RequestVoteResponse) Backend

func (RequestVoteResponse) Backend()

func (*RequestVoteResponse) Decode

func (response *RequestVoteResponse) Decode(src []byte) error

func (*RequestVoteResponse) Encode

func (response *RequestVoteResponse) Encode(dst []byte) []byte

func (RequestVoteResponse) Raft

func (RequestVoteResponse) Raft()

type RowDescription

type RowDescription struct {
	Fields []FieldDescription
}

func (*RowDescription) Backend

func (*RowDescription) Backend()

func (*RowDescription) Decode

func (dst *RowDescription) Decode(src []byte) error

func (*RowDescription) Encode

func (src *RowDescription) Encode(dst []byte) []byte

func (*RowDescription) MarshalJSON

func (src *RowDescription) MarshalJSON() ([]byte, error)

type RpcBackend

type RpcBackend struct {
	// contains filtered or unexported fields
}

func NewRpcBackend

func NewRpcBackend(r io.Reader, w io.Writer) (*RpcBackend, error)

func (*RpcBackend) Flush

func (b *RpcBackend) Flush() error

func (*RpcBackend) Receive

func (b *RpcBackend) Receive() (RpcFrontendMessage, error)

func (*RpcBackend) Send

func (b *RpcBackend) Send(msg BackendMessage) error

type RpcCommandType

type RpcCommandType int
const (
	RpcCommandType_Execute RpcCommandType = iota
	RpcCommandType_Query
	RpcCommandType_MetadataSet
	RpcCommandType_MetadataDelete
	RpcCommandType_Connect
	RpcCommandType_Disconnect
	RpcCommandType_KeyValueSet
	RpcCommandType_KeyValueDelete
)

type RpcFrontendMessage

type RpcFrontendMessage interface {
	Message
	Frontend()    // no-op method to distinguish frontend from backend methods
	RpcFrontend() // no-op method to distinguish raft frontend from backend methods
}

type RpcStartupMessage

type RpcStartupMessage struct {
}

func (*RpcStartupMessage) Decode

func (dst *RpcStartupMessage) Decode(src []byte) error

func (*RpcStartupMessage) Encode

func (src *RpcStartupMessage) Encode(dst []byte) []byte

func (*RpcStartupMessage) Frontend

func (*RpcStartupMessage) Frontend()

func (RpcStartupMessage) Initial

func (RpcStartupMessage) Initial()

type Sequence

type Sequence struct {
	CurrentValue       uint64
	LastPartitionIndex uint64
	MaxPartitionIndex  uint64
	Partitions         uint64
}

func (*Sequence) Decode

func (item *Sequence) Decode(src []byte) error

func (*Sequence) EncodeBody

func (item *Sequence) EncodeBody() []byte

type SequenceChunkResponse

type SequenceChunkResponse struct {
	Start  uint64
	End    uint64
	Offset uint64
	Count  uint64
}

func (SequenceChunkResponse) Backend

func (SequenceChunkResponse) Backend()

func (*SequenceChunkResponse) Decode

func (item *SequenceChunkResponse) Decode(src []byte) error

func (*SequenceChunkResponse) Encode

func (item *SequenceChunkResponse) Encode(dst []byte) []byte

func (*SequenceChunkResponse) EncodeBody

func (item *SequenceChunkResponse) EncodeBody() []byte

type SequenceRequest

type SequenceRequest struct {
	SequenceName string
}

func (*SequenceRequest) Decode

func (item *SequenceRequest) Decode(src []byte) error

func (*SequenceRequest) Encode

func (item *SequenceRequest) Encode(dst []byte) []byte

func (*SequenceRequest) EncodeBody

func (item *SequenceRequest) EncodeBody() []byte

func (SequenceRequest) Frontend

func (SequenceRequest) Frontend()

func (SequenceRequest) RpcFrontend

func (SequenceRequest) RpcFrontend()

type StartupMessage

type StartupMessage struct {
	ProtocolVersion uint32
	Parameters      map[string]string
}

func (*StartupMessage) Decode

func (dst *StartupMessage) Decode(src []byte) error

func (*StartupMessage) Encode

func (src *StartupMessage) Encode(dst []byte) []byte

func (*StartupMessage) Frontend

func (*StartupMessage) Frontend()

func (StartupMessage) Initial

func (StartupMessage) Initial()

func (*StartupMessage) MarshalJSON

func (src *StartupMessage) MarshalJSON() ([]byte, error)

type Sync

type Sync struct{}

func (*Sync) Decode

func (dst *Sync) Decode(src []byte) error

func (*Sync) Encode

func (src *Sync) Encode(dst []byte) []byte

func (*Sync) Frontend

func (*Sync) Frontend()

func (*Sync) MarshalJSON

func (src *Sync) MarshalJSON() ([]byte, error)

type Terminate

type Terminate struct{}

func (*Terminate) Decode

func (dst *Terminate) Decode(src []byte) error

func (*Terminate) Encode

func (src *Terminate) Encode(dst []byte) []byte

func (*Terminate) Frontend

func (*Terminate) Frontend()

func (*Terminate) MarshalJSON

func (src *Terminate) MarshalJSON() ([]byte, error)

func (*Terminate) RpcFrontend

func (*Terminate) RpcFrontend()

type TransactionStatus

type TransactionStatus byte
const (
	// TransactionStatus_Idle means the session is outside of a transaction.
	TransactionStatus_Idle TransactionStatus = 'I'
	// TransactionStatus_In means the session is inside a transaction.
	TransactionStatus_In TransactionStatus = 'T'
	// TransactionStatus_InFailed means the session is inside a transaction, but the
	// transaction is in the Aborted state.
	TransactionStatus_InFailed TransactionStatus = 'E'
)

Jump to

Keyboard shortcuts

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