Documentation ¶
Index ¶
- Constants
- Variables
- func BuildDeviceDefinitionName(year int16, make string, model string) string
- func BuildDeviceIntegrationFeatureAttribute(attributes []*models.UpdateDeviceIntegrationFeatureAttribute, ...) ([]map[string]interface{}, error)
- func BuildDeviceMakeMetadata(metadataJSON null.JSON) *models.DeviceMakeMetadata
- func BuildDeviceTypeAttributes(attributes []*models.UpdateDeviceTypeAttribute, dt *repoModel.DeviceType) (null.JSON, error)
- func BuildExternalIds(externalIdsJSON null.JSON) []*models.ExternalID
- func BuildFromDeviceDefinitionToQueryResult(dd *repoModel.DeviceDefinition) (*models.GetDeviceDefinitionQueryResult, error)
- func BuildFromQueryResultToGRPC(dd *models.GetDeviceDefinitionQueryResult) *grpc.GetDeviceDefinitionItemResponse
- func Contains(s []string, str string) bool
- func DeviceMakeMetadataToGRPC(dm *models.DeviceMakeMetadata) *grpc.Metadata
- func ExternalIdsFromGRPC(externalIdsGRPC []*grpc.ExternalID) []*models.ExternalID
- func ExternalIdsToGRPC(externalIds []*models.ExternalID) []*grpc.ExternalID
- func GetDefaultImageURL(dd *repoModel.DeviceDefinition) string
- func GetDeviceAttributesTyped(metadata null.JSON, key string) []models.DeviceTypeAttribute
- func JSONOrDefault(j null.JSON) json.RawMessage
- func PrintMMY(definition *repoModel.DeviceDefinition, color string, includeSource bool) string
- func SlugString(term string) string
- func SubModelsFromStylesDB(styles repoModel.DeviceStyleSlice) []string
- type ErrorResponse
- type RegionEnum
Constants ¶
View Source
const ( PowerTrainType = "powertrain_type" // VehicleMetadataKey is the default json key where we store vehicle metadata in device_definitions.metadata VehicleMetadataKey = "vehicle_info" )
View Source
const ( SmartCarVendor = "SmartCar" TeslaVendor = "Tesla" AutoPiVendor = "AutoPi" )
View Source
const (
DefaultDeviceType = "vehicle"
)
Variables ¶
View Source
var Green = "\033[32m"
View Source
var Purple = "\033[35m"
View Source
var Red = "\033[31m"
View Source
var Reset = "\033[0m"
Functions ¶
func BuildDeviceDefinitionName ¶ added in v0.4.3
func BuildDeviceIntegrationFeatureAttribute ¶ added in v0.5.6
func BuildDeviceIntegrationFeatureAttribute(attributes []*models.UpdateDeviceIntegrationFeatureAttribute, dt []*repoModel.IntegrationFeature) ([]map[string]interface{}, error)
func BuildDeviceMakeMetadata ¶ added in v0.5.1
func BuildDeviceMakeMetadata(metadataJSON null.JSON) *models.DeviceMakeMetadata
func BuildDeviceTypeAttributes ¶ added in v0.2.0
func BuildDeviceTypeAttributes(attributes []*models.UpdateDeviceTypeAttribute, dt *repoModel.DeviceType) (null.JSON, error)
func BuildExternalIds ¶ added in v0.3.3
func BuildExternalIds(externalIdsJSON null.JSON) []*models.ExternalID
func BuildFromDeviceDefinitionToQueryResult ¶ added in v0.1.30
func BuildFromDeviceDefinitionToQueryResult(dd *repoModel.DeviceDefinition) (*models.GetDeviceDefinitionQueryResult, error)
func BuildFromQueryResultToGRPC ¶ added in v0.1.30
func BuildFromQueryResultToGRPC(dd *models.GetDeviceDefinitionQueryResult) *grpc.GetDeviceDefinitionItemResponse
func DeviceMakeMetadataToGRPC ¶ added in v0.5.1
func DeviceMakeMetadataToGRPC(dm *models.DeviceMakeMetadata) *grpc.Metadata
func ExternalIdsFromGRPC ¶ added in v0.3.4
func ExternalIdsFromGRPC(externalIdsGRPC []*grpc.ExternalID) []*models.ExternalID
func ExternalIdsToGRPC ¶ added in v0.3.3
func ExternalIdsToGRPC(externalIds []*models.ExternalID) []*grpc.ExternalID
func GetDefaultImageURL ¶ added in v0.7.4
func GetDefaultImageURL(dd *repoModel.DeviceDefinition) string
GetDefaultImageURL if the images relation is not empty, looks for the best image to use based on some logic
func GetDeviceAttributesTyped ¶ added in v0.8.8
func GetDeviceAttributesTyped(metadata null.JSON, key string) []models.DeviceTypeAttribute
func JSONOrDefault ¶ added in v0.1.2
func JSONOrDefault(j null.JSON) json.RawMessage
func PrintMMY ¶ added in v0.1.4
func PrintMMY(definition *repoModel.DeviceDefinition, color string, includeSource bool) string
func SlugString ¶ added in v0.1.23
func SubModelsFromStylesDB ¶ added in v0.1.4
func SubModelsFromStylesDB(styles repoModel.DeviceStyleSlice) []string
SubModelsFromStylesDB gets the unique style.SubModel from the styles slice, deduping sub_model
Types ¶
type ErrorResponse ¶
type RegionEnum ¶ added in v0.1.6
type RegionEnum string
const ( AmericasRegion RegionEnum = "Americas" EuropeRegion RegionEnum = "Europe" )
func (RegionEnum) String ¶ added in v0.1.6
func (r RegionEnum) String() string
Click to show internal directories.
Click to hide internal directories.