database

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGlobalOperationNotPermitted = errors.New("operation not permitted for default user")
View Source
var ErrUsernameTaken = errors.New("username already taken")

Functions

This section is empty.

Types

type Catalog added in v0.5.0

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

func NewCatalog added in v0.5.0

func NewCatalog(connString string) (*Catalog, error)

func (*Catalog) Authenticate added in v0.13.3

func (c *Catalog) Authenticate(ctx context.Context, token string) (*model.User, error)

Authenticate finds the corresponding user for token. If a user is not found, then a default user is returned, with ID 1. This is done in order to simplify the testing/usage of QuickPizza in general. This function will always return a user, unless it returns a non-nil error.

func (*Catalog) DeleteRating added in v0.13.3

func (c *Catalog) DeleteRating(ctx context.Context, user *model.User, ratingID int) error

func (*Catalog) DeleteRatings added in v0.13.4

func (c *Catalog) DeleteRatings(ctx context.Context, user *model.User) error

func (*Catalog) GetDoughs added in v0.5.0

func (c *Catalog) GetDoughs(ctx context.Context) ([]model.Dough, error)

func (*Catalog) GetHistory added in v0.5.0

func (c *Catalog) GetHistory(ctx context.Context, limit int) ([]model.Pizza, error)

func (*Catalog) GetIngredients added in v0.5.0

func (c *Catalog) GetIngredients(ctx context.Context, t string) ([]model.Ingredient, error)

func (*Catalog) GetRating added in v0.13.3

func (c *Catalog) GetRating(ctx context.Context, user *model.User, ratingID int) (*model.Rating, error)

func (*Catalog) GetRatings added in v0.13.3

func (c *Catalog) GetRatings(ctx context.Context, user *model.User) ([]*model.Rating, error)

func (*Catalog) GetRecommendation added in v0.12.1

func (c *Catalog) GetRecommendation(ctx context.Context, id int) (*model.Pizza, error)

func (*Catalog) GetTools added in v0.5.0

func (c *Catalog) GetTools(ctx context.Context) ([]string, error)

func (*Catalog) LoginUser added in v0.13.3

func (c *Catalog) LoginUser(ctx context.Context, username, passwordText string) (*model.User, error)

func (*Catalog) RecordRating added in v0.13.3

func (c *Catalog) RecordRating(ctx context.Context, rating *model.Rating) error

func (*Catalog) RecordRecommendation added in v0.5.0

func (c *Catalog) RecordRecommendation(ctx context.Context, pizza *model.Pizza) error

func (*Catalog) RecordUser added in v0.13.3

func (c *Catalog) RecordUser(ctx context.Context, user *model.User) error

func (*Catalog) UpdateRating added in v0.13.3

func (c *Catalog) UpdateRating(ctx context.Context, user *model.User, rating *model.Rating) (*model.Rating, error)

type Copy added in v0.5.0

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

func NewCopy added in v0.5.0

func NewCopy(connString string) (*Copy, error)

func (*Copy) GetAdjectives added in v0.5.0

func (c *Copy) GetAdjectives(ctx context.Context) ([]string, error)

func (*Copy) GetClassicalNames added in v0.5.0

func (c *Copy) GetClassicalNames(ctx context.Context) ([]string, error)

func (*Copy) GetQuotes added in v0.5.0

func (c *Copy) GetQuotes(ctx context.Context) ([]string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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