clickhouse

package
v1.0.0-beta.212 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger              *slog.Logger
	ClickHouse          clickhouse.Conn
	Database            string
	EventsTableName     string
	AsyncInsert         bool
	AsyncInsertWait     bool
	InsertQuerySettings map[string]string
	ProgressManager     progressmanager.Service
}

func (Config) Validate

func (c Config) Validate() error

type Connector

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

Connector implements `ingest.Connector“ and `namespace.Handler interfaces.

func New

func New(ctx context.Context, config Config) (*Connector, error)

func (*Connector) BatchInsert

func (c *Connector) BatchInsert(ctx context.Context, rawEvents []streaming.RawEvent) error

func (*Connector) CountEvents

func (c *Connector) CountEvents(ctx context.Context, namespace string, params streaming.CountEventsParams) ([]streaming.CountEventRow, error)

func (*Connector) CreateMeter

func (c *Connector) CreateMeter(ctx context.Context, namespace string, meter meterpkg.Meter) error

func (*Connector) CreateNamespace

func (c *Connector) CreateNamespace(ctx context.Context, namespace string) error

func (*Connector) DeleteMeter

func (c *Connector) DeleteMeter(ctx context.Context, namespace string, meter meterpkg.Meter) error

func (*Connector) DeleteNamespace

func (c *Connector) DeleteNamespace(ctx context.Context, namespace string) error

func (*Connector) ListEvents

func (c *Connector) ListEvents(ctx context.Context, namespace string, params meterevent.ListEventsParams) ([]streaming.RawEvent, error)

func (*Connector) ListEventsV2

func (c *Connector) ListEventsV2(ctx context.Context, params meterevent.ListEventsV2Params) ([]streaming.RawEvent, error)

func (*Connector) ListMeterSubjects

func (c *Connector) ListMeterSubjects(ctx context.Context, namespace string, meter meterpkg.Meter, params streaming.ListMeterSubjectsParams) ([]string, error)

func (*Connector) QueryMeter

func (c *Connector) QueryMeter(ctx context.Context, namespace string, meter meterpkg.Meter, params streaming.QueryParams) ([]meterpkg.MeterQueryRow, error)

func (*Connector) UpdateMeter

func (c *Connector) UpdateMeter(ctx context.Context, namespace string, meter meterpkg.Meter) error

func (*Connector) ValidateJSONPath

func (c *Connector) ValidateJSONPath(ctx context.Context, jsonPath string) (bool, error)

ValidateJSONPath checks if the given JSON path is valid by executing a simple query with it.

type InsertEventsQuery

type InsertEventsQuery struct {
	Database        string
	EventsTableName string
	Events          []streaming.RawEvent
	QuerySettings   map[string]string
}

Insert Events Query

func (InsertEventsQuery) ToSQL

func (q InsertEventsQuery) ToSQL() (string, []interface{})

Jump to

Keyboard shortcuts

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