Documentation ¶
Index ¶
- Variables
- func GetApproximateLoc(lat, long float64) *h3.LatLng
- type CHService
- type Repository
- func (r *Repository) GetAvailableSignals(ctx context.Context, tokenID uint32, filter *model.SignalFilter) ([]string, error)
- func (r *Repository) GetDeviceActivity(ctx context.Context, vehicleTokenID int, adMfrName string) (*model.DeviceActivity, error)
- func (r *Repository) GetSignal(ctx context.Context, aggArgs *model.AggregatedSignalArgs) ([]*model.SignalAggregations, error)
- func (r *Repository) GetSignalLatest(ctx context.Context, latestArgs *model.LatestSignalsArgs) (*model.SignalCollection, error)
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
var ManufacturerSourceTranslations = map[string]string{
"AutoPi": "autopi",
"Hashdog": "macaron",
"Ruptela": "ruptela",
}
TODO(elffjs): Get rid of this when we have device addresses in CH.
Functions ¶
func GetApproximateLoc ¶ added in v0.0.30
func GetApproximateLoc(lat, long float64) *h3.LatLng
GetApproximateLoc returns the approximate location for the given latitude and longitude.
Types ¶
type CHService ¶ added in v0.0.13
type CHService interface { GetAggregatedSignals(ctx context.Context, aggArgs *model.AggregatedSignalArgs) ([]*model.AggSignal, error) GetLatestSignals(ctx context.Context, latestArgs *model.LatestSignalsArgs) ([]*vss.Signal, error) GetAvailableSignals(ctx context.Context, tokenID uint32, filter *model.SignalFilter) ([]string, error) }
CHService is the interface for the ClickHouse service.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is the base repository for all repositories.
func NewRepository ¶
func NewRepository(logger *zerolog.Logger, chService CHService, lastSeenBin int64) (*Repository, error)
NewRepository creates a new base repository. clientCAs is optional and can be nil.
func (*Repository) GetAvailableSignals ¶ added in v0.0.21
func (r *Repository) GetAvailableSignals(ctx context.Context, tokenID uint32, filter *model.SignalFilter) ([]string, error)
GetAvailableSignals returns the available signals for the given tokenID and filter. If no signals are found, a nil slice is returned.
func (*Repository) GetDeviceActivity ¶ added in v0.0.23
func (r *Repository) GetDeviceActivity(ctx context.Context, vehicleTokenID int, adMfrName string) (*model.DeviceActivity, error)
GetDeviceActivity returns device status activity level.
func (*Repository) GetSignal ¶ added in v0.0.8
func (r *Repository) GetSignal(ctx context.Context, aggArgs *model.AggregatedSignalArgs) ([]*model.SignalAggregations, error)
GetSignal returns the aggregated signals for the given tokenID, interval, from, to and filter.
func (*Repository) GetSignalLatest ¶ added in v0.0.8
func (r *Repository) GetSignalLatest(ctx context.Context, latestArgs *model.LatestSignalsArgs) (*model.SignalCollection, error)
GetSignalLatest returns the latest signals for the given tokenID and filter.
type ValidationError ¶ added in v0.0.8
type ValidationError string
ValidationError is an error type for validation errors.
func (ValidationError) Error ¶ added in v0.0.8
func (v ValidationError) Error() string