webuser

package
v0.0.0-...-da9a50a Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("User not found")

ErrNotFound error trown when user is not found

Functions

This section is empty.

Types

type User

type User struct {
	ID       int64  `json:"id"`
	UUID     string `json:"uuid"`
	Name     string `json:"name,omitempty"`
	Email    string `json:"email,omitempty"`
	Password string `json:"password,omitempty"`
	Hint     string `json:"hint"`
}

User struct defines a user

type WebUser

type WebUser interface {
	Get(id int64) (User, error)
	GetByEmail(email string) (User, error)
	Add(c User) error
	Update(c User) error
	DeleteUser(UserID int64) error
	ListUsers(page int, pageNum int) func() (User, error)
}

WebUser interface for user db interaction

func Open

func Open(db *sql.DB) (i WebUser, err error)

Open returns a WebUser interface (db interaction)

Jump to

Keyboard shortcuts

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