package binary

import "github.com/ClickHouse/clickhouse-go/lib/binary"

Index

Constants

const (
	NONE CompressionMethodByte = 0x02
	LZ4                        = 0x82
	ZSTD                       = 0x90
)
const (
	// ChecksumSize is 128bits for cityhash102 checksum
	ChecksumSize = 16
	// CompressHeader magic + compressed_size + uncompressed_size
	CompressHeaderSize = 1 + 4 + 4

	// HeaderSize
	HeaderSize = ChecksumSize + CompressHeaderSize
	// BlockMaxSize 1MB
	BlockMaxSize = 1 << 20
)

Functions

func NewCompressReader

func NewCompressReader(r io.Reader) *compressReader

NewCompressReader wrap the io.Reader

func NewCompressWriter

func NewCompressWriter(w io.Writer) *compressWriter

NewCompressWriter wrap the io.Writer

func Str2Bytes

func Str2Bytes(str string) []byte

Types

type CompressionMethodByte

type CompressionMethodByte byte

type Decoder

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

func NewDecoder

func NewDecoder(input io.Reader) *Decoder

func NewDecoderWithCompress

func NewDecoderWithCompress(input io.Reader) *Decoder

func (*Decoder) Bool

func (decoder *Decoder) Bool() (bool, error)

func (*Decoder) Decimal128

func (decoder *Decoder) Decimal128() ([]byte, error)

func (*Decoder) Fixed

func (decoder *Decoder) Fixed(ln int) ([]byte, error)

func (*Decoder) Float32

func (decoder *Decoder) Float32() (float32, error)

func (*Decoder) Float64

func (decoder *Decoder) Float64() (float64, error)

func (*Decoder) Get

func (decoder *Decoder) Get() io.Reader

func (*Decoder) Int16

func (decoder *Decoder) Int16() (int16, error)

func (*Decoder) Int32

func (decoder *Decoder) Int32() (int32, error)

func (*Decoder) Int64

func (decoder *Decoder) Int64() (int64, error)

func (*Decoder) Int8

func (decoder *Decoder) Int8() (int8, error)

func (*Decoder) ReadByte

func (decoder *Decoder) ReadByte() (byte, error)

func (*Decoder) SelectCompress

func (decoder *Decoder) SelectCompress(compress bool)

func (*Decoder) String

func (decoder *Decoder) String() (string, error)

func (*Decoder) UInt16

func (decoder *Decoder) UInt16() (uint16, error)

func (*Decoder) UInt32

func (decoder *Decoder) UInt32() (uint32, error)

func (*Decoder) UInt64

func (decoder *Decoder) UInt64() (uint64, error)

func (*Decoder) UInt8

func (decoder *Decoder) UInt8() (uint8, error)

func (*Decoder) Uvarint

func (decoder *Decoder) Uvarint() (uint64, error)

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func NewEncoderWithCompress

func NewEncoderWithCompress(w io.Writer) *Encoder

func (*Encoder) Bool

func (enc *Encoder) Bool(v bool) error

func (*Encoder) Decimal128

func (enc *Encoder) Decimal128(bytes []byte) error

func (*Encoder) Float32

func (enc *Encoder) Float32(v float32) error

func (*Encoder) Float64

func (enc *Encoder) Float64(v float64) error

func (*Encoder) Flush

func (enc *Encoder) Flush() error

func (*Encoder) Get

func (enc *Encoder) Get() io.Writer

func (*Encoder) Int16

func (enc *Encoder) Int16(v int16) error

func (*Encoder) Int32

func (enc *Encoder) Int32(v int32) error

func (*Encoder) Int64

func (enc *Encoder) Int64(v int64) error

func (*Encoder) Int8

func (enc *Encoder) Int8(v int8) error

func (*Encoder) RawString

func (enc *Encoder) RawString(str []byte) error

func (*Encoder) SelectCompress

func (enc *Encoder) SelectCompress(compress bool)

func (*Encoder) String

func (enc *Encoder) String(v string) error

func (*Encoder) UInt16

func (enc *Encoder) UInt16(v uint16) error

func (*Encoder) UInt32

func (enc *Encoder) UInt32(v uint32) error

func (*Encoder) UInt64

func (enc *Encoder) UInt64(v uint64) error

func (*Encoder) UInt8

func (enc *Encoder) UInt8(v uint8) error

func (*Encoder) Uvarint

func (enc *Encoder) Uvarint(v uint64) error

func (*Encoder) Write

func (enc *Encoder) Write(b []byte) (int, error)

type FixedReader

type FixedReader interface {
	Fixed(ln int) ([]byte, error)
}

type WriteFlusher

type WriteFlusher interface {
	Flush() error
}

Source Files

compress_reader.go compress_settings.go compress_writer.go decoder.go encoder.go

Version
v1.5.4 (latest)
Published
Feb 8, 2022
Platform
js/wasm
Imports
8 packages
Last checked
2 hours ago

Tools for package owners.