clickhouse

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client can be used to write data to a ClickHouse instance. The client can be created via the NewClient function.

func NewClient

func NewClient(address, username, password, database, dialTimeout, connMaxLifetime string, maxIdleConns, maxOpenConns int, asyncInsert, waitForAsyncInsert bool) (*Client, error)

NewClient returns a new client for ClickHouse. The client can then be used to write data to ClickHouse via the "Write" method.

func (*Client) BufferAdd added in v0.10.0

func (c *Client) BufferAdd(row Row)

BufferAdd adds a new row to the Clickhouse buffer. This doesn't write the added row. To write the rows in the buffer the `write` method must be called.

func (*Client) BufferLen added in v0.10.0

func (c *Client) BufferLen() int

BufferLen returns the number of items in the buffer.

func (*Client) BufferWrite added in v0.10.0

func (c *Client) BufferWrite() error

BufferWrite writes a list of rows from the buffer to the configured ClickHouse instance.

func (*Client) Close added in v0.9.0

func (c *Client) Close() error

Close can be used to close the underlying sql client for ClickHouse.

type Row

type Row struct {
	Timestamp    time.Time
	Cluster      string
	Namespace    string
	App          string
	Pod          string
	Container    string
	Host         string
	FieldsString map[string]string
	FieldsNumber map[string]float64
	Log          string
}

Row is the structure of a single row in ClickHouse.

Jump to

Keyboard shortcuts

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