message

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAuthentication

func ReadAuthentication(raw []byte) interface{}

Types

type AuthenticationCleartextPassword

type AuthenticationCleartextPassword struct {
	ID uint32
}

func (*AuthenticationCleartextPassword) Reader

type AuthenticationGSS

type AuthenticationGSS struct {
	ID uint32
}

func (*AuthenticationGSS) Reader

func (m *AuthenticationGSS) Reader() io.Reader

type AuthenticationGSSContinue

type AuthenticationGSSContinue struct {
	ID   uint32
	Data []byte
}

func (*AuthenticationGSSContinue) Reader

func (m *AuthenticationGSSContinue) Reader() io.Reader

type AuthenticationKerberosV5

type AuthenticationKerberosV5 struct {
	ID uint32
}

func (*AuthenticationKerberosV5) Reader

func (m *AuthenticationKerberosV5) Reader() io.Reader

type AuthenticationMD5Password

type AuthenticationMD5Password struct {
	ID   uint32
	Salt []byte
}

func (*AuthenticationMD5Password) Reader

func (m *AuthenticationMD5Password) Reader() io.Reader

type AuthenticationOk

type AuthenticationOk struct {
	ID uint32
}

func (*AuthenticationOk) Reader

func (m *AuthenticationOk) Reader() io.Reader

type AuthenticationSASL

type AuthenticationSASL struct {
	ID         uint32
	Mechanisms []string
}

func (*AuthenticationSASL) Reader

func (m *AuthenticationSASL) Reader() io.Reader

type AuthenticationSASLContinue

type AuthenticationSASLContinue struct {
	ID   uint32
	Data []byte
}

func (*AuthenticationSASLContinue) Reader

func (m *AuthenticationSASLContinue) Reader() io.Reader

type AuthenticationSASLFinal

type AuthenticationSASLFinal struct {
	ID   uint32
	Data []byte
}

func (*AuthenticationSASLFinal) Reader

func (m *AuthenticationSASLFinal) Reader() io.Reader

type AuthenticationSCMCredential

type AuthenticationSCMCredential struct {
	ID uint32
}

func (*AuthenticationSCMCredential) Reader

type AuthenticationSSPI

type AuthenticationSSPI struct {
	ID uint32
}

func (*AuthenticationSSPI) Reader

func (m *AuthenticationSSPI) Reader() io.Reader

type BackendKeyData

type BackendKeyData struct {
	ProcessID uint32
	SecretKey uint32
}

func ReadBackendKeyData

func ReadBackendKeyData(raw []byte) *BackendKeyData

func (*BackendKeyData) Reader

func (m *BackendKeyData) Reader() io.Reader

type Bind

type Bind struct {
	PortalName              string
	PreparedStatementName   string
	ParameterFormatCodes    []uint16
	ParameterValues         []Value
	ResultColumnFormatCodes []uint16
}

func ReadBind

func ReadBind(raw []byte) *Bind

func (*Bind) Reader

func (m *Bind) Reader() io.Reader

type BindComplete

type BindComplete struct{}

func ReadBindComplete

func ReadBindComplete(raw []byte) *BindComplete

func (*BindComplete) Reader

func (m *BindComplete) Reader() io.Reader

type CancelRequest

type CancelRequest struct {
	RequestCode uint32
	ProcessID   uint32
	SecretKey   uint32
}

func (*CancelRequest) Reader

func (m *CancelRequest) Reader() io.Reader

type Close

type Close struct {
	TargetType byte
	TargetName string
}

func ReadClose

func ReadClose(raw []byte) *Close

func (*Close) Reader

func (m *Close) Reader() io.Reader

type CloseComplete

type CloseComplete struct{}

func ReadCloseComplete

func ReadCloseComplete(raw []byte) *CloseComplete

func (*CloseComplete) Reader

func (m *CloseComplete) Reader() io.Reader

type CommandComplete

type CommandComplete struct {
	CommandTag string
}

func ReadCommandComplete

func ReadCommandComplete(raw []byte) *CommandComplete

func (*CommandComplete) Reader

func (m *CommandComplete) Reader() io.Reader

type CopyBothResponse

type CopyBothResponse struct {
	OverallFormat     uint8
	ColumnFormatCodes []uint16
}

func ReadCopyBothResponse

func ReadCopyBothResponse(raw []byte) *CopyBothResponse

func (*CopyBothResponse) Reader

func (m *CopyBothResponse) Reader() io.Reader

type CopyData

type CopyData struct {
	Data []byte
}

func ReadCopyData

func ReadCopyData(raw []byte) *CopyData

func (*CopyData) Reader

func (m *CopyData) Reader() io.Reader

type CopyDone

type CopyDone struct{}

func ReadCopyDone

func ReadCopyDone(raw []byte) *CopyDone

func (*CopyDone) Reader

func (m *CopyDone) Reader() io.Reader

type CopyFail

type CopyFail struct {
	ErrorMessage string
}

func ReadCopyFail

func ReadCopyFail(raw []byte) *CopyFail

