repositories

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 15 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)
	GetWithIntegrations(ctx context.Context, id string) (*models.DeviceDefinition, error)
	GetOrCreate(ctx context.Context, source string, make string, model string, year int, deviceTypeID string, metaData map[string]interface{}) (*models.DeviceDefinition, error)
	CreateOrUpdate(ctx context.Context, dd *models.DeviceDefinition, deviceStyles []*models.DeviceStyle, deviceIntegrations []*models.DeviceIntegration, metaData map[string]interface{}) (*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) (*models.DeviceIntegration, error)
}

func NewDeviceIntegrationRepository added in v0.1.4

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

type DeviceMakeRepository

type DeviceMakeRepository interface {
	GetAll(ctx context.Context) ([]*models.DeviceMake, error)
	GetOrCreate(ctx context.Context, makeName string, logURL 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) (*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

Directories

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

Jump to

Keyboard shortcuts

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