repositories

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const NHTSARecallsColumnCount = 27

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, make string, model string, year int, loadIntegrations bool) (*models.DeviceDefinition, error)
	GetBySlugAndYear(ctx context.Context, slug string, year int, 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) 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 {
	DeviceDefinitions models.DeviceDefinition `boil:"DeviceDefinitions,bind"`
	DeviceMakes       models.DeviceMake       `boil:"DeviceMakes,bind"`
}

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 DeviceNHTSARecallsRepository added in v0.2.4

type DeviceNHTSARecallsRepository interface {
	Create(ctx context.Context, deviceDefinitionID null.String, data []string, metadata null.JSON, hash []byte) (*models.DeviceNhtsaRecall, error)
	GetLastDataRecordID(ctx context.Context) (*null.Int, error)
	MatchDeviceDefinition(ctx context.Context, matchingVersion string) (int64, error)
}

func NewDeviceNHTSARecallsRepository added in v0.2.4

func NewDeviceNHTSARecallsRepository(dbs func() *db.ReaderWriter) DeviceNHTSARecallsRepository

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, make 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