user_repository

package
v0.0.0-...-0eeeb36 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IUserRepository

type IUserRepository interface {
	Get(int64) (*user_model.User, error)
	GetByEmail(string) (*user_model.User, error)
	GetAll() (*[]user_model.User, error)
	Add(*user_model.User) error
	Update(int64, *user_model.User) error
	UpdatePassword(int64, string) error
	Delete(int64) error
	SetEnabled(int64, bool) error
}

type UserRepository

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

func DefaultUserRepository

func DefaultUserRepository(dbx *sqlx.DB) *UserRepository

func (*UserRepository) Add

func (ur *UserRepository) Add(user *user_model.User) error

func (*UserRepository) Delete

func (ur *UserRepository) Delete(id int64) error

func (*UserRepository) Get

func (ur *UserRepository) Get(id int64) (*user_model.User, error)

get user by id

func (*UserRepository) GetAll

func (ur *UserRepository) GetAll() (*[]user_model.User, error)

get a list of all users

func (*UserRepository) GetByEmail

func (ur *UserRepository) GetByEmail(email string) (*user_model.User, error)

get user by email

func (*UserRepository) SetEnabled

func (ur *UserRepository) SetEnabled(id int64, enabled bool) error

func (*UserRepository) Update

func (ur *UserRepository) Update(id int64, user *user_model.User) error

func (*UserRepository) UpdatePassword

func (ur *UserRepository) UpdatePassword(id int64, hash string) error

Jump to

Keyboard shortcuts

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