cx

package
v3.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultInsertDurationTimeout added in v3.0.7

func GetDefaultInsertDurationTimeout() time.Duration

GetDefaultInsertDurationTimeout to get away from this decision in the near future

func IsResendAvailable added in v3.0.7

func IsResendAvailable(err error) bool

IsResendAvailable checks whether it is possible to resend undelivered messages to the Clickhouse database based on the error received from Clickhouse

Types

type Batch

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

Batch holds information for sending rows batch

func NewBatch

func NewBatch(rows []Vector) *Batch

NewBatch creates new batch

func (*Batch) Rows

func (b *Batch) Rows() []Vector

type Buffer

type Buffer interface {
	Write(Vector)
	Read() []Vector
	Len() int
	Flush()
}

Buffer it is the interface for creating a data buffer (temporary storage). It is enough to implement this interface so that you can use your own temporary storage

type Clickhouse

type Clickhouse interface {
	Insert(context.Context, View, []Vector) (uint64, error)
	Close() error
}

Clickhouse base interface, which is inherited by the top-level Client API and further by all its child Writer-s

type Logger

type Logger interface {
	Log(message interface{})
	Logf(format string, v ...interface{})
}

func NewDefaultLogger

func NewDefaultLogger() Logger

type Vector

type Vector []interface{}

Vector basic structure for writing to is nothing more than a slice of undefined interfaces

func (Vector) Encode

func (v Vector) Encode() ([]byte, error)

Encode turns the Vector type into an array of bytes. Encode is used for data serialization and storage in remote buffers, such as redis.Buffer

type VectorDecoded

type VectorDecoded string

VectorDecoded a type that is a string, but contains a binary data format

func (VectorDecoded) Decode

func (d VectorDecoded) Decode() (Vector, error)

Decode method is required to reverse deserialize an array of bytes in a Vector type

type Vectorable

type Vectorable interface {
	Row() Vector
}

Vectorable interface is an assistant in the correct formation of the order of fields in the data before sending it to Clickhouse

type View

type View struct {
	Name    string
	Columns []string
}

View basic representation is some reflection of the entity (table) in Clickhouse database

func NewView

func NewView(name string, columns []string) View

NewView return View

Jump to

Keyboard shortcuts

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