repositories

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AftermarketDeviceIDToToken

func AftermarketDeviceIDToToken(id string) (int, error)

func DCNToAPI

func DCNToAPI(d *models.DCN) *gmodel.Dcn

func ManufacturerIDToToken

func ManufacturerIDToToken(id string) (int, error)

func ManufacturerToAPI

func ManufacturerToAPI(m *models.Manufacturer) *gmodel.Manufacturer

func SyntheticDeviceToAPI

func SyntheticDeviceToAPI(sd *models.SyntheticDevice) *gmodel.SyntheticDevice

func VehicleIDToToken

func VehicleIDToToken(id string) (int, error)

func VehicleToAPI

func VehicleToAPI(v *models.Vehicle) *gmodel.Vehicle

Types

type PrivilegeCursor

type PrivilegeCursor struct {
	SetAt       time.Time
	PrivilegeID int
	User        []byte
}

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func New

func New(pdb db.Store) *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) GetDCN

func (r *Repository) GetDCN(ctx context.Context, by gmodel.DCNBy) (*gmodel.Dcn, error)

func (*Repository) GetDCNByName

func (r *Repository) GetDCNByName(ctx context.Context, name string) (*gmodel.Dcn, error)

func (*Repository) GetDCNByNode

func (r *Repository) GetDCNByNode(ctx context.Context, node []byte) (*gmodel.Dcn, 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) (*gmodel.PrivilegesConnection, error)

func (*Repository) GetVehicle

func (r *Repository) GetVehicle(ctx context.Context, id int) (*gmodel.Vehicle, error)

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"

Jump to

Keyboard shortcuts

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