utils

package
v0.0.0-...-f9c177b Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const BODYSTYLE_SOURCE_COLLECTION = "bodystyles"
View Source
const CARS_NON_PROCESSED_COLLECTION = "cars_non_processed"
View Source
const CARS_PROCESSED_COLLECTION = "cars_processed"
View Source
const DATABASE = "catalog"
View Source
const DB_URL_ENV_KEY = "DATABASE_URI"
View Source
const DEALERS_COLLECTION = "dealers_supercarros"
View Source
const DEALERS_SOURCE_COLLECTION = "dealers"
View Source
const DOP_TO_USD = 58
View Source
const DRIVETRAIN_SOURCE_COLLECTION = "drivetrains"
View Source
const FEATURE_SOURCE_COLLECTION = "features"
View Source
const FEE = 0
View Source
const FUELTYPE_SOURCE_COLLECTION = "fueltypes"
View Source
const TRANSFER = 0
View Source
const TRANSMISSION_SOURCE_COLLECTION = "transmissions"

Variables

This section is empty.

Functions

func CleanDns

func CleanDns()

func ConvertPrice

func ConvertPrice(price int, currency string) int

func EliminateExtraSpace

func EliminateExtraSpace(s string) string

func Geocode

func Geocode(address string) (float64, float64, error)

func GetTelephoneNumber

func GetTelephoneNumber(s string) string

func LoadEnvs

func LoadEnvs(ctx *context.Context)

func ReplaceAccentedChars

func ReplaceAccentedChars(value string) string

func ReplaceNewLine

func ReplaceNewLine(s string) string

func Slug

func Slug(value []string) string

func Title

func Title(s string) string

func ToObjectId

func ToObjectId(id interface{}) (primitive.ObjectID, error)

func TransformTelephoneNumber

func TransformTelephoneNumber(s string) string

Types

type ContextKey

type ContextKey string
const (
	ProjectIdKey     ContextKey = "projectId"
	BucketNameKey    ContextKey = "bucketName"
	SubFolderPathKey ContextKey = "subFolderPath"
	CountryVersionId ContextKey = "countryVersionId"
	CategoryId       ContextKey = "categoryId"
	GeoCode          ContextKey = "geoCode"
	DbUri            ContextKey = "dbUri"
	ProductionApiUrl ContextKey = "productionApiUrl"
	SessionSecret    ContextKey = "sessionSecret"
	CityId           ContextKey = "cityId"
	SpotId           ContextKey = "spotId"
)

type GeocodeResponse

type GeocodeResponse struct {
	Results []struct {
		Geometry struct {
			Location struct {
				Lat float64 `json:"lat"`
				Lng float64 `json:"lng"`
			} `json:"location"`
		} `json:"geometry"`
	} `json:"results"`
}

type MatchingStrategy

type MatchingStrategy string
const (
	ViaTrim      MatchingStrategy = "trim"
	ViaUnmatched MatchingStrategy = "unmatched"
)

func (MatchingStrategy) String

func (f MatchingStrategy) String() string

type StatusRequest

type StatusRequest string
const (
	Success StatusRequest = "success"
	Failed  StatusRequest = "failed"
)

Jump to

Keyboard shortcuts

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