repositories

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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