store

package
v0.0.0-...-e4b16ce Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(user *model.User) (string, error)

CreateUser creates and saves a new user to the database returns the newly created users db id

func GetUser

func GetUser(id string) (*model.User, error)

GetUser gets a user by the given id from the database

func GetUsers

func GetUsers() (*[]model.User, error)

GetUsers returns all users from the database

func SaveUser

func SaveUser(user *model.User) error

SaveUser saves the user to the database

Types

type Store

type Store struct {
	Users UserStore `inject:""`
}

Store interface for all of the supported model Stores

func Load

func Load() *Store

Load return a store implenetation

type UserStore

type UserStore interface {
	Get(string) (*model.User, error)
	GetAll() (*[]model.User, error)
	Create(*model.User) (string, error)
	Save(*model.User) error
}

UserStore users related operations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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