frame

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthTypeOk              uint32 = 0
	AuthTypePwd             uint32 = 3
	AuthTypeMd5             uint32 = 5
	AuthTypeSASL            uint32 = 10
	AuthTypeSASLContinue    uint32 = 11
	AuthSASLSCRAMSHA256     string = "SCRAM-SHA-256"
	AuthSASLSCRAMSHA256PLUS string = "SCRAM-SHA-256-PLUS"
)
View Source
const (
	CopyFormatText   uint8 = 0
	CopyFormatBinary uint8 = 1
)
View Source
const (
	TransactionStatusNoReady             = 'N'
	TransactionStatusIdle                = 'I'
	TransactionStatusIdleInTransaction   = 'T'
	TransactionStatusInFailedTransaction = 'E'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	*Data
}

func (*AuthRequest) GetMd5Salt

func (ar *AuthRequest) GetMd5Salt() []byte

func (*AuthRequest) GetSASLAuthData added in v1.1.1

func (ar *AuthRequest) GetSASLAuthData() []byte

func (*AuthRequest) GetSASLAuthMechanism added in v1.1.1

func (ar *AuthRequest) GetSASLAuthMechanism() string

func (*AuthRequest) GetType

func (ar *AuthRequest) GetType() uint32

type AuthResponse

type AuthResponse struct {
	*Data
}

func NewAuthResponse

func NewAuthResponse() *AuthResponse

func (*AuthResponse) Md5Pwd

func (ar *AuthResponse) Md5Pwd(user, pwd, salt string)

func (*AuthResponse) Password

func (ar *AuthResponse) Password(str string)

type AuthSASLInitialResponse added in v1.1.1

type AuthSASLInitialResponse struct {
	*Data
}

func NewAuthSASLInitialResponse added in v1.1.1

func NewAuthSASLInitialResponse() *AuthSASLInitialResponse

func (*AuthSASLInitialResponse) AuthResponse added in v1.1.1

func (ar *AuthSASLInitialResponse) AuthResponse(str string)

func (*AuthSASLInitialResponse) Mechanism added in v1.1.1

func (ar *AuthSASLInitialResponse) Mechanism(str string)

type AuthSASLResponse added in v1.1.1

type AuthSASLResponse struct {
	*Data
}

func NewAuthSASLResponse added in v1.1.1

func NewAuthSASLResponse() *AuthSASLResponse

func (*AuthSASLResponse) AuthResponse added in v1.1.1

func (ar *AuthSASLResponse) AuthResponse(raw []byte)

type BackendKeyData

type BackendKeyData struct {
	*Data
	Pid uint32
	Key uint32
}

func (*BackendKeyData) Decode

func (bkd *BackendKeyData) Decode()

type BindCompletion

type BindCompletion struct {
	*Data
}

type CloseComplete

type CloseComplete struct {
	*Data
}

type Column

type Column struct {
	Name         string
	TableOid     uint32
	Index        uint16
	TypeOid      uint32
	Length       uint16
	TypeModifier uint32
	Format       uint16
}

type CommandCompletion

type CommandCompletion struct {
	*Data
}

func (*CommandCompletion) Affected

func (cc *CommandCompletion) Affected() (n int)

type CopyCompletion added in v1.1.1

type CopyCompletion struct {
	*Data
}

type CopyData added in v1.1.1

type CopyData struct {
	*Data
}

type CopyFail added in v1.1.1

type CopyFail struct {
	*Data
}

type CopyFormat added in v1.1.1

type CopyFormat uint8

type CopyInResponse added in v1.1.1

type CopyInResponse struct {
	*Data
	Format       CopyFormat
	ColumnLength uint16
}

func (*CopyInResponse) Decode added in v1.1.1

func (cir *CopyInResponse) Decode()

type CopyOutResponse added in v1.1.1

type CopyOutResponse struct {
	*Data
	Format        CopyFormat
	ColumnLength  uint16
	ColumnFormats []CopyFormat
}

func (*CopyOutResponse) Decode added in v1.1.1

func (cor *CopyOutResponse) Decode()

type Data

type Data struct {
	Name byte
	// contains filtered or unexported fields
}

func NewBind

func NewBind(stat string, args []driver.Value) *Data

func NewCancelRequest

func NewCancelRequest(pid, key uint32) *Data

func NewCloseStat

func NewCloseStat(stat string) *Data

func NewDescribe

func NewDescribe(stat string) *Data

func NewExecute

func NewExecute() *Data

func NewFlush

func NewFlush() *Data

func NewParse

func NewParse(sid, query string) *Data

func NewSSLRequest

func NewSSLRequest() *Data

func NewSimpleQuery

func NewSimpleQuery(stat string) *Data

func NewSync

func NewSync() *Data

func NewTermination

func NewTermination() *Data

func (*Data) Length

func (f *Data) Length() uint32

func (*Data) Payload

func (f *Data) Payload() []byte

func (*Data) Type

func (f *Data) Type() byte

func (*Data) WriteUint8

func (f *Data) WriteUint8(uint uint8)

type DataRow

type DataRow struct {
	*Data
	Count   uint16
	DataArr [][]byte
}

func (*DataRow) Decode

func (dr *DataRow) Decode()

type Decoder

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

func NewDecoder

func NewDecoder(c net.Conn) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode() (out Frame, err error)

type EmptyQueryResponse

type EmptyQueryResponse struct {
	*Data
}

type Encoder

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

func NewEncoder

func NewEncoder(c net.Conn) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(f *Data) (err error)

func (*Encoder) Fire

func (e *Encoder) Fire(f *Data) (err error)

func (*Encoder) Flush

func (e *Encoder) Flush() (err error)

type Error

type Error struct {
	*Data
	Error errorStruct
}

func (*Error) Decode

func (e *Error) Decode()

type Frame

type Frame interface {
	Type() byte
	Length() uint32
	Payload() []byte
}

type NoData

type NoData struct {
	*Data
}

type NoticeResponse

type NoticeResponse struct {
	Error
}

type Notification

type Notification struct {
	*Data
	Pid       uint32
	Condition string
	Text      string
}

func (*Notification) Decode

func (n *Notification) Decode()

type ParameterDescription

type ParameterDescription struct {
	*Data
	Count    uint16
	TypeOIDs []uint32
}

func (*ParameterDescription) Decode

func (pd *ParameterDescription) Decode()

type ParameterStatus

type ParameterStatus struct {
	*Data
	Name  string
	Value string
}

func (*ParameterStatus) Decode

func (ps *ParameterStatus) Decode()

type ParseCompletion

type ParseCompletion struct {
	*Data
}

type ReadyForQuery

type ReadyForQuery struct {
	*Data
}

type RowDescription

type RowDescription struct {
	*Data
	Count   uint16
	Columns []Column
}

func (*RowDescription) Decode

func (rd *RowDescription) Decode()

type SSLRequest

type SSLRequest Data

type Startup

type Startup struct {
	*Data
}

func NewStartup

func NewStartup() *Startup

func (*Startup) AddParam

func (sf *Startup) AddParam(name, value string)

type TransactionStatus

type TransactionStatus byte

Jump to

Keyboard shortcuts

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