repositories

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostRepository

type PostRepository struct {
	DB gorm.DB
}

func NewPostRepository

func NewPostRepository() PostRepository

func (*PostRepository) CreatePost

func (pr *PostRepository) CreatePost(post *models.Post) error

func (*PostRepository) FindPostsByUserId

func (pr *PostRepository) FindPostsByUserId(userId uint) (*[]models.Post, error)

type UserRepository

type UserRepository struct {
	DB gorm.DB
}

func NewUserRepository

func NewUserRepository() UserRepository

func (*UserRepository) CreateUser

func (ur *UserRepository) CreateUser(user *models.User) error

func (*UserRepository) FindByEmail

func (ur *UserRepository) FindByEmail(email string) (*models.User, error)

func (*UserRepository) FindUserById

func (ur *UserRepository) FindUserById(id uint64) (*models.User, error)

Jump to

Keyboard shortcuts

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