queries

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceType

type DeviceType struct {
	// Type is eg. Vehicle, E-bike, roomba
	Type      string   `json:"type"`
	Make      string   `json:"make"`
	Model     string   `json:"model"`
	Year      int      `json:"year"`
	SubModels []string `json:"subModels"`
}

DeviceType whether it is a vehicle or other type and basic information

type GetAllDeviceDefinitionQuery

type GetAllDeviceDefinitionQuery struct {
}

func (*GetAllDeviceDefinitionQuery) Key

type GetAllDeviceDefinitionQueryHandler

type GetAllDeviceDefinitionQueryHandler struct {
	Repository     repositories.DeviceDefinitionRepository
	MakeRepository repositories.DeviceMakeRepository
}

func (GetAllDeviceDefinitionQueryHandler) Handle

func (ch GetAllDeviceDefinitionQueryHandler) Handle(ctx context.Context, query mediator.Message) (interface{}, error)

type GetAllDeviceDefinitionQueryResult

type GetAllDeviceDefinitionQueryResult struct {
	Make   string            `json:"make"`
	Models []GetDeviceModels `json:"models"`
}

type GetAllIntegrationQuery

type GetAllIntegrationQuery struct {
}

func (*GetAllIntegrationQuery) Key

type GetAllIntegrationQueryHandler

type GetAllIntegrationQueryHandler struct {
	DBS func() *db.ReaderWriter
}

func NewGetAllIntegrationQueryHandler

func NewGetAllIntegrationQueryHandler(dbs func() *db.ReaderWriter) GetAllIntegrationQueryHandler

func (GetAllIntegrationQueryHandler) Handle

func (ch GetAllIntegrationQueryHandler) Handle(ctx context.Context, query mediator.Message) (interface{}, error)

type GetAllIntegrationQueryResult

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

type GetDeviceCompatibility

type GetDeviceCompatibility struct {
	ID           string          `json:"id"`
	Type         string          `json:"type"`
	Style        string          `json:"style"`
	Vendor       string          `json:"vendor"`
	Region       string          `json:"region"`
	Country      string          `json:"country,omitempty"`
	Capabilities json.RawMessage `json:"capabilities"`
}

DeviceCompatibility represents what systems we know this is compatible with

type GetDeviceDefinitionByIDQuery added in v0.1.2

type GetDeviceDefinitionByIDQuery struct {
	DeviceDefinitionID string `json:"deviceDefinitionId" validate:"required"`
}

func (*GetDeviceDefinitionByIDQuery) Key added in v0.1.2

type GetDeviceDefinitionByIDQueryHandler added in v0.1.2

type GetDeviceDefinitionByIDQueryHandler struct {
	Repository repositories.DeviceDefinitionRepository
}

func NewGetDeviceDefinitionByIDQueryHandler added in v0.1.2

func NewGetDeviceDefinitionByIDQueryHandler(repository repositories.DeviceDefinitionRepository) GetDeviceDefinitionByIDQueryHandler

func (GetDeviceDefinitionByIDQueryHandler) Handle added in v0.1.2

func (ch GetDeviceDefinitionByIDQueryHandler) Handle(ctx context.Context, query mediator.Message) (interface{}, error)

type GetDeviceDefinitionByIDQueryResult added in v0.1.2

type GetDeviceDefinitionByIDQueryResult struct {
	DeviceDefinitionID     string                               `json:"deviceDefinitionId"`
	Name                   string                               `json:"name"`
	ImageURL               *string                              `json:"imageUrl"`
	CompatibleIntegrations []GetDeviceCompatibility             `json:"compatibleIntegrations"`
	Type                   DeviceType                           `json:"type"`
	VehicleInfo            GetDeviceVehicleInfo                 `json:"vehicleData,omitempty"`
	Metadata               interface{}                          `json:"metadata"`
	Verified               bool                                 `json:"verified"`
	DeviceIntegrations     []GetDeviceDefinitionIntegrationList `json:"deviceIntegrations"`
}

type GetDeviceDefinitionByIdsQuery added in v0.1.2

type GetDeviceDefinitionByIdsQuery struct {
	DeviceDefinitionID []string `json:"deviceDefinitionId" validate:"required"`
}

func (*GetDeviceDefinitionByIdsQuery) Key added in v0.1.2

type GetDeviceDefinitionByIdsQueryHandler added in v0.1.2

type GetDeviceDefinitionByIdsQueryHandler struct {
	Repository repositories.DeviceDefinitionRepository
}

func NewGetDeviceDefinitionByIdsQueryHandler added in v0.1.2

func NewGetDeviceDefinitionByIdsQueryHandler(repository repositories.DeviceDefinitionRepository) GetDeviceDefinitionByIdsQueryHandler

func (GetDeviceDefinitionByIdsQueryHandler) Handle added in v0.1.2

func (ch GetDeviceDefinitionByIdsQueryHandler) Handle(ctx context.Context, query mediator.Message) (interface{}, error)

type GetDeviceDefinitionByMakeModelYearQuery

type GetDeviceDefinitionByMakeModelYearQuery struct {
	Make  string `json:"make" validate:"required"`
	Model string `json:"model" validate:"required"`
	Year  int    `json:"year" validate:"required"`
}

func (*GetDeviceDefinitionByMakeModelYearQuery) Key

type GetDeviceDefinitionByMakeModelYearQueryHandler

type GetDeviceDefinitionByMakeModelYearQueryHandler struct {
	Repository repositories.DeviceDefinitionRepository
}

func (GetDeviceDefinitionByMakeModelYearQueryHandler) Handle

type GetDeviceDefinitionByMakeModelYearQueryResult

type GetDeviceDefinitionByMakeModelYearQueryResult struct {
	DeviceDefinitionID string  `json:"deviceDefinitionId"`
	Name               string  `json:"name"`
	ImageURL           *string `json:"imageUrl"`
	// CompatibleIntegrations has systems this vehicle can integrate with
	CompatibleIntegrations []GetDeviceCompatibility `json:"compatibleIntegrations"`
	Type                   DeviceType               `json:"type"`
	// VehicleInfo will be empty if not a vehicle type
	VehicleInfo GetDeviceVehicleInfo `json:"vehicleData,omitempty"`
	Metadata    interface{}          `json:"metadata"`
	Verified    bool                 `json:"verified"`
}

type GetDeviceDefinitionIntegrationList added in v0.1.2

type GetDeviceDefinitionIntegrationList struct {
	ID           string          `json:"id"`
	Type         string          `json:"type"`
	Style        string          `json:"style"`
	Vendor       string          `json:"vendor"`
	Region       string          `json:"region"`
	Country      string          `json:"country,omitempty"`
	Capabilities json.RawMessage `json:"capabilities"`
}

type GetDeviceDefinitionWithRelsQuery

type GetDeviceDefinitionWithRelsQuery struct {
	DeviceDefinitionID string `json:"deviceDefinitionId" validate:"required"`
}

func (*GetDeviceDefinitionWithRelsQuery) Key

type GetDeviceDefinitionWithRelsQueryHandler

type GetDeviceDefinitionWithRelsQueryHandler struct {
	Repository repositories.DeviceDefinitionRepository
}

func (GetDeviceDefinitionWithRelsQueryHandler) Handle

func (ch GetDeviceDefinitionWithRelsQueryHandler) Handle(ctx context.Context, query mediator.Message) (interface{}, error)

type GetDeviceDefinitionWithRelsQueryResult

type GetDeviceDefinitionWithRelsQueryResult struct {
	ID           string          `json:"id"`
	Type         string          `json:"type"`
	Style        string          `json:"style"`
	Vendor       string          `json:"vendor"`
	Region       string          `json:"region"`
	Country      string          `json:"country,omitempty"`
	Capabilities json.RawMessage `json:"capabilities"`
}

type GetDeviceModelYear

type GetDeviceModelYear struct {
	Year               int16  `json:"year"`
	DeviceDefinitionID string `json:"id"`
}

type GetDeviceModels

type GetDeviceModels struct {
	Model string               `json:"model"`
	Years []GetDeviceModelYear `json:"years"`
}

type GetDeviceVehicleInfo

type GetDeviceVehicleInfo struct {
	FuelType            string `json:"fuel_type,omitempty"`
	DrivenWheels        string `json:"driven_wheels,omitempty"`
	NumberOfDoors       string `json:"number_of_doors,omitempty"`
	BaseMSRP            int    `json:"base_msrp,omitempty"`
	EPAClass            string `json:"epa_class,omitempty"`
	VehicleType         string `json:"vehicle_type,omitempty"` // VehicleType PASSENGER CAR, from NHTSA
	MPGHighway          string `json:"mpg_highway,omitempty"`
	MPGCity             string `json:"mpg_city,omitempty"`
	FuelTankCapacityGal string `json:"fuel_tank_capacity_gal,omitempty"`
}

DeviceVehicleInfo represents some standard vehicle specific properties stored in the metadata json field in DB

Jump to

Keyboard shortcuts

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