storage

package
v0.0.0-...-322d0ab Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package storage manages offline storage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Db *bolt.DB
}

Storage holds the database storage capability

func New

func New(dbPath string, names []string) (*Storage, error)

New returns a new storage object

func (*Storage) AddFood

func (s *Storage) AddFood(name string, food string) error

AddFood stores a new food for the names user

func (*Storage) Close

func (s *Storage) Close() error

Close shuts down the database

func (*Storage) GetFoods

func (s *Storage) GetFoods(name string) ([]string, error)

GetFoods returns the foods a named user likes

Jump to

Keyboard shortcuts

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