database

package
v0.0.0-...-3edba42 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGormDB

func NewGormDB(dns string) (*gorm.DB, error)

Types

type AuthGormService

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

func NewAuthGormService

func NewAuthGormService(db *gorm.DB) *AuthGormService

func (*AuthGormService) CreateUserRecord

func (service *AuthGormService) CreateUserRecord(user *models.User) error

func (*AuthGormService) GetAllUsers

func (service *AuthGormService) GetAllUsers() ([]models.User, error)

func (*AuthGormService) GetUserByEmail

func (service *AuthGormService) GetUserByEmail(email string) (*models.User, error)

type AuthService

type AuthService interface {
	CreateUserRecord(user *models.User) error
	GetUserByEmail(email string) (*models.User, error)

	// just for debug
	GetAllUsers() ([]models.User, error)
}

type CategoryGormService

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

func NewCategoryGormService

func NewCategoryGormService(db *gorm.DB) *CategoryGormService

func (*CategoryGormService) CreateCategoryRecord

func (service *CategoryGormService) CreateCategoryRecord(category *models.Category) error

func (*CategoryGormService) DeleteCategoryRecordById

func (service *CategoryGormService) DeleteCategoryRecordById(id uint) error

func (*CategoryGormService) GetAllCategories

func (service *CategoryGormService) GetAllCategories() ([]models.Category, error)

func (*CategoryGormService) GetCategoryById

func (service *CategoryGormService) GetCategoryById(id uint) (*models.Category, error)

func (*CategoryGormService) UpdateCategoryRecord

func (service *CategoryGormService) UpdateCategoryRecord(category *models.Category) error

type CategoryNotFoundError

type CategoryNotFoundError struct{}

func (*CategoryNotFoundError) Error

func (e *CategoryNotFoundError) Error() string

type CategoryService

type CategoryService interface {
	GetAllCategories() ([]models.Category, error)
	GetCategoryById(id uint) (*models.Category, error)
	CreateCategoryRecord(category *models.Category) error
	UpdateCategoryRecord(category *models.Category) error
	DeleteCategoryRecordById(id uint) error
}

Jump to

Keyboard shortcuts

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