Documentation ¶
Index ¶
- Constants
- func GetAftermarketDeviceImageURL(baseURL string, tokenID int) (string, error)
- func IDToToken(b []byte) (int, error)
- func ToAPI(d *models.AftermarketDevice, imageURL string) (*gmodel.AftermarketDevice, error)
- 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) GetAftermarketDevicesForManufacturer(ctx context.Context, obj *model.Manufacturer, first *int, after *string, ...) (*gmodel.AftermarketDeviceConnection, error)
Constants ¶
const TokenPrefix = "AD"
TokenPrefix is the prefix for a global token id for aftermarket devices.
Variables ¶
This section is empty.
Functions ¶
func GetAftermarketDeviceImageURL ¶ added in v0.1.24
func ToAPI ¶ added in v0.1.20
func ToAPI(d *models.AftermarketDevice, imageURL string) (*gmodel.AftermarketDevice, error)
ToAPI converts an aftermarket device to a corresponding API aftermarket device.
Types ¶
type Repository ¶
type Repository struct {
*base.Repository
}
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) GetAftermarketDevicesForManufacturer ¶
func (r *Repository) GetAftermarketDevicesForManufacturer(ctx context.Context, obj *model.Manufacturer, first *int, after *string, last *int, before *string, filterBy *model.AftermarketDevicesFilter) (*gmodel.AftermarketDeviceConnection, error)