Documentation ¶
Index ¶
- Constants
- type AddressComponents
- type DeviceDefinitionsAPIService
- type DrivlyAPIService
- type DrivlyVINSummary
- type DrivlyValuationService
- type GoogleGeoAPIService
- type MapsGeocodeResp
- type NATSService
- type Result
- type UserDeviceAPIService
- type UserDeviceDataAPIService
- type ValuationRequestData
- type VehicleMintEvent
- type VehicleMintValuationIngest
- type VincarioAPIService
- type VincarioMarketValueResponse
- type VincarioValuationService
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 DeviceDefinitionsAPIService ¶
type DeviceDefinitionsAPIService interface { GetDeviceDefinitionByID(ctx context.Context, id string) (*pb.GetDeviceDefinitionItemResponse, error) GetDeviceStyleByExternalID(ctx context.Context, id string) (*pb.DeviceStyle, error) UpdateDeviceDefAttrs(ctx context.Context, deviceDef *pb.GetDeviceDefinitionItemResponse, vinInfo map[string]any) error }
func NewDeviceDefinitionsAPIService ¶
func NewDeviceDefinitionsAPIService(ddConn *grpc.ClientConn) DeviceDefinitionsAPIService
type DrivlyAPIService ¶
type DrivlyAPIService interface { GetVINInfo(vin string) (map[string]interface{}, error) GetVINPricing(vin string, reqData *ValuationRequestData) (map[string]any, error) GetOffersByVIN(vin string, reqData *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) (*DrivlyVINSummary, error) }
func NewDrivlyAPIService ¶
func NewDrivlyAPIService(settings *config.Settings, dbs func() *db.ReaderWriter) DrivlyAPIService
type DrivlyVINSummary ¶
type DrivlyVINSummary struct { Pricing map[string]interface{} Offers map[string]interface{} AutoCheck map[string]interface{} Build map[string]interface{} Cargurus map[string]interface{} Carvana map[string]interface{} Carmax map[string]interface{} Carstory map[string]interface{} Edmunds map[string]interface{} TMV map[string]interface{} KBB map[string]interface{} VRoom map[string]interface{} }
type DrivlyValuationService ¶
type DrivlyValuationService interface { PullValuation(ctx context.Context, userDeviceID string, tokenID uint64, deviceDefinitionID, vin string) (core.DataPullStatusEnum, error) PullOffer(ctx context.Context, userDeviceID string, tokenID uint64, vin string) (core.DataPullStatusEnum, error) }
func NewDrivlyValuationService ¶
func NewDrivlyValuationService(DBS func() *db.ReaderWriter, log *zerolog.Logger, settings *config.Settings, ddSvc DeviceDefinitionsAPIService, uddSvc UserDeviceDataAPIService, udSvc UserDeviceAPIService) DrivlyValuationService
type GoogleGeoAPIService ¶
type GoogleGeoAPIService interface {
GeoDecodeLatLong(lat, lng float64) (*MapsGeocodeResp, error)
}
func NewGoogleGeoAPIService ¶
func NewGoogleGeoAPIService(settings *config.Settings) GoogleGeoAPIService
type MapsGeocodeResp ¶
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 ¶
type Result ¶
type Result struct { Results []struct { AddressComponents []AddressComponents `json:"address_components"` } `json:"results"` }
type UserDeviceAPIService ¶
type UserDeviceAPIService interface { GetUserDevice(ctx context.Context, userDeviceID string) (*pb.UserDevice, error) GetUserDeviceByTokenID(ctx context.Context, tokenID *big.Int) (*pb.UserDevice, error) GetUserDeviceByEthAddr(ctx context.Context, ethAddr string) (*pb.UserDevice, error) GetAllUserDevice(ctx context.Context, wmi string) ([]*pb.UserDevice, error) UpdateUserDeviceMetadata(ctx context.Context, request *pb.UpdateUserDeviceMetadataRequest) error GetUserDeviceOffers(ctx context.Context, userDeviceID string) (*core.DeviceOffer, error) GetUserDeviceOffersByTokenID(ctx context.Context, tokenID *big.Int, take int, userDeviceID string) (*core.DeviceOffer, error) GetUserDeviceValuations(ctx context.Context, userDeviceID, countryCode string) (*core.DeviceValuation, error) GetUserDeviceValuationsByTokenID(ctx context.Context, tokenID *big.Int, countryCode string, take int, userDeviceID string) (*core.DeviceValuation, error) CanRequestInstantOffer(ctx context.Context, userDeviceID string) (bool, error) CanRequestInstantOfferByTokenID(ctx context.Context, tokenID *big.Int) (bool, error) LastRequestDidGiveError(ctx context.Context, userDeviceID string) (bool, error) LastRequestDidGiveErrorByTokenID(ctx context.Context, tokenID *big.Int) (bool, error) }
func NewUserDeviceService ¶
func NewUserDeviceService( devicesConn *grpc.ClientConn, dbs func() *db.ReaderWriter, logger *zerolog.Logger, ) UserDeviceAPIService
type UserDeviceDataAPIService ¶
type UserDeviceDataAPIService interface { GetUserDeviceData(ctx context.Context, userDeviceID string, ddID string) (*pb.UserDeviceDataResponse, error) GetVehicleRawData(ctx context.Context, userDeviceID string) (*pb.RawDeviceDataResponse, error) }
func NewUserDeviceDataAPIService ¶
func NewUserDeviceDataAPIService(ddConn *grpc.ClientConn) UserDeviceDataAPIService
type ValuationRequestData ¶
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
func NewVehicleMintValuationIngest ¶ added in v0.4.2
func NewVehicleMintValuationIngest(dbs func() *db.ReaderWriter, logger zerolog.Logger, settings *config.Settings, userDeviceService UserDeviceAPIService, ddSvc DeviceDefinitionsAPIService, uddSvc UserDeviceDataAPIService, ) VehicleMintValuationIngest
type VincarioAPIService ¶
type VincarioAPIService interface {
GetMarketValuation(vin string) (*VincarioMarketValueResponse, error)
}
func NewVincarioAPIService ¶
func NewVincarioAPIService(settings *config.Settings, log *zerolog.Logger) VincarioAPIService
type VincarioMarketValueResponse ¶
type VincarioMarketValueResponse struct { Vin string `json:"vin"` Price int `json:"price"` PriceCurrency string `json:"price_currency"` Balance struct { APIDecode int `json:"API Decode"` APIStolenCheck int `json:"API Stolen Check"` APIVehicleMarketValue int `json:"API Vehicle Market Value"` APIOEMVINLookup int `json:"API OEM VIN Lookup"` } `json:"balance"` // nolint Vehicle struct { VehicleId int `json:"vehicle_id"` Make string `json:"make"` MakeId int `json:"make_id"` Model string `json:"model"` ModelId int `json:"model_id"` ModelYear int `json:"model_year"` } `json:"vehicle"` Period struct { From string `json:"from"` To string `json:"to"` } `json:"period"` MarketPrice struct { Europe struct { PriceCount int `json:"price_count"` PriceCurrency string `json:"price_currency"` PriceBelow int `json:"price_below"` PriceMedian int `json:"price_median"` PriceAvg int `json:"price_avg"` PriceAbove int `json:"price_above"` PriceStdev int `json:"price_stdev"` } `json:"europe"` NorthAmerica struct { PriceCount int `json:"price_count"` PriceCurrency string `json:"price_currency"` PriceBelow int `json:"price_below"` PriceMedian int `json:"price_median"` PriceAvg int `json:"price_avg"` PriceAbove int `json:"price_above"` PriceStdev int `json:"price_stdev"` } `json:"north_america"` } `json:"market_price"` MarketOdometer struct { Europe struct { OdometerCount int `json:"odometer_count"` OdometerUnit string `json:"odometer_unit"` OdometerMedian int `json:"odometer_median"` OdometerAvg int `json:"odometer_avg"` OdometerStdev int `json:"odometer_stdev"` } `json:"europe"` NorthAmerica struct { OdometerCount int `json:"odometer_count"` OdometerUnit string `json:"odometer_unit"` OdometerMedian int `json:"odometer_median"` OdometerAvg int `json:"odometer_avg"` OdometerStdev int `json:"odometer_stdev"` } `json:"north_america"` } `json:"market_odometer"` Records []struct { Market string `json:"market"` Continent string `json:"continent"` Price int `json:"price"` PriceCurrency string `json:"price_currency"` Odometer int `json:"odometer,omitempty"` OdometerUnit string `json:"odometer_unit,omitempty"` } `json:"records"` }
type VincarioValuationService ¶
type VincarioValuationService interface {
PullValuation(ctx context.Context, userDeviceID string, tokenID uint64, deviceDefinitionID, vin string) (core.DataPullStatusEnum, error)
}
func NewVincarioValuationService ¶
func NewVincarioValuationService(DBS func() *db.ReaderWriter, log *zerolog.Logger, settings *config.Settings, udSvc UserDeviceAPIService) VincarioValuationService
Source Files ¶
Click to show internal directories.
Click to hide internal directories.