func (*CopyFail) Reader

func (m *CopyFail) Reader() io.Reader

type CopyInResponse

type CopyInResponse struct {
	OverallFormat     uint8
	ColumnFormatCodes []uint16
}

func ReadCopyInResponse

func ReadCopyInResponse(raw []byte) *CopyInResponse

func (*CopyInResponse) Reader

func (m *CopyInResponse) Reader() io.Reader

type CopyOutResponse

type CopyOutResponse struct {
	OverallFormat     uint8
	ColumnFormatCodes []uint16
}

func ReadCopyOutResponse

func ReadCopyOutResponse(raw []byte) *CopyOutResponse

func (*CopyOutResponse) Reader

func (m *CopyOutResponse) Reader() io.Reader

type DataRow

type DataRow struct {
	ColumnValues []Value
}

func ReadDataRow

func ReadDataRow(raw []byte) *DataRow

func (*DataRow) Reader

func (m *DataRow) Reader() io.Reader

type Describe

type Describe struct {
	TargetType byte
	TargetName string
}

func ReadDescribe

func ReadDescribe(raw []byte) *Describe

func (*Describe) Reader

func (m *Describe) Reader() io.Reader

type EmptyQueryResponse

type EmptyQueryResponse struct{}

func ReadEmptyQueryResponse

func ReadEmptyQueryResponse(raw []byte) *EmptyQueryResponse

func (*EmptyQueryResponse) Reader

func (m *EmptyQueryResponse) Reader() io.Reader

type ErrorField

type ErrorField struct {
	Type  byte
	Value string
}

type ErrorResponse

type ErrorResponse struct {
	Fields []ErrorField
}

func ReadErrorResponse

func ReadErrorResponse(raw []byte) *ErrorResponse

func (*ErrorResponse) Reader

func (m *ErrorResponse) Reader() io.Reader

type Execute

type Execute struct {
	PortalName          string
	MaximumNumberOfRows uint32
}

func ReadExecute

func ReadExecute(raw []byte) *Execute

func (*Execute) Reader

func (m *Execute) Reader() io.Reader

type Field

type Field struct {
	Name            string
	TableID         uint32
	AttributeNumber uint16
	DataType        uint32
	DataSize        uint16
	ModifierType    uint32
	FormatCode      uint16
}

type Flush

type Flush struct{}

func ReadFlush

func ReadFlush(raw []byte) *Flush

func (*Flush) Reader

func (m *Flush) Reader() io.Reader

type FunctionCall

type FunctionCall struct {
	ID                  uint32
	ArgumentFormatCodes []uint16
	Arguments           []Value
	ResultFormatCode    uint16
}

func ReadFunctionCall

func ReadFunctionCall(raw []byte) *FunctionCall

func (*FunctionCall) Reader

func (m *FunctionCall) Reader() io.Reader

type FunctionCallResponse

type FunctionCallResponse struct {
	Value Value
}

func ReadFunctionCallResponse

func ReadFunctionCallResponse(raw []byte) *FunctionCallResponse

func (*FunctionCallResponse) Reader

func (m *FunctionCallResponse) Reader() io.Reader

type GSSResponse

type GSSResponse struct {
	Data []byte
}

func ReadGSSResponse

func ReadGSSResponse(raw []byte) *GSSResponse

func (*GSSResponse) Reader

func (m *GSSResponse) Reader() io.Reader

type Message

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

func NewBase

func NewBase(len int) *Message

func NewBaseFromBytes

func NewBaseFromBytes(b []byte) *Message

func (*Message) Length

func (b *Message) Length() int

func (*Message) ReadByte

func (b *Message) ReadByte() (r byte)

func (*Message) ReadByteN

func (b *Message) ReadByteN(n uint32) (r []byte)

func (*Message) ReadString

func (b *Message) ReadString() (r string)

func (*Message) ReadUint16

func (b *Message) ReadUint16() (r uint16)

func (*Message) ReadUint32

func (b *Message) ReadUint32() (r uint32)

func (*Message) ReadUint8

func (b *Message) ReadUint8() (r uint8)

func (*Message) Reader

func (b *Message) Reader() io.Reader

func (*Message) SetType

func (b *Message) SetType(t byte) *Message

func (*Message) WriteByte

func (b *Message) WriteByte(i byte)

func (*Message) WriteByteN

func (b *Message) WriteByteN(i []byte)

func (*Message) WriteString

func (b *Message) WriteString(i string)

func (*Message) WriteUint16

func (b *Message) WriteUint16(i uint16)

func (*Message) WriteUint32

func (b *Message) WriteUint32(i uint32)

func (*Message) WriteUint8

func (b *Message) WriteUint8(i uint8)

func (*Message) WriteValue

func (b *Message) WriteValue(i Value)

type NegotiateProtocolVersion

type NegotiateProtocolVersion struct {
	NewestMinorProtocolVersion uint32
	Options                    []string
}

func ReadNegotiateProtocolVersion

func ReadNegotiateProtocolVersion(raw []byte) *NegotiateProtocolVersion

