movie

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: 14 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 Info

type Info struct {
	Directors       []string
	ReleaseDate     time.Time `json:"release_date" dynamodbav:"ReleaseDate"`
	Rating          float64
	Genres          []string
	ImageURL        string `json:"image_url" dynamodbav:"ImageURL"`
	Plot            string
	Rank            int
	RunningTimeSecs int `json:"running_time_secs" dynamodbav:"RunningTimeSecs"`
	Actors          []string
}

type Movie

type Movie struct {
	PK    string
	SK    string
	Year  int
	Title string
	Info  Info
}

func FromJSON

func FromJSON(jsonSrc string) (movie *Movie, err error)

func Get

func Get(year int, title string) (mov Movie, err error)

func Scan

func Scan() ([]Movie, error)

Scan the table for all movie INFO items.

func (*Movie) Init

func (m *Movie) Init()

func (*Movie) MakePK

func (m *Movie) MakePK() string

func (*Movie) MakeSK

func (m *Movie) MakeSK() string

func (*Movie) Put

func (m *Movie) Put() error

func (Movie) PutRental

func (m Movie) PutRental(phone string, date time.Time) (MovieRental, error)

type MovieRental

type MovieRental struct {
	PK         string
	SK         string
	Year       int       // part of pkey to Movie
	Title      string    // part of pkey to Movie
	Phone      string    // Part of fkey to CustomerRental
	Date       time.Time // Part of fkey to CustomerRental
	DueDate    time.Time
	ReturnDate time.Time
}

MovieRental represents a movie that was part of a CustomerRental

func (*MovieRental) Init

func (mr *MovieRental) Init()

func (*MovieRental) MakePK

func (mr *MovieRental) MakePK() string

func (*MovieRental) MakeSK

func (mr *MovieRental) MakeSK() string

Jump to

Keyboard shortcuts

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