repository

package
v0.0.0-...-ff7f6f1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func Connect

func Connect() (*gorm.DB, error)

Types

type CourierRepository

type CourierRepository interface {
	Add(couriers []models.Courier) ([]models.Courier, error)
	Save(courier models.Courier) (uint, error)
	Update(models.Courier) error
	Delete(models.Courier) error
	FindAll(offset int, limit int) []*models.Courier
	FindByID(courierID uint) (*models.Courier, error)
	DeleteByID(courierID uint) error
	FindByName(name string) (*models.Courier, error)
	FindByField(fieldName, fieldValue string) (*models.Courier, error)
	UpdateSingleField(courier models.Courier, fieldName, fieldValue string) error
}

func NewCourierRepository

func NewCourierRepository() CourierRepository

type OrderRepository

type OrderRepository interface {
	FindAllBy(data map[uint][]uint) []*models.Order
	FindCompleteByCourierId(courierID uint) []*models.Order
	Add(orders []models.Order) ([]models.Order, error)
	Save(order models.Order) (uint, error)
	Update(models.Order) error
	Delete(models.Order) error
	FindAll(offset int, limit int) []*models.Order
	FindAllAssign(offset int, limit int) []models.Order
	FindByID(orderID uint) (*models.Order, error)
	DeleteByID(orderID uint) error
	FindByName(name string) (*models.Order, error)
	FindByField(fieldName, fieldValue string) (*models.Order, error)
	UpdateSingleField(order models.Order, fieldName, fieldValue string) error
}

func NewOrderRepository

func NewOrderRepository() OrderRepository

type TypeDatabase

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

func (TypeDatabase) Delete

func (db TypeDatabase) Delete(Type models.Type) error

func (TypeDatabase) DeleteByID

func (db TypeDatabase) DeleteByID(TypeID string) error

func (TypeDatabase) FindAll

func (db TypeDatabase) FindAll() []*models.Type

func (TypeDatabase) FindByField

func (db TypeDatabase) FindByField(fieldName, fieldValue string) (*models.Type, error)

func (TypeDatabase) FindByID

func (db TypeDatabase) FindByID(TypeID uint) (*models.Type, error)

func (TypeDatabase) FindByName

func (db TypeDatabase) FindByName(name string) (*models.Type, error)

func (TypeDatabase) Save

func (db TypeDatabase) Save(Type models.Type) (string, error)

func (TypeDatabase) Update

func (db TypeDatabase) Update(Type models.Type) error

func (TypeDatabase) UpdateSingleField

func (db TypeDatabase) UpdateSingleField(Type models.Type, fieldName, fieldValue string) error

type TypeRepository

type TypeRepository interface {
	Save(Type models.Type) (string, error)
	Update(models.Type) error
	Delete(models.Type) error
	FindAll() []*models.Type
	FindByID(TypeID uint) (*models.Type, error)
	DeleteByID(TypeID string) error
	FindByName(name string) (*models.Type, error)
	FindByField(fieldName, fieldValue string) (*models.Type, error)
	UpdateSingleField(Type models.Type, fieldName, fieldValue string) error
}

func NewTypeRepository

func NewTypeRepository() TypeRepository

Jump to

Keyboard shortcuts

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