Documentation ¶
Index ¶
- Variables
- func ConnectDatabase(cfg DbConfig) (*sql.DB, error)
- type BandwidthSlot
- type BandwidthSlotStorage
- type BandwidthSlotStore
- func (s BandwidthSlotStore) Create(slot *BandwidthSlot) error
- func (s BandwidthSlotStore) Delete(id int) error
- func (s BandwidthSlotStore) DeleteByUserId(userId int) error
- func (s BandwidthSlotStore) Read(id int) (BandwidthSlot, error)
- func (s BandwidthSlotStore) ReadMany(pageSize, pageNumber int) ([]BandwidthSlot, error)
- func (s BandwidthSlotStore) ReadManyByUserId(userId int, pageSize, pageNumber int) ([]BandwidthSlot, error)
- type DbConfig
- type Device
- type DeviceStorage
- type DeviceStore
- func (d DeviceStore) Create(device *Device) error
- func (d DeviceStore) Delete(id int) error
- func (d DeviceStore) DeleteByUserId(userId int) error
- func (d DeviceStore) Read(id int) (Device, error)
- func (d DeviceStore) ReadMany(pageSize, pageNumber int) ([]Device, error)
- func (d DeviceStore) ReadManyByMac(macAddresses []string) ([]Device, error)
- func (d DeviceStore) ReadManyByUserId(userId int, pageSize, pageNumber int) ([]Device, error)
- func (d DeviceStore) Update(device Device) error
- type Store
- type User
- type UserStorage
- type UserStore
Constants ¶
This section is empty.
Variables ¶
View Source
var Q = sqload.MustLoadFromString[struct { InitDb string `query:"InitDb"` CreateUser string `query:"CreateUser"` GetUserById string `query:"GetUserById"` GetUsers string `query:"GetUsers"` GetDevicesByMac string `query:"GetDevicesByMac"` GetDeviceById string `query:"GetDeviceById"` GetDevices string `query:"GetDevices"` GetDevicesByUserId string `query:"GetDevicesByUserId"` UpdateUser string `query:"UpdateUser"` DeleteUserById string `query:"DeleteUserById"` CreateDevice string `query:"CreateDevice"` UpdateDevice string `query:"UpdateDevice"` DeleteDeviceById string `query:"DeleteDeviceById"` DeleteDeviceByUserId string `query:"DeleteDeviceByUserId"` CreateBandwidthSlot string `query:"CreateBandwidthSlot"` GetBandwidthSlotById string `query:"GetBandwidthSlotById"` GetBandwidthSlots string `query:"GetBandwidthSlots"` GetBandwidthSlotsByUserId string `query:"GetBandwidthSlotsByUserId"` DeleteBandwidthSlotById string `query:"DeleteBandwidthSlotById"` DeleteBandwidthSlotByUserId string `query:"DeleteBandwidthSlotByUserId"` }](dbScript)
Functions ¶
Types ¶
type BandwidthSlot ¶
type BandwidthSlotStorage ¶
type BandwidthSlotStorage interface { Create(slot *BandwidthSlot) error Read(id int) (BandwidthSlot, error) ReadMany(pageSize, pageNumber int) ([]BandwidthSlot, error) ReadManyByUserId(userId int, pageSize, pageNumber int) ([]BandwidthSlot, error) Delete(id int) error DeleteByUserId(userId int) error }
type BandwidthSlotStore ¶
type BandwidthSlotStore struct {
// contains filtered or unexported fields
}
func (BandwidthSlotStore) Create ¶
func (s BandwidthSlotStore) Create(slot *BandwidthSlot) error
func (BandwidthSlotStore) Delete ¶
func (s BandwidthSlotStore) Delete(id int) error
func (BandwidthSlotStore) DeleteByUserId ¶
func (s BandwidthSlotStore) DeleteByUserId(userId int) error
func (BandwidthSlotStore) Read ¶
func (s BandwidthSlotStore) Read(id int) (BandwidthSlot, error)
func (BandwidthSlotStore) ReadMany ¶
func (s BandwidthSlotStore) ReadMany(pageSize, pageNumber int) ([]BandwidthSlot, error)
func (BandwidthSlotStore) ReadManyByUserId ¶
func (s BandwidthSlotStore) ReadManyByUserId(userId int, pageSize, pageNumber int) ([]BandwidthSlot, error)
type Device ¶
type DeviceStorage ¶
type DeviceStorage interface { Create(device *Device) error Read(id int) (Device, error) ReadMany(pageSize, pageNumber int) ([]Device, error) ReadManyByUserId(userId int, pageSize, pageNumber int) ([]Device, error) ReadManyByMac(macAddress []string) ([]Device, error) Update(device Device) error Delete(id int) error DeleteByUserId(userId int) error }
type DeviceStore ¶
type DeviceStore struct {
// contains filtered or unexported fields
}
func (DeviceStore) Create ¶
func (d DeviceStore) Create(device *Device) error
func (DeviceStore) Delete ¶
func (d DeviceStore) Delete(id int) error
func (DeviceStore) DeleteByUserId ¶
func (d DeviceStore) DeleteByUserId(userId int) error
func (DeviceStore) ReadMany ¶
func (d DeviceStore) ReadMany(pageSize, pageNumber int) ([]Device, error)
func (DeviceStore) ReadManyByMac ¶
func (d DeviceStore) ReadManyByMac(macAddresses []string) ([]Device, error)
func (DeviceStore) ReadManyByUserId ¶
func (d DeviceStore) ReadManyByUserId(userId int, pageSize, pageNumber int) ([]Device, error)
func (DeviceStore) Update ¶
func (d DeviceStore) Update(device Device) error
type Store ¶
type Store struct { UserStore UserStorage DeviceStore DeviceStorage BandwidthSlotStore BandwidthSlotStorage }
type UserStorage ¶
Click to show internal directories.
Click to hide internal directories.