Documentation ¶
Index ¶
- func AftermarketDeviceIDToToken(id string) (int, error)
- func AftermarketDeviceToAPI(d *models.AftermarketDevice, imageUrl string) *gmodel.AftermarketDevice
- func DCNToAPI(d *models.DCN) *gmodel.Dcn
- func ManufacturerIDToToken(id string) (int, error)
- func ManufacturerToAPI(m *models.Manufacturer) *gmodel.Manufacturer
- func RewardToAPI(reward models.Reward) gmodel.Earning
- func SyntheticDeviceToAPI(sd *models.SyntheticDevice) *gmodel.SyntheticDevice
- func VehicleIDToToken(id string) (int, error)
- func VehicleToAPI(v *models.Vehicle, imageUrl string) *gmodel.Vehicle
- type DCNCursor
- type EarningsSummary
- type PrivilegeCursor
- type Repository
- func (r *Repository) GetAftermarketDevice(ctx context.Context, by gmodel.AftermarketDeviceBy) (*gmodel.AftermarketDevice, error)
- func (r *Repository) GetAftermarketDevices(ctx context.Context, first *int, after *string, last *int, before *string, ...) (*gmodel.AftermarketDeviceConnection, error)
- func (r *Repository) GetDCN(ctx context.Context, by gmodel.DCNBy) (*gmodel.Dcn, error)
- func (r *Repository) GetDCNByName(ctx context.Context, name string) (*gmodel.Dcn, error)
- func (r *Repository) GetDCNByNode(ctx context.Context, node []byte) (*gmodel.Dcn, error)
- func (r *Repository) GetDCNs(ctx context.Context, first *int, after *string, last *int, before *string, ...) (*gmodel.DCNConnection, error)
- func (r *Repository) GetEarningsByAfterMarketDeviceID(ctx context.Context, tokenID int) (*gmodel.AftermarketDeviceEarnings, error)
- func (r *Repository) GetEarningsByUserAddress(ctx context.Context, user common.Address) (*gmodel.UserRewards, error)
- func (r *Repository) GetEarningsByVehicleID(ctx context.Context, tokenID int) (*gmodel.VehicleEarnings, error)
- func (r *Repository) GetEarningsSummary(ctx context.Context, conditions []qm.QueryMod) (*EarningsSummary, error)
- func (r *Repository) GetManufacturer(ctx context.Context, id int) (*gmodel.Manufacturer, error)
- func (p *Repository) GetPrivilegesForVehicle(ctx context.Context, tokenID int, first *int, after *string, last *int, ...) (*gmodel.PrivilegesConnection, error)
- func (r *Repository) GetVehicle(ctx context.Context, id int) (*gmodel.Vehicle, error)
- func (v *Repository) GetVehicles(ctx context.Context, first *int, after *string, last *int, before *string, ...) (*gmodel.VehicleConnection, error)
- func (r *Repository) PaginateAftermarketDeviceEarningsByID(ctx context.Context, ...) (*gmodel.EarningsConnection, error)
- func (r *Repository) PaginateGetEarningsByUsersDevices(ctx context.Context, userDeviceEarnings *gmodel.UserRewards, first *int, ...) (*gmodel.EarningsConnection, error)
- func (r *Repository) PaginateVehicleEarningsByID(ctx context.Context, vehicleEarnings *gmodel.VehicleEarnings, first *int, ...) (*gmodel.EarningsConnection, error)
- type RewardsCursor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AftermarketDeviceToAPI ¶
func AftermarketDeviceToAPI(d *models.AftermarketDevice, imageUrl string) *gmodel.AftermarketDevice
func ManufacturerIDToToken ¶
func ManufacturerToAPI ¶
func ManufacturerToAPI(m *models.Manufacturer) *gmodel.Manufacturer
func SyntheticDeviceToAPI ¶
func SyntheticDeviceToAPI(sd *models.SyntheticDevice) *gmodel.SyntheticDevice
func VehicleIDToToken ¶
Types ¶
type EarningsSummary ¶ added in v0.1.9
type EarningsSummary struct { TokenSum types.NullDecimal `boil:"token_sum"` TotalCount int `boil:"total_count"` }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func (*Repository) GetAftermarketDevice ¶
func (r *Repository) GetAftermarketDevice(ctx context.Context, by gmodel.AftermarketDeviceBy) (*gmodel.AftermarketDevice, error)
func (*Repository) GetAftermarketDevices ¶
func (r *Repository) GetAftermarketDevices(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *gmodel.AftermarketDevicesFilter) (*gmodel.AftermarketDeviceConnection, error)
GetOwnedAftermarketDevices godoc @Description gets aftermarket devices for an owner address @Param addr common.Address "eth address of owner" @Param first [*int] "the number of devices to return per page" @Param after [*string] "base64 string representing a device tokenID. This is a pointer to where we start fetching devices from on each page" @Param last [*int] "the number of devices to return from previous pages" @Param before [*string] "base64 string representing a device tokenID. Pointer to where we start fetching devices from previous pages"
func (*Repository) GetDCNByName ¶
func (*Repository) GetDCNByNode ¶
func (*Repository) GetEarningsByAfterMarketDeviceID ¶ added in v0.1.9
func (r *Repository) GetEarningsByAfterMarketDeviceID(ctx context.Context, tokenID int) (*gmodel.AftermarketDeviceEarnings, error)
func (*Repository) GetEarningsByUserAddress ¶ added in v0.1.10
func (r *Repository) GetEarningsByUserAddress(ctx context.Context, user common.Address) (*gmodel.UserRewards, error)
func (*Repository) GetEarningsByVehicleID ¶ added in v0.1.7
func (r *Repository) GetEarningsByVehicleID(ctx context.Context, tokenID int) (*gmodel.VehicleEarnings, error)
func (*Repository) GetEarningsSummary ¶ added in v0.1.9
func (r *Repository) GetEarningsSummary(ctx context.Context, conditions []qm.QueryMod) (*EarningsSummary, error)
func (*Repository) GetManufacturer ¶
func (r *Repository) GetManufacturer(ctx context.Context, id int) (*gmodel.Manufacturer, error)
func (*Repository) GetPrivilegesForVehicle ¶
func (p *Repository) GetPrivilegesForVehicle(ctx context.Context, tokenID int, first *int, after *string, last *int, before *string, filterBy *gmodel.PrivilegeFilterBy) (*gmodel.PrivilegesConnection, error)
func (*Repository) GetVehicle ¶
func (*Repository) GetVehicles ¶
func (v *Repository) GetVehicles(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *gmodel.VehiclesFilter) (*gmodel.VehicleConnection, error)
GetVehicles godoc @Description gets devices for an owner address @Param addr common.Address "eth address of owner" @Param first [*int] "the number of devices to return per page" @Param after [*string] "base64 string representing a device tokenID. This is a pointer to where we start fetching devices from on each page" @Param last [*int] "the number of devices to return from previous pages" @Param before [*string] "base64 string representing a device tokenID. Pointer to where we start fetching devices from previous pages"
func (*Repository) PaginateAftermarketDeviceEarningsByID ¶ added in v0.1.9
func (r *Repository) PaginateAftermarketDeviceEarningsByID(ctx context.Context, afterMarketDeviceEarnings *gmodel.AftermarketDeviceEarnings, first *int, after *string, last *int, before *string) (*gmodel.EarningsConnection, error)
func (*Repository) PaginateGetEarningsByUsersDevices ¶ added in v0.1.10
func (r *Repository) PaginateGetEarningsByUsersDevices(ctx context.Context, userDeviceEarnings *gmodel.UserRewards, first *int, after *string, last *int, before *string) (*gmodel.EarningsConnection, error)
func (*Repository) PaginateVehicleEarningsByID ¶ added in v0.1.7
func (r *Repository) PaginateVehicleEarningsByID(ctx context.Context, vehicleEarnings *gmodel.VehicleEarnings, first *int, after *string, last *int, before *string) (*gmodel.EarningsConnection, error)