user

package
v0.0.0-...-fddf900 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 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 given record from the database

Types

type User

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

User holds data for a single user

func All

func All() ([]User, error)

All retrieves all users from the database

func One

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

One returns a single user record from the database

func (*User) Save

func (u *User) Save() error

Save updates or creates a given record in the database

Jump to

Keyboard shortcuts

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