func (*NegotiateProtocolVersion) Reader

func (m *NegotiateProtocolVersion) Reader() io.Reader

type NoData

type NoData struct{}

func ReadNoData

func ReadNoData(raw []byte) *NoData

func (*NoData) Reader

func (m *NoData) Reader() io.Reader

type NoticeField

type NoticeField struct {
	Type  byte
	Value string
}

type NoticeResponse

type NoticeResponse struct {
	Fields []NoticeField
}

func ReadNoticeResponse

func ReadNoticeResponse(raw []byte) *NoticeResponse

func (*NoticeResponse) Reader

func (m *NoticeResponse) Reader() io.Reader

type NotificationResponse

type NotificationResponse struct {
	ProcessID   uint32
	ChannelName string
	Payload     string
}

func ReadNotificationResponse

func ReadNotificationResponse(raw []byte) *NotificationResponse

func (*NotificationResponse) Reader

func (m *NotificationResponse) Reader() io.Reader

type ParameterDescription

type ParameterDescription struct {
	ParameterIDs []uint32
}

func ReadParameterDescription

func ReadParameterDescription(raw []byte) *ParameterDescription

func (*ParameterDescription) Reader

func (m *ParameterDescription) Reader() io.Reader

type ParameterStatus

type ParameterStatus struct {
	Name  string
	Value string
}

func ReadParameterStatus

func ReadParameterStatus(raw []byte) *ParameterStatus

func (*ParameterStatus) Reader

func (m *ParameterStatus) Reader() io.Reader

type Parse

type Parse struct {
	PreparedStatementName string
	QueryString           string
	ParameterIDs          []uint32
}

func ReadParse

func ReadParse(raw []byte) *Parse

func (*Parse) Reader

func (m *Parse) Reader() io.Reader

type ParseComplete

type ParseComplete struct{}

func ReadParseComplete

func ReadParseComplete(raw []byte) *ParseComplete

func (*ParseComplete) Reader

func (m *ParseComplete) Reader() io.Reader

type PasswordMessage

type PasswordMessage struct {
	Password string
}

func ReadPasswordMessage

func ReadPasswordMessage(raw []byte) *PasswordMessage

func (*PasswordMessage) Reader

func (m *PasswordMessage) Reader() io.Reader

type PortalSuspended

type PortalSuspended struct{}

func ReadPortalSuspended

func ReadPortalSuspended(raw []byte) *PortalSuspended

func (*PortalSuspended) Reader

func (m *PortalSuspended) Reader() io.Reader

type Query

type Query struct {
	QueryString string
}

func ReadQuery

func ReadQuery(raw []byte) *Query

func (*Query) Reader

func (m *Query) Reader() io.Reader

type Reader

type Reader interface {
	Reader() io.Reader
}

func ReadStartupMessage

func ReadStartupMessage(raw []byte) (Reader, error)

type ReadyForQuery

type ReadyForQuery struct {
	Status byte
}

func ReadReadyForQuery

func ReadReadyForQuery(raw []byte) *ReadyForQuery

func (*ReadyForQuery) Reader

func (m *ReadyForQuery) Reader() io.Reader

type RowDescription

type RowDescription struct {
	Fields []Field
}

func ReadRowDescription

func ReadRowDescription(raw []byte) *RowDescription

func (*RowDescription) Reader

func (m *RowDescription) Reader() io.Reader

type SASLInitialResponse

type SASLInitialResponse struct {
	Mechanism string
	Response  Value
}

func ReadSASLInitialResponse

func ReadSASLInitialResponse(raw []byte) *SASLInitialResponse

func (*SASLInitialResponse) Reader

func (m *SASLInitialResponse) Reader() io.Reader

type SASLResponse

type SASLResponse struct {
	Data []byte
}

func ReadSASLResponse

func ReadSASLResponse(raw []byte) *SASLResponse

func (*SASLResponse) Reader

func (m *SASLResponse) Reader() io.Reader

type SSLRequest

type SSLRequest struct {
	RequestCode uint32
}

func (*SSLRequest) Reader

func (m *SSLRequest) Reader() io.Reader

type StartupMessage

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

func (*StartupMessage) Reader

func (m *StartupMessage) Reader() io.Reader

type Sync

type Sync struct{}

func ReadSync

func ReadSync(raw []byte) *Sync

func (*Sync) Reader

func (m *Sync) Reader() io.Reader

type Terminate

type Terminate struct{}

func ReadTerminate

func ReadTerminate(raw []byte) *Terminate

func (*Terminate) Reader

func (m *Terminate) Reader() io.Reader

type Value

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

func NewNullValue

func NewNullValue() Value

func NewValue

func NewValue(data []byte) Value

func ReadValue

func ReadValue(b *Message) Value

func (*Value) DataBytes

func (v *Value) DataBytes() []byte

func (*Value) DataLength

func (v *Value) DataLength() uint32

func (*Value) Length

func (v *Value) Length() int

Jump to

Keyboard shortcuts

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