store

package
v0.0.0-...-518fa3f Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LambdaFunctions

func LambdaFunctions(api *sparta.API) []*sparta.LambdaAWSInfo

Types

type Location

type Location struct {
	Address string
	City    string
	State   string
	Zip     string
}

type Store

type Store struct {
	PK       string
	SK       string
	Phone    string
	Name     string
	Location Location
}

func FromJSON

func FromJSON(jsonSrc string) (store *Store, err error)

func Get

func Get(phone string) (sto Store, err error)

func (*Store) Customers

func (s *Store) Customers() ([]customer.Customer, error)

func (*Store) Init

func (s *Store) Init()

func (*Store) MakePK

func (s *Store) MakePK() string

func (*Store) MakeSK

func (s *Store) MakeSK() string

func (*Store) Movies

func (s *Store) Movies(year int, title string) ([]StoreMovie, error)

Movies returns the store's inventory. The year and title can be used to constrain the results, but because we apply this constraint to the sort key, the year must be specified, and if title is specied, any movie titles with that prefix will be returned.

func (*Store) Put

func (s *Store) Put() error

func (Store) PutMovie

func (s Store) PutMovie(year int, title string, count int) error

type StoreMovie

type StoreMovie struct {
	PK    string
	SK    string
	Phone string // Pkey to Store
	Year  int    // Pkey to Movie
	Title string // Pkey to Movie
	Count int
}

StoreMovie represents the copies of a movie in a store's inventory.

func (StoreMovie) GetMovie

func (sm StoreMovie) GetMovie() (mov movie.Movie, err error)

func (*StoreMovie) Init

func (sm *StoreMovie) Init()

func (*StoreMovie) MakePK

func (sm *StoreMovie) MakePK() string

func (*StoreMovie) MakeSK

func (sm *StoreMovie) MakeSK() string

func (*StoreMovie) Put

func (sm *StoreMovie) Put() error

Jump to

Keyboard shortcuts

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