Documentation
¶
Index ¶
- type Client
- type Options
- func (o *Options) BatchSize() uint
- func (o *Options) FlushInterval() uint
- func (o *Options) SetBatchSize(batchSize uint) *Options
- func (o *Options) SetDebugMode(isDebug bool) *Options
- func (o *Options) SetFlushInterval(flushIntervalMs uint) *Options
- func (o *Options) SetLogger(logger cx.Logger) *Options
- func (o *Options) SetQueueEngine(queue retry.Queueable) *Options
- func (o *Options) SetRetryIsEnabled(enabled bool) *Options
- type Writer
- type WriterBlocking
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// Options returns the options associated with client
Options() *Options
// WriteBatch method of sending data to Clickhouse is used implicitly in a non - blocking record,
// and explicitly in a blocking record
WriteBatch(context.Context, cx.View, *cx.Batch) error
// Writer returns the asynchronous, non-blocking, Writer client.
// Ensures using a single Writer instance for each table pair.
Writer(cx.View, cx.Buffer) Writer
// WriterBlocking returns the synchronous, blocking, WriterBlocking client.
// Ensures using a single WriterBlocking instance for each table pair.
WriterBlocking(cx.View) WriterBlocking
// RetryClient Get retry client
RetryClient() retry.Retryable
// Close ensures all ongoing asynchronous write clients finish.
Close()
}
func NewClientWithOptions ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options holds write configuration properties
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions returns Options object with default values
func (*Options) FlushInterval ¶
FlushInterval returns flush interval in ms
func (*Options) SetBatchSize ¶
SetBatchSize sets number of rows sent in single request
func (*Options) SetDebugMode ¶
func (*Options) SetFlushInterval ¶
SetFlushInterval sets flush interval in ms in which is buffer flushed if it has not been already written
func (*Options) SetRetryIsEnabled ¶
type Writer ¶
type Writer interface {
// WriteRow writes asynchronously line protocol record into bucket.
WriteRow(vector cx.Vectorable)
// Errors returns a channel for reading errors which occurs during async writes.
Errors() <-chan error
// Close writer
Close()
}
Writer is client interface with non-blocking methods for writing rows asynchronously in batches into an Clickhouse server. Writer can be used concurrently. When using multiple goroutines for writing, use a single WriteAPI instance in all goroutines.
type WriterBlocking ¶
type WriterBlocking interface {
// WriteRow writes row(s) into bucket.
// WriteRow writes without implicit batching. Batch is created from given number of records
// Non-blocking alternative is available in the Writer interface
WriteRow(ctx context.Context, row ...cx.Vectorable) error
}
func NewWriterBlocking ¶
func NewWriterBlocking(client Client, view cx.View) WriterBlocking
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
cmd/redis
command
|
|
|
cmd/redis_sql
command
|
|
|
cmd/simple
command
|
|
|
cmd/simple_2
command
|
|
|
cmd/simple_sql
command
|
|
|
src
|
|
Click to show internal directories.
Click to hide internal directories.