users

package
v0.0.0-...-5b64ff3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profile

type Profile struct {
	Handle string `json:"handle"`
	Name   string `json:"name"`
}

Profile for user.

type ProfileUpdate

type ProfileUpdate struct {
	Handle   string `json:"handle"`
	Name     string `json:"name"`
	Password string `json:"password"`
}

ProfileUpdate for user.

type User

type User struct {
	Handle   string `json:"handle"`
	Name     string `json:"name"`
	Password string `db:"hash"`
	Salt     string `db:"salt"`
}

User row.

type Users

type Users interface {
	// Add new User to Database.
	Add(*User) error

	// Get all user info by handle.
	Get(string) (*User, error)

	// GetProfile by handle.
	GetProfile(string) (*Profile, error)

	// UpdateProfile for user with given handle
	UpdateProfile(string, *User) error
}

Users service.

func NewUsers

func NewUsers(db *sqlx.DB) Users

NewUsers returns new instance of the Users interface.

Jump to

Keyboard shortcuts

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