db

package
v0.0.0-...-39e761b Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DbPath = "item.db"
View Source
const ItemBucket = "item"

Variables

This section is empty.

Functions

func Close

func Close()

func Delete

func Delete(id string) error

func Open

func Open()

Types

type Item

type Item struct {
	ID          string `json:"id"`
	Image       string `json:"image"`
	Name        string `json:"name"`
	Price       int    `json:"price"`
	Description string `json:"description"`
	InStock     int    `json:"in_stock"`
}

func GetItem

func GetItem(id string) (*Item, error)

func List

func List(bucket string) []*Item

func (*Item) GenerateUniqueId

func (i *Item) GenerateUniqueId()

func (Item) Save

func (i Item) Save() error

Jump to

Keyboard shortcuts

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