repository

package
v0.0.0-...-d6508de Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthRepo

func NewAuthRepo(db *gorm.DB) *authRepo

func NewCategoryRepo

func NewCategoryRepo(db *gorm.DB) *categoryRepo

func NewCommentRepo

func NewCommentRepo(db *gorm.DB) *commentRepo

func NewPostRepo

func NewPostRepo(db *gorm.DB) *postRepo

Types

type AuthRepo

type AuthRepo interface {
	Register(user model.User) (*gorm.DB, model.User)
	FindByEmail(email string) (*gorm.DB, model.User)
}

type CategoryRepo

type CategoryRepo interface {
	AllCategories() []model.Category
	Insert(category model.Category) model.Category
	GetById(categoryId uint64) (model.Category, error)
	Save(category *model.Category)
	DeleteById(categoryId uint64) *gorm.DB
}

type CommentRepo

type CommentRepo interface {
	AllCommentByPostId(limit string, offset string, postId uint) []model.Comment
	Insert(comment model.Comment) model.Comment
}

type PostRepo

type PostRepo interface {
	PostCount() int64
	AllPost(limit string, offset string) []model.Post
	FindByIdWithCategory(postId uint64) (model.Post, error)
	FindById(postId uint64) (model.Post, error)
	Insert(post model.Post) model.Post
	Save(post *model.Post) *gorm.DB
	DeleteById(postId uint64) *gorm.DB
}

Jump to

Keyboard shortcuts

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