pgio

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MPL-2.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package pgio is a low-level toolkit building messages in the PostgreSQL wire protocol.

pgio provides functions for appending integers to a []byte while doing byte order conversion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendInt16

func AppendInt16(buf []byte, n int16) []byte

func AppendInt32

func AppendInt32(buf []byte, n int32) []byte

func AppendInt64

func AppendInt64(buf []byte, n int64) []byte

func AppendUint16

func AppendUint16(buf []byte, n uint16) []byte

func AppendUint32

func AppendUint32(buf []byte, n uint32) []byte

func AppendUint64

func AppendUint64(buf []byte, n uint64) []byte

func SetInt32

func SetInt32(buf []byte, n int32)

func WriteMsg

func WriteMsg(conn io.Writer, msg PgMsg) error

Types

type PgMsg

type PgMsg interface {
	Encode(dst []byte) []byte
	Decode(src []byte) error
}

type RawMsg

type RawMsg struct {
	Typ byte
	Buf []byte
}

func ReadMsg

func ReadMsg(conn io.Reader) (*RawMsg, error)

func (*RawMsg) Decode

func (r *RawMsg) Decode(src []byte) error

func (*RawMsg) Encode

func (r *RawMsg) Encode(dst []byte) []byte

Jump to

Keyboard shortcuts

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