db

package
v0.0.0-...-c660d8e Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCreateUser   = fmt.Errorf("database failed to create user")
	ErrDeleteUser   = fmt.Errorf("database failed to delete user")
	ErrUpdateUser   = fmt.Errorf("database failed to update user")
	ErrNoUserFound  = fmt.Errorf("database failed to get user")
	ErrNoUsersFound = fmt.Errorf("database failed to get users")
)

Functions

This section is empty.

Types

type CreateUserRequest

type CreateUserRequest struct {
	Name         string
	PasswordHash string
}

type DeleteUserRequest

type DeleteUserRequest struct {
	ID int64
}

type UpdateUserRequest

type UpdateUserRequest struct {
	ID      int64
	Updates User
}

type User

type User struct {
	ID           uint64    `db:"id"`
	Name         string    `db:"name"`
	PasswordHash string    `db:"password_hash"`
	CreatedOn    time.Time `db:"created_on"`
	LastEdited   time.Time `db:"last_edited"`
}

type UserDatabase

type UserDatabase struct {
	*otel.Tools
	// contains filtered or unexported fields
}

func NewUserDatabase

func NewUserDatabase() *UserDatabase

Jump to

Keyboard shortcuts

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