db

package
v0.0.0-...-4efb1cb Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inventory

type Inventory struct {
	ID        int    `storm:"id,increment"`
	UserID    int    `storm:"index"`
	Name      string `storm:"index"`
	Items     []Item
	IsDeleted bool
}

type InventoryRepoer

type InventoryRepoer interface {
	GetByID(id int) (*Inventory, error)
	GetByUserID(userID int) ([]Inventory, error)
	GetByName(name string) ([]Inventory, error)
	GetAll() ([]Inventory, error)

	Upsert(inventory *Inventory) error

	Delete(id int) error
}

func NewInventoryRepo

func NewInventoryRepo(db *storm.DB) InventoryRepoer

type Item

type Item struct {
	Quantity int
	SKU      string
	Title    string
	Barcode  string
}

type User

type User struct {
	ID        int    `storm:"id,increment"`
	Email     string `storm:"unique"`
	Password  []byte
	IsAdmin   bool
	IsDeleted bool
}

type UserRepoer

type UserRepoer interface {
	GetByID(id int) (*User, error)
	GetByEmail(email string) (*User, error)
	GetAll() ([]User, error)

	Upsert(user *User) error
}

func NewUserRepo

func NewUserRepo(db *storm.DB) UserRepoer

Jump to

Keyboard shortcuts

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