chproto

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: BSD-2-Clause Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ClientHello        = 0
	ClientQuery        = 1
	ClientData         = 2
	ClientCancel       = 3
	ClientPing         = 4
	ClientTablesStatus = 5
	ClientKeepAlive    = 6
)
View Source
const (
	CompressionDisabled = 0
	CompressionEnabled  = 1
)
View Source
const (
	ServerHello        = 0
	ServerData         = 1
	ServerException    = 2
	ServerProgress     = 3
	ServerPong         = 4
	ServerEndOfStream  = 5
	ServerProfileInfo  = 6
	ServerTotals       = 7
	ServerExtremes     = 8
	ServerTablesStatus = 9
	ServerLog          = 10
	ServerTableColumns = 11
)
View Source
const (
	QueryNo        = 0
	QueryInitial   = 1
	QuerySecondary = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

func NewReader

func NewReader(r io.Reader) *Reader

func (*Reader) Bool

func (r *Reader) Bool() (bool, error)

func (*Reader) Buffered

func (r *Reader) Buffered() int

func (*Reader) Bytes

func (r *Reader) Bytes() ([]byte, error)

func (*Reader) Date

func (r *Reader) Date() (time.Time, error)

func (*Reader) DateTime

func (r *Reader) DateTime() (time.Time, error)

func (*Reader) Float32

func (r *Reader) Float32() (float32, error)

func (*Reader) Float64

func (r *Reader) Float64() (float64, error)

func (*Reader) Int16

func (r *Reader) Int16() (int16, error)

func (*Reader) Int32

func (r *Reader) Int32() (int32, error)

func (*Reader) Int64

func (r *Reader) Int64() (int64, error)

func (*Reader) Int8

func (r *Reader) Int8() (int8, error)

func (*Reader) Read

func (r *Reader) Read(buf []byte) (int, error)

func (*Reader) String

func (r *Reader) String() (string, error)

func (*Reader) UUID

func (r *Reader) UUID(b []byte) error

func (*Reader) Uint16

func (r *Reader) Uint16() (uint16, error)

func (*Reader) Uint32

func (r *Reader) Uint32() (uint32, error)

func (*Reader) Uint64

func (r *Reader) Uint64() (uint64, error)

func (*Reader) Uint8

func (r *Reader) Uint8() (uint8, error)

func (*Reader) Uvarint

func (r *Reader) Uvarint() (uint64, error)

func (*Reader) WithCompression

func (r *Reader) WithCompression(fn func() error) error

type ServerInfo

type ServerInfo struct {
	Name         string
	MinorVersion uint64
	MajorVersion uint64
	Revision     uint64
}

func (*ServerInfo) ReadFrom

func (srv *ServerInfo) ReadFrom(rd *Reader) (err error)

type Writer

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

func NewWriter

func NewWriter(w io.Writer) *Writer

func (*Writer) Bool

func (w *Writer) Bool(flag bool)

func (*Writer) Bytes

func (w *Writer) Bytes(b []byte)

func (*Writer) Date

func (w *Writer) Date(tm time.Time)

func (*Writer) DateTime

func (w *Writer) DateTime(tm time.Time)

func (*Writer) Float32

func (w *Writer) Float32(num float32)

func (*Writer) Float64

func (w *Writer) Float64(num float64)

func (*Writer) Flush

func (w *Writer) Flush() (err error)

func (*Writer) Int16

func (w *Writer) Int16(num int16)

func (*Writer) Int32

func (w *Writer) Int32(num int32)

func (*Writer) Int64

func (w *Writer) Int64(num int64)

func (*Writer) Int8

func (w *Writer) Int8(num int8)

func (*Writer) String

func (w *Writer) String(s string)

func (*Writer) UUID

func (w *Writer) UUID(b []byte)

func (*Writer) Uint16

func (w *Writer) Uint16(num uint16)

func (*Writer) Uint32

func (w *Writer) Uint32(num uint32)

func (*Writer) Uint64

func (w *Writer) Uint64(num uint64)

func (*Writer) Uint8

func (w *Writer) Uint8(num uint8)

func (*Writer) Uvarint

func (w *Writer) Uvarint(num uint64)

func (*Writer) WithCompression

func (w *Writer) WithCompression(fn func() error)

func (*Writer) Write

func (w *Writer) Write(b []byte)

Jump to

Keyboard shortcuts

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