user

package
v0.0.0-...-3664479 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

errors

Functions

func Delete

func Delete(id bson.ObjectId) error

Delete removes a given record from databse

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 database

func One

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

One retrieves a single user record from database

func (*User) Save

func (user *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