chproto

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: BSD-2-Clause Imports: 10 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 (
	ServerHello               = 0
	ServerData                = 1
	ServerException           = 2
	ServerProgress            = 3
	ServerPong                = 4
	ServerEndOfStream         = 5
	ServerProfileInfo         = 6
	ServerTotals              = 7
	ServerExtremes            = 8
	ServerTablesStatus        = 9
	ServerLog                 = 10
	ServerTableColumns        = 11
	ServerPartUUIDs           = 12
	ServerReadTaskRequest     = 13
	ServerProfileEvents       = 14
	ServerTreeReadTaskRequest = 15
)
View Source
const (
	QueryNo        = 0
	QueryInitial   = 1
	QuerySecondary = 2
)
View Source
const (
	DBMS_MIN_REVISION_WITH_CLIENT_INFO                        = 54032
	DBMS_MIN_REVISION_WITH_SERVER_TIMEZONE                    = 54058
	DBMS_MIN_REVISION_WITH_QUOTA_KEY_IN_CLIENT_INFO           = 54060
	DBMS_MIN_REVISION_WITH_SERVER_DISPLAY_NAME                = 54372
	DBMS_MIN_REVISION_WITH_VERSION_PATCH                      = 54401
	DBMS_MIN_REVISION_WITH_CLIENT_WRITE_INFO                  = 54420
	DBMS_MIN_REVISION_WITH_SETTINGS_SERIALIZED_AS_STRINGS     = 54429
	DBMS_MIN_REVISION_WITH_INTERSERVER_SECRET                 = 54441
	DBMS_MIN_REVISION_WITH_OPENTELEMETRY                      = 54442
	DBMS_MIN_PROTOCOL_VERSION_WITH_DISTRIBUTED_DEPTH          = 54448
	DBMS_MIN_PROTOCOL_VERSION_WITH_INITIAL_QUERY_START_TIME   = 54449
	DBMS_MIN_PROTOCOL_VERSION_WITH_INCREMENTAL_PROFILE_EVENTS = 54451
	DBMS_MIN_REVISION_WITH_PARALLEL_REPLICAS                  = 54453
	DBMS_TCP_PROTOCOL_VERSION                                 = DBMS_MIN_REVISION_WITH_PARALLEL_REPLICAS
)

see https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Protocol.h

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) UInt16 added in v0.2.6

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

func (*Reader) UInt32 added in v0.2.6

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

func (*Reader) UInt64 added in v0.2.6

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

func (*Reader) UInt8 added in v0.2.6

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

func (*Reader) UUID

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

func (*Reader) Uvarint

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

func (*Reader) WithCompression

func (r *Reader) WithCompression(enabled bool, 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) UInt16 added in v0.2.6

func (w *Writer) UInt16(num uint16)

func (*Writer) UInt32 added in v0.2.6

func (w *Writer) UInt32(num uint32)

func (*Writer) UInt64 added in v0.2.6

func (w *Writer) UInt64(num uint64)

func (*Writer) UInt8 added in v0.2.6

func (w *Writer) UInt8(num uint8)

func (*Writer) UUID

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

func (*Writer) Uvarint

func (w *Writer) Uvarint(num uint64)

func (*Writer) WithCompression

func (w *Writer) WithCompression(enabled bool, fn func() error)

func (*Writer) Write

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

func (*Writer) WriteByte added in v0.2.8

func (w *Writer) WriteByte(c byte)

Jump to

Keyboard shortcuts

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