database

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Doughs []pizza.Dough `json:"doughs"`

	// Ingredients
	OliveOils   []pizza.Ingredient `json:"olive_oils"`
	Tomatoes    []pizza.Ingredient `json:"tomatoes"`
	Mozzarellas []pizza.Ingredient `json:"mozzarellas"`
	Toppings    []pizza.Ingredient `json:"toppings"`

	// Important stuff
	Tools []string `json:"tools"`

	// Naming
	Adjectives   []string `json:"adjectives"`
	ClassicNames []string `json:"classic_names"`

	// Quotes
	Quotes []string `json:"quotes"`
}

type InMemoryDatabase

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

func (*InMemoryDatabase) History

func (db *InMemoryDatabase) History() []pizza.Pizza

func (*InMemoryDatabase) PersistToFile

func (d *InMemoryDatabase) PersistToFile(path string) error

func (*InMemoryDatabase) PopulateFromFile

func (db *InMemoryDatabase) PopulateFromFile(path string) error

func (*InMemoryDatabase) SetLatestPizza

func (db *InMemoryDatabase) SetLatestPizza(pizza pizza.Pizza)

func (*InMemoryDatabase) Transaction

func (db *InMemoryDatabase) Transaction(readF func(data Data))

Transaction provides a thread-safe, read-only view of the data in the database.

Jump to

Keyboard shortcuts

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