user

package
v0.0.0-...-93edab6 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecordInvalid = errors.New("record is invalid")
)

errors

Functions

func Delete

func Delete(id bson.ObjectId) error

Delete removes a specified user from the database

Types

type User

type User struct {
	ID   bson.ObjectId `json:"id" storm:"id"`
	Name string        `json:"name"`
	Role string        `json:"role"`
}

A User is a user of this sytem

func All

func All() ([]User, error)

All gets all users from the database

func One

func One(id bson.ObjectId) (*User, error)

One gets one user specified by the id from the database

func (*User) Save

func (u *User) Save() error

Save updates or creates a given user in the database

Jump to

Keyboard shortcuts

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