daomysql

package
v0.0.0-...-cec8117 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserRepoMysql

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

func NewUserRepoMysql

func NewUserRepoMysql(user, password, dbname string) *UserRepoMysql

func (*UserRepoMysql) Count

func (u *UserRepoMysql) Count() (int, error)

Count returns the count of users in DB

func (*UserRepoMysql) Create

func (u *UserRepoMysql) Create(user *model.User) (*model.User, error)

Create creates and returns new user with autogenerated ID

func (*UserRepoMysql) DeleteByID

func (u *UserRepoMysql) DeleteByID(id int) (*model.User, error)

DeleteById removes and returns user with specified ID or error otherwise

func (UserRepoMysql) FindAll

func (u UserRepoMysql) FindAll(start, count int) ([]model.User, error)

func (UserRepoMysql) FindByEmail

func (u UserRepoMysql) FindByEmail(email string) (*model.User, error)

func (*UserRepoMysql) FindByID

func (u *UserRepoMysql) FindByID(id int) (*model.User, error)

FindById return users by user ID or error otherwise

func (*UserRepoMysql) Update

func (u *UserRepoMysql) Update(user *model.User) (*model.User, error)

Update updates existing user data

Jump to

Keyboard shortcuts

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