cx

package
v3.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultConnMaxLifetime added in v3.0.7

func GetDefaultConnMaxLifetime() time.Duration

func GetDefaultInsertDurationTimeout added in v3.0.7

func GetDefaultInsertDurationTimeout() time.Duration

func GetDefaultMaxIdleConns added in v3.0.7

func GetDefaultMaxIdleConns() int

func GetDefaultMaxOpenConns added in v3.0.7

func GetDefaultMaxOpenConns() int

func IsResendAvailable added in v3.0.7

func IsResendAvailable(err error) bool

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
}

type Logger

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

func NewDefaultLogger

func NewDefaultLogger() Logger

type Vector

type Vector []interface{}

func (Vector) Encode

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

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

type VectorDecoded

type VectorDecoded string

func (VectorDecoded) Decode

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

Decode This 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
}

func NewView

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

Jump to

Keyboard shortcuts

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