Documentation ¶
Overview ¶
Package ch is used to interact with ClickHouse servers.
Index ¶
- Constants
- Variables
- type Service
- func (s *Service) GetAggregatedSignals(ctx context.Context, aggArgs *model.AggregatedSignalArgs) ([]*model.AggSignal, error)
- func (s *Service) GetAvailableSignals(ctx context.Context, tokenId uint32, filter *model.SignalFilter) ([]string, error)
- func (s *Service) GetLatestSignals(ctx context.Context, latestArgs *model.LatestSignalsArgs) ([]*vss.Signal, error)
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",
"ruptela": "0xF26421509Efe92861a587482100c6d728aBf1CD0",
}
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 ¶
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) GetAvailableSignals ¶ added in v0.0.21
func (s *Service) GetAvailableSignals(ctx context.Context, tokenId uint32, filter *model.SignalFilter) ([]string, error)
GetAvailableSignals returns a slice of available signals from the ClickHouse database. if no signals are available, a nil slice is returned.
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.
Click to show internal directories.
Click to hide internal directories.