ch

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package ch is used to interact with ClickHouse servers.

Index

Constants

View Source
const (
	// IntervalGroup is the column alias for the interval group.
	IntervalGroup = "group_timestamp"
	AggCol        = "agg"
)
View Source
const (

	// TimeoutErrCode is the error code returned by ClickHouse when a query is interrupted due to exceeding the max_execution_time.
	TimeoutErrCode = int32(159)
)

Variables

View Source
var SourceTranslations = map[string]string{
	"macaron":  "dimo/integration/2ULfuC8U9dOqRshZBAi0lMM1Rrx",
	"tesla":    "dimo/integration/26A5Dk3vvvQutjSyF0Jka2DP5lg",
	"autopi":   "dimo/integration/27qftVRWQYpVDcO5DltO5Ojbjxk",
	"smartcar": "dimo/integration/22N2xaPOq2WW2gAHBHd0Ikn4Zob",
}

TODO: remove this map when we move to storing the device address

Functions

This section is empty.

Types

type Service

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

Service is a ClickHouse service that interacts with the ClickHouse database.

func NewService

func NewService(settings config.Settings) (*Service, error)

NewService creates a new ClickHouse service.

func (*Service) GetAggregatedSignals

func (s *Service) GetAggregatedSignals(ctx context.Context, aggArgs *model.AggregatedSignalArgs) ([]*model.AggSignal, error)

GetAggregatedSignals returns a slice of aggregated signals based on the provided arguments from the ClickHouse database. The signals are sorted by timestamp in ascending order. The timestamp on each signal is for the start of the interval.

func (*Service) GetLatestSignals

func (s *Service) GetLatestSignals(ctx context.Context, latestArgs *model.LatestSignalsArgs) ([]*vss.Signal, error)

GetLatestSignals returns the latest signals based on the provided arguments from the ClickHouse database.

Jump to

Keyboard shortcuts

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