clickhouse_connector

package
v1.0.0-beta.172 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EventsTableName = "events"
)

Functions

func GetEventsTableName

func GetEventsTableName(database string) string

func GetMeterViewName

func GetMeterViewName(database string, namespace string, meterSlug string) string

Types

type ClickhouseConnector

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

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

func NewClickhouseConnector

func NewClickhouseConnector(config ClickhouseConnectorConfig) (*ClickhouseConnector, error)

func (*ClickhouseConnector) CountEvents

func (*ClickhouseConnector) CreateMeter

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

func (*ClickhouseConnector) CreateNamespace

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

func (*ClickhouseConnector) DeleteMeter

func (c *ClickhouseConnector) DeleteMeter(ctx context.Context, namespace string, meterSlug string) error

func (*ClickhouseConnector) DeleteNamespace

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

func (*ClickhouseConnector) ListEvents

func (c *ClickhouseConnector) ListEvents(ctx context.Context, namespace string, params streaming.ListEventsParams) ([]api.IngestedEvent, error)

func (*ClickhouseConnector) ListMeterSubjects

func (c *ClickhouseConnector) ListMeterSubjects(ctx context.Context, namespace string, meterSlug string, from *time.Time, to *time.Time) ([]string, error)

func (*ClickhouseConnector) QueryMeter

func (c *ClickhouseConnector) QueryMeter(ctx context.Context, namespace string, meterSlug string, params *streaming.QueryParams) ([]models.MeterQueryRow, error)

type ClickhouseConnectorConfig

type ClickhouseConnectorConfig struct {
	Logger               *slog.Logger
	ClickHouse           clickhouse.Conn
	Database             string
	Meters               meter.Repository
	CreateOrReplaceMeter bool
	PopulateMeter        bool
}

type MeterView

type MeterView struct {
	Slug        string
	Aggregation models.MeterAggregation
	GroupBy     []string
}

Jump to

Keyboard shortcuts

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