repository

package
v0.0.0-...-bceaf69 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	DB *gorm.DB
}

func NewArticle

func NewArticle(db *gorm.DB) *Article

func (*Article) Create

func (r *Article) Create(ctx context.Context, article *model.Article) (*model.Article, error)

func (*Article) Delete

func (r *Article) Delete(ctx context.Context, id uint) error

func (*Article) GetByID

func (r *Article) GetByID(ctx context.Context, id uint) (*model.Article, error)

func (*Article) GetBySlug

func (r *Article) GetBySlug(ctx context.Context, slug string) (*model.Article, error)

func (*Article) Index

func (r *Article) Index(ctx context.Context, request *filter.Request) (*database.Paginator[*model.Article], error)

func (*Article) IsOwner

func (r *Article) IsOwner(ctx context.Context, resourceID, ownerID uint) (bool, error)

func (*Article) Update

func (r *Article) Update(ctx context.Context, article *model.Article) (*model.Article, error)

type User

type User struct {
	DB *gorm.DB
}

func NewUser

func NewUser(db *gorm.DB) *User

func (*User) Create

func (r *User) Create(ctx context.Context, user *model.User) (*model.User, error)

func (*User) GetByEmail

func (r *User) GetByEmail(ctx context.Context, email string) (*model.User, error)

func (*User) GetByID

func (r *User) GetByID(ctx context.Context, id uint) (*model.User, error)

func (*User) UniqueScope

func (r *User) UniqueScope() func(db *gorm.DB, val any) *gorm.DB

func (*User) Update

func (r *User) Update(ctx context.Context, user *model.User) (*model.User, error)

Jump to

Keyboard shortcuts

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