services

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type AutoPiAPIService added in v0.4.0

type AutoPiAPIService interface {
	UpdateState(deviceID string, state string) error
}

func NewAutoPiAPIService added in v0.4.0

func NewAutoPiAPIService(settings *config.Settings, dbs func() *db.ReaderWriter) AutoPiAPIService

type DeviceAPIService

type DeviceAPIService interface {
	ListUserDevicesForUser(ctx context.Context, userID string) (*pb.ListUserDevicesForUserResponse, error)
	GetUserDevice(ctx context.Context, userDeviceID string) (*pb.UserDevice, error)
	UserDeviceBelongsToUserID(ctx context.Context, userID, userDeviceID string) (bool, error)
	GetUserDeviceByTokenID(ctx context.Context, tokenID int64) (*pb.UserDevice, error)
	UpdateStatus(ctx context.Context, userDeviceID string, integrationID string, status string) (*pb.UserDevice, error)
}

func NewDeviceAPIService

func NewDeviceAPIService(devicesConn *grpc.ClientConn) DeviceAPIService

NewDeviceAPIService API wrapper to call device-data-api to get the userDevices associated with a userId over grpc

type DeviceDefinitionsAPIService added in v0.2.3

type DeviceDefinitionsAPIService interface {
	GetDeviceDefinitionByID(ctx context.Context, id string) (*pb.GetDeviceDefinitionItemResponse, error)
	GetIntegrations(ctx context.Context) ([]*pb.Integration, error)
	GetDeviceDefinitionsByIDs(ctx context.Context, ids []string) ([]*pb.GetDeviceDefinitionItemResponse, error)
}

func NewDeviceDefinitionsAPIService added in v0.2.3

func NewDeviceDefinitionsAPIService(ddConn *grpc.ClientConn) DeviceDefinitionsAPIService

type DeviceStatusEvent added in v0.4.0

type DeviceStatusEvent struct {
	ID          string          `json:"id"`
	Source      string          `json:"source"`
	Specversion string          `json:"specversion"`
	Subject     string          `json:"subject"`
	Time        time.Time       `json:"time"`
	Type        string          `json:"type"`
	Data        json.RawMessage `json:"data"`
}

type DeviceStatusIngestService added in v0.4.0

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

func NewDeviceStatusIngestService added in v0.4.0

func NewDeviceStatusIngestService(db func() *db.ReaderWriter, log *zerolog.Logger, eventService EventService, ddSvc DeviceDefinitionsAPIService, autoPiSvc AutoPiAPIService, deviceSvc DeviceAPIService) *DeviceStatusIngestService

func (*DeviceStatusIngestService) ProcessDeviceStatusMessages added in v0.4.0

func (i *DeviceStatusIngestService) ProcessDeviceStatusMessages(ctx goka.Context, msg interface{})

ProcessDeviceStatusMessages works on channel stream of messages from watermill kafka consumer

type EmailService added in v0.1.6

type EmailService struct {
	ClientConn *grpc.ClientConn
	// contains filtered or unexported fields
}

func NewEmailService added in v0.1.6

func NewEmailService(settings *config.Settings, log *zerolog.Logger) *EmailService

func (*EmailService) SendEmail added in v0.1.6

func (es *EmailService) SendEmail(user string, downloadLink []string) error

type Event added in v0.4.0

type Event struct {
	Type    string
	Subject string
	Source  string
	Data    interface{}
}

type EventService added in v0.4.0

type EventService interface {
	Emit(event *Event) error
}

func NewEventService added in v0.4.0

func NewEventService(logger *zerolog.Logger, settings *config.Settings, producer sarama.SyncProducer) EventService

type NATSService added in v0.2.3

type NATSService struct {
	JetStream        nats.JetStreamContext
	JetStreamName    string
	JetStreamSubject string
	AckTimeout       time.Duration
	DurableConsumer  string
	// contains filtered or unexported fields
}

func NewNATSService added in v0.2.3

func NewNATSService(settings *config.Settings, log *zerolog.Logger) (*NATSService, error)

type OdometerEvent added in v0.4.0

type OdometerEvent struct {
	Timestamp time.Time           `json:"timestamp"`
	UserID    string              `json:"userId"`
	Device    odometerEventDevice `json:"device"`
	Odometer  float64             `json:"odometer"`
}

type QueryStorageService added in v0.2.3

type QueryStorageService struct {
	AWSBucket               string
	ElasticIndex            string
	NATSDataDownloadSubject string
	MaxFileSize             int
	// contains filtered or unexported fields
}

func NewQueryStorageService added in v0.2.3

func NewQueryStorageService(es *elasticsearch.TypedClient, settings *config.Settings, log *zerolog.Logger) (*QueryStorageService, error)

func (*QueryStorageService) StreamDataToS3 added in v0.2.3

func (uds *QueryStorageService) StreamDataToS3(ctx context.Context, userDeviceID string) ([]string, error)

type UserData added in v0.1.6

type UserData struct {
	UserDeviceID     string                   `json:"userDeviceId"`
	RequestTimestamp string                   `json:"requestTimestamp"`
	Data             []map[string]interface{} `json:"data,omitempty"`
}

type UserDeviceEvent added in v0.4.0

type UserDeviceEvent struct {
	Timestamp time.Time             `json:"timestamp"`
	UserID    string                `json:"userId"`
	Device    UserDeviceEventDevice `json:"device"`
}

type UserDeviceEventDevice added in v0.4.0

type UserDeviceEventDevice struct {
	ID                 string `json:"id"`
	DeviceDefinitionID string `json:"device_definition_id"`
	Make               string `json:"make"`
	Model              string `json:"model"`
	Year               int    `json:"year"`
	VIN                string `json:"vin"`
}

type UserDeviceEventIntegration added in v0.4.0

type UserDeviceEventIntegration struct {
	ID     string `json:"id"`
	Type   string `json:"type"`
	Style  string `json:"style"`
	Vendor string `json:"vendor"`
}

type UserDeviceFull

type UserDeviceFull struct {
	ID             string  `json:"id"`
	VIN            *string `json:"vin"`
	VINConfirmed   bool    `json:"vinConfirmed"`
	Name           *string `json:"name"`
	CustomImageURL *string `json:"customImageUrl"`
	CountryCode    *string `json:"countryCode"`
}

UserDeviceFull represents object user's see on frontend for listing of their devices

type UserDeviceIntegrationEvent added in v0.4.0

type UserDeviceIntegrationEvent struct {
	Timestamp   time.Time                  `json:"timestamp"`
	UserID      string                     `json:"userId"`
	Device      UserDeviceEventDevice      `json:"device"`
	Integration UserDeviceEventIntegration `json:"integration"`
}

type VehicleSignalsEventBatchService added in v0.4.13

type VehicleSignalsEventBatchService interface {
	GenerateVehicleDataTracking(ctx context.Context) error
}

func NewVehicleSignalsEventBatchService added in v0.4.13

func NewVehicleSignalsEventBatchService(db func() *db.ReaderWriter,
	log *zerolog.Logger, deviceDefSvc DeviceDefinitionsAPIService, deviceSvc DeviceAPIService) VehicleSignalsEventBatchService

Directories

Path Synopsis
Package mock_services is a generated GoMock package.
Package mock_services is a generated GoMock package.

Jump to

Keyboard shortcuts

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