db

package
v0.0.0-...-41a9250 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminRepositoryImpl

type AdminRepositoryImpl struct {
	DB *gorm.DB
}

func (*AdminRepositoryImpl) Create

func (r *AdminRepositoryImpl) Create(admin *domain.Admin) error

Create adds a new admin to the database.

func (*AdminRepositoryImpl) ExistsByAuth0UUID

func (r *AdminRepositoryImpl) ExistsByAuth0UUID(auth0UUID string) (bool, error)

ExistsByAuth0UUID checks if an admin with the given Auth0 UUID exists.

func (*AdminRepositoryImpl) FindByAuth0UUID

func (r *AdminRepositoryImpl) FindByAuth0UUID(auth0UUID string) (*domain.Admin, error)

FindByAuth0UUID retrieves an admin by its Auth0 UUID.

func (*AdminRepositoryImpl) Update

func (r *AdminRepositoryImpl) Update(admin *domain.Admin) error

Update modifies an existing admin.

type Esp32DeviceRepositoryImpl

type Esp32DeviceRepositoryImpl struct {
	DB *gorm.DB
}

func (*Esp32DeviceRepositoryImpl) Create

func (*Esp32DeviceRepositoryImpl) Delete

func (r *Esp32DeviceRepositoryImpl) Delete(id uint64) error

func (*Esp32DeviceRepositoryImpl) GetByDeviceIdentifier

func (r *Esp32DeviceRepositoryImpl) GetByDeviceIdentifier(identifier string) (*domain.Esp32Device, error)

func (*Esp32DeviceRepositoryImpl) GetByID

func (*Esp32DeviceRepositoryImpl) ListAll

func (*Esp32DeviceRepositoryImpl) ListByDeviceIdentifier

func (r *Esp32DeviceRepositoryImpl) ListByDeviceIdentifier(identifier string) ([]domain.Esp32Device, error)

func (*Esp32DeviceRepositoryImpl) Update

type ParkingLotRepositoryImpl

type ParkingLotRepositoryImpl struct {
	DB *gorm.DB
}

func (*ParkingLotRepositoryImpl) Create

func (r *ParkingLotRepositoryImpl) Create(parkingLot *domain.ParkingLot) error

Create adds a new parking lot to the database.

func (*ParkingLotRepositoryImpl) Delete

func (r *ParkingLotRepositoryImpl) Delete(id uint) error

Delete removes a parking lot by its ID.

func (*ParkingLotRepositoryImpl) DeleteWithAdmin

func (r *ParkingLotRepositoryImpl) DeleteWithAdmin(parkingLotID uint, adminID uint) error

DeleteWithAdmin removes a parking lot after verifying ownership.

func (*ParkingLotRepositoryImpl) FindByAdminID

func (r *ParkingLotRepositoryImpl) FindByAdminID(adminID uint) ([]domain.ParkingLot, error)

FindByAdminID retrieves all parking lots associated with a specific admin.

func (*ParkingLotRepositoryImpl) GetByID

GetByID retrieves a parking lot by its ID.

func (*ParkingLotRepositoryImpl) GetByIDWithAdmin

func (r *ParkingLotRepositoryImpl) GetByIDWithAdmin(parkingLotID uint, adminID uint) (*domain.ParkingLot, error)

GetByIDWithAdmin retrieves a parking lot by ID and verifies ownership.

func (*ParkingLotRepositoryImpl) List

List retrieves all parking lots from the database.

func (*ParkingLotRepositoryImpl) Update

func (r *ParkingLotRepositoryImpl) Update(parkingLot *domain.ParkingLot) error

Update modifies an existing parking lot.

type SensorRepositoryImpl

type SensorRepositoryImpl struct {
	DB *gorm.DB
}

func (*SensorRepositoryImpl) Create

func (r *SensorRepositoryImpl) Create(sensor *domain.Sensor) error

func (*SensorRepositoryImpl) Delete

func (r *SensorRepositoryImpl) Delete(id uint) error

func (*SensorRepositoryImpl) GetByDeviceAndNumber

func (r *SensorRepositoryImpl) GetByDeviceAndNumber(deviceIdentifier string, sensorNumber int) (*domain.Sensor, error)

func (*SensorRepositoryImpl) GetByID

func (r *SensorRepositoryImpl) GetByID(id uint) (*domain.Sensor, error)

func (*SensorRepositoryImpl) ListByEsp32DeviceID

func (r *SensorRepositoryImpl) ListByEsp32DeviceID(esp32DeviceID uint64) ([]domain.Sensor, error)

func (*SensorRepositoryImpl) ListByParkingLot

func (r *SensorRepositoryImpl) ListByParkingLot(parkingLotID uint) ([]domain.Sensor, error)

func (*SensorRepositoryImpl) ListGroupedByParkingLot

func (r *SensorRepositoryImpl) ListGroupedByParkingLot() (map[uint]uint, error)

func (*SensorRepositoryImpl) Update

func (r *SensorRepositoryImpl) Update(sensor *domain.Sensor) error

type UserRepositoryImpl

type UserRepositoryImpl struct {
	DB *gorm.DB
}

func (*UserRepositoryImpl) Create

func (r *UserRepositoryImpl) Create(user *domain.User) error

func (*UserRepositoryImpl) Delete

func (r *UserRepositoryImpl) Delete(id uint) error

func (*UserRepositoryImpl) FindByID

func (r *UserRepositoryImpl) FindByID(id uint) (*domain.User, error)

func (*UserRepositoryImpl) FindByUserName

func (r *UserRepositoryImpl) FindByUserName(username string) (*domain.User, error)

func (*UserRepositoryImpl) Update

func (r *UserRepositoryImpl) Update(user *domain.User) error

Jump to

Keyboard shortcuts

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