services

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const EstMilesPerYear = 12000.0
View Source
const NorthAmercanCountries = "USA,CAN,MEX,PRI"

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressComponents

type AddressComponents struct {
	LongName  string   `json:"long_name"`
	ShortName string   `json:"short_name"`
	Types     []string `json:"types"`
}

type DrivlyAPIService

type DrivlyAPIService interface {
	GetVINInfo(vin string) (map[string]interface{}, error)
	GetVINPricing(vin string, reqData *core.ValuationRequestData) (map[string]any, error)

	GetOffersByVIN(vin string, reqData *core.ValuationRequestData) (map[string]interface{}, error)
	GetAutocheckByVIN(vin string) (map[string]interface{}, error)
	GetBuildByVIN(vin string) (map[string]interface{}, error)
	GetCargurusByVIN(vin string) (map[string]interface{}, error)
	GetCarvanaByVIN(vin string) (map[string]interface{}, error)
	GetCarmaxByVIN(vin string) (map[string]interface{}, error)
	GetCarstoryByVIN(vin string) (map[string]interface{}, error)
	GetEdmundsByVIN(vin string) (map[string]interface{}, error)
	GetTMVByVIN(vin string) (map[string]interface{}, error)
	GetKBBByVIN(vin string) (map[string]interface{}, error)
	GetVRoomByVIN(vin string) (map[string]interface{}, error)

	GetExtendedOffersByVIN(vin string) (*core.DrivlyVINSummary, error)
}

func NewDrivlyAPIService

func NewDrivlyAPIService(settings *config.Settings, dbs func() *db.ReaderWriter) DrivlyAPIService

type DrivlyValuationService

type DrivlyValuationService interface {
	PullValuation(ctx context.Context, tokenID uint64, vin, privJWTAuthHeader string) (core.DataPullStatusEnum, error)
	PullOffer(ctx context.Context, tokenID uint64, vin, privJWTAuthHeader string) (core.DataPullStatusEnum, error)
}

func NewDrivlyValuationService

func NewDrivlyValuationService(DBS func() *db.ReaderWriter, log *zerolog.Logger, settings *config.Settings) DrivlyValuationService

type GoogleGeoAPIService

type GoogleGeoAPIService interface {
	GeoDecodeLatLong(lat, lng float64) (*MapsGeocodeResp, error)
}

func NewGoogleGeoAPIService

func NewGoogleGeoAPIService(settings *config.Settings) GoogleGeoAPIService

type LocationService added in v0.5.3

type LocationService interface {
	GetGeoDecodedLocation(ctx context.Context, signals *coremodels.SignalsLatest, tokenID uint64) (*coremodels.LocationResponse, error)
}

func NewLocationService added in v0.5.3

func NewLocationService(db func() *db.ReaderWriter, settings *config.Settings, logger *zerolog.Logger) LocationService

type MapsGeocodeResp

type MapsGeocodeResp struct {
	PostalCode   string
	StreetNumber string
	// street name
	Route string
	// eg Bergenfield
	Locality string
	// eg Bergen County
	AdminAreaLevel2 string
	// eg NJ (state)
	AdminAreaLevel1  string
	Country          string
	FormattedAddress string
}

type NATSService

type NATSService struct {
	JetStream                nats.JetStreamContext
	JetStreamName            string
	ValuationSubject         string
	OfferSubject             string
	AckTimeout               time.Duration
	ValuationDurableConsumer string
	OfferDurableConsumer     string
	// contains filtered or unexported fields
}

func NewNATSService

func NewNATSService(settings *config.Settings, log *zerolog.Logger) (*NATSService, error)

type Result

type Result struct {
	Results []struct {
		AddressComponents []AddressComponents `json:"address_components"`
	} `json:"results"`
}

type UserDeviceAPIService

type UserDeviceAPIService interface {
	GetOffers(ctx context.Context, tokenID uint64) (*core.DeviceOffer, error)
	GetValuations(ctx context.Context, tokenID uint64, privJWT string) (*core.DeviceValuation, error)
	CanRequestInstantOffer(ctx context.Context, tokenID uint64) (bool, error)
	LastRequestDidGiveError(ctx context.Context, tokenID uint64) (bool, error)
}

func NewUserDeviceService

func NewUserDeviceService(devicesConn *grpc.ClientConn, dbs func() *db.ReaderWriter, logger *zerolog.Logger,
	locationSvc LocationService, telemetryAPI gateways.TelemetryAPI) UserDeviceAPIService

type VehicleMintEvent added in v0.4.2

type VehicleMintEvent struct {
	ID          string          `json:"id"`
	Source      string          `json:"source"`
	Specversion string          `json:"specversion"`
	Subject     string          `json:"subject"`
	Time        time.Time       `json:"time"`
	Type        string          `json:"type"`
	Data        json.RawMessage `json:"data"`
}

VehicleMintEvent is emitted by devices-api registry/storage.go Handle(...)

type VehicleMintValuationIngest added in v0.4.2

type VehicleMintValuationIngest interface {
	ProcessVehicleMintMsg(ctx goka.Context, msg any)
}

func NewVehicleMintValuationIngest added in v0.4.2

func NewVehicleMintValuationIngest(dbs func() *db.ReaderWriter, logger zerolog.Logger, settings *config.Settings,
	telemetryAPI gateways.TelemetryAPI,
	identityAPI gateways.IdentityAPI,
) VehicleMintValuationIngest

type VincarioAPIService

type VincarioAPIService interface {
	GetMarketValuation(vin string) (*core.VincarioMarketValueResponse, error)
}

func NewVincarioAPIService

func NewVincarioAPIService(settings *config.Settings, log *zerolog.Logger) VincarioAPIService

type VincarioValuationService

type VincarioValuationService interface {
	PullValuation(ctx context.Context, tokenID uint64, vin string) (core.DataPullStatusEnum, error)
}

func NewVincarioValuationService

func NewVincarioValuationService(DBS func() *db.ReaderWriter, log *zerolog.Logger, settings *config.Settings, identityAPI gateways.IdentityAPI) VincarioValuationService

Directories

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

Jump to

Keyboard shortcuts

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