repositories

package
v1.2.63 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceDefinitionRepository

type DeviceDefinitionRepository interface {
	GetByID(ctx context.Context, id string) (*models.DeviceDefinition, error)
	GetByMakeModelAndYears(ctx context.Context, mk string, model string, year int, loadIntegrations bool) (*models.DeviceDefinition, error)
	GetBySlugAndYear(ctx context.Context, slug string, year int, loadIntegrations bool) (*models.DeviceDefinition, error)
	GetBySlugName(ctx context.Context, slug string, loadIntegrations bool) (*models.DeviceDefinition, error)
	GetAll(ctx context.Context) ([]*models.DeviceDefinition, error)
	GetDevicesByMakeYearRange(ctx context.Context, makeID string, yearStart, yearEnd int32) ([]*models.DeviceDefinition, error)
	GetDevicesMMY(ctx context.Context) ([]*DeviceMMYJoinQueryOutput, error)
	GetWithIntegrations(ctx context.Context, id string) (*models.DeviceDefinition, error)
	GetOrCreate(ctx context.Context, tx *sql.Tx, source string, extID string, makeOrID string, model string, year int, deviceTypeID string, metaData null.JSON, verified bool, hardwareTemplateID *string) (*models.DeviceDefinition, error)
	CreateOrUpdate(ctx context.Context, dd *models.DeviceDefinition, deviceStyles []*models.DeviceStyle, deviceIntegrations []*models.DeviceIntegration) (*models.DeviceDefinition, error)
	FetchDeviceCompatibility(ctx context.Context, makeID, integrationID, region, cursor string, size int64) (models.DeviceDefinitionSlice, error)
}

func NewDeviceDefinitionRepository

func NewDeviceDefinitionRepository(dbs func() *db.ReaderWriter, deviceDefinitionOnChainService gateways.DeviceDefinitionOnChainService) DeviceDefinitionRepository

type DeviceIntegrationRepository added in v0.1.4

type DeviceIntegrationRepository interface {
	Create(ctx context.Context, deviceDefinitionID string, integrationID string, region string, features []map[string]interface{}) (*models.DeviceIntegration, error)
}

func NewDeviceIntegrationRepository added in v0.1.4

func NewDeviceIntegrationRepository(dbs func() *db.ReaderWriter) DeviceIntegrationRepository

type DeviceMMYJoinQueryOutput added in v0.7.2

type DeviceMMYJoinQueryOutput struct {
	DefinitionNameSlug string `boil:"definition_name_slug"`
	ModelSlug          string `boil:"model_slug"`
	Year               int16  `boil:"year"`
	MakeSlug           string `boil:"make_name_slug"`
}

type DeviceMakeRepository

type DeviceMakeRepository interface {
	GetAll(ctx context.Context) ([]*models.DeviceMake, error)
	GetOrCreate(ctx context.Context, makeName string, logURL string, externalIDs string, metadata string, hardwareTemplateID string) (*models.DeviceMake, error)
}

func NewDeviceMakeRepository

func NewDeviceMakeRepository(dbs func() *db.ReaderWriter) DeviceMakeRepository

type DeviceStyleRepository added in v0.1.11

type DeviceStyleRepository interface {
	Create(ctx context.Context, deviceDefinitionID string, name string, externalStyleID string, source string, subModel string, templateID string) (*models.DeviceStyle, error)
}

func NewDeviceStyleRepository added in v0.1.11

func NewDeviceStyleRepository(dbs func() *db.ReaderWriter) DeviceStyleRepository

type GetDeviceCompatibilityRequest added in v0.3.5

type GetDeviceCompatibilityRequest struct {
	MakeID        string `json:"makeId" validate:"required"`
	IntegrationID string `json:"integrationId" validate:"required"`
	Region        string `json:"region" validate:"required"`
	Cursor        string `json:"cursor"`
	Size          int64  `json:"size"`
}

type IntegrationsMetadata added in v0.1.9

type IntegrationsMetadata struct {
	AutoPiDefaultTemplateID      int                    `json:"autoPiDefaultTemplateId"`
	AutoPiPowertrainToTemplateID map[PowertrainType]int `json:"autoPiPowertrainToTemplateId,omitempty"`
}

IntegrationsMetadata represents json stored in integrations table metadata jsonb column

type PowertrainType added in v0.1.9

type PowertrainType string
const (
	ICE  PowertrainType = "ICE"
	HEV  PowertrainType = "HEV"
	PHEV PowertrainType = "PHEV"
	BEV  PowertrainType = "BEV"
	FCEV PowertrainType = "FCEV"
)

func (PowertrainType) String added in v0.1.9

func (p PowertrainType) String() string

type VINRepository added in v0.7.9

type VINRepository interface {
	GetOrCreateWMI(ctx context.Context, wmi string, mk string) (*models.Wmi, error)
}

func NewVINRepository added in v0.7.9

func NewVINRepository(dbs func() *db.ReaderWriter) VINRepository

Directories

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

Jump to

Keyboard shortcuts

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