common

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

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 BuildDeviceTypeAttributes added in v0.2.0

func BuildDeviceTypeAttributes(attributes []*models.UpdateDeviceTypeAttribute, dt *repoModel.DeviceType) (map[string]interface{}, 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 Contains added in v0.1.4

func Contains(s []string, str string) bool

Contains returns true if string exist in slice

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 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 SlugString(term string) string

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 ErrorResponse struct {
	Field string
	Tag   string
	Value string
}

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

Jump to

Keyboard shortcuts

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