user

package
v0.0.0-...-974506c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

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

Datastore implements the Repository interface

func NewDatastore

func NewDatastore(db *sql.DB) *Datastore

NewDatastore constructs a new Repository

func (*Datastore) Create

func (ds *Datastore) Create(usr *User) error

Create a new user

func (*Datastore) Show

func (ds *Datastore) Show(usr *User) error

Show a user

func (*Datastore) Valid

func (ds *Datastore) Valid(usr *User) error

Valid checks the validity of the user

type Repository

type Repository interface {
	Create(usr *User) error
	Valid(usr *User) error
	Show(usr *User) error
}

Repository helps to manage users

type User

type User struct {
	ID                    string `jsonapi:"primary,users"`
	Username              string `jsonapi:"attr,username"`
	Name                  string `jsonapi:"attr,name"`
	Email                 string `jsonapi:"attr,email"`
	Role                  string `jsonapi:"attr,role"`
	Active                bool   `jsonapi:"attr,active"`
	EmailVerified         bool   `jsonapi:"attr,email_verified"`
	EmailVerificationCode string `jsonapi:"attr,email_verification_code,omitempty"`
	Password              string `jsonapi:"attr,password,omitempty"`
	PersonalNote          string `jsonapi:"attr,personal_note,omitempty"`
}

User represents a user

Jump to

Keyboard shortcuts

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