repository

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserRepo

type UserRepo interface {
	// CreateUser creates a new user
	CreateUser(user *models.User) error
	// GetUserByID returns a user by id
	GetUser(id int) (models.User, error)
	// GetUsers returns all users
	GetUsers() ([]models.User, error)
	// GetUserByUsername returns a user by username
	GetUserByUsername(username string) (models.User, error)
	// GetUserByEmail returns a user by email
	GetUserByEmail(email string) (models.User, error)
	// UpdateUser updates an existing user
	UpdateUser(user *models.User) error
	// DeleteUser deletes an existing user
	DeleteUser(id uint) error
}

UserRepo is a repository for users

func NewUserRepo

func NewUserRepo(db *gorm.DB) UserRepo

NewUserRepo initializes a new user repository

Jump to

Keyboard shortcuts

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