persistence

package
v0.0.0-...-327d889 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func (*DB) CheckUser

func (db *DB) CheckUser(name string, passwordHash string) (string, error)

func (*DB) ContainsUsername

func (db *DB) ContainsUsername(name string) bool

func (*DB) CreateIngredient

func (db *DB) CreateIngredient(ingredient model.Ingredient) error

func (*DB) CreateRecipe

func (db *DB) CreateRecipe(recipe model.Recipe) error

func (*DB) CreateTag

func (db *DB) CreateTag(tag model.Tag) error

func (*DB) CreateUser

func (db *DB) CreateUser(user model.User) error

func (*DB) DeleteRecipe

func (db *DB) DeleteRecipe(id string) (int, error)

func (*DB) GetAllIngredients

func (db *DB) GetAllIngredients() ([]model.Ingredient, error)

func (*DB) GetAllRecipes

func (db *DB) GetAllRecipes() ([]model.Recipe, error)

func (*DB) GetAllTags

func (db *DB) GetAllTags() ([]model.Tag, error)

func (*DB) GetSingleRecipe

func (db *DB) GetSingleRecipe(id string) (model.Recipe, error)

func (*DB) GetUserById

func (db *DB) GetUserById(id string) (model.User, error)

func (*DB) Open

func (db *DB) Open(uri string) error

func (*DB) QueryTest

func (db *DB) QueryTest(id int) (model.Test, error)

func (*DB) ReplaceRecipe

func (db *DB) ReplaceRecipe(recipe model.Recipe) (int, error)

func (*DB) Setup

func (db *DB) Setup()

type DBError

type DBError struct {
	// contains filtered or unexported fields
}

func (DBError) Error

func (err DBError) Error() string

type Persistence

type Persistence interface {
	Open(uri string) error
	Setup() error
	QueryTest(id int) model.Test

	CreateUser(user model.User) error
	CheckUser(name string, passwordHash string) (string, error)
	ContainsUsername(name string) bool
	GetUserById(id string) (model.User, error)
}

Jump to

Keyboard shortcuts

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