movieController

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteMovieResponse

type DeleteMovieResponse struct {
	controller.StandardResponseFields
	Data struct {
		ExtlID  string `json:"extl_id"`
		Deleted bool   `json:"deleted"`
	} `json:"data"`
}

DeleteMovieResponse is the response struct for deleted Movies

type ListMovieResponse

type ListMovieResponse struct {
	controller.StandardResponseFields
	Data []*MovieResponse `json:"data"`
}

ListMovieResponse is the response struct for multiple Movies

type MovieController

type MovieController struct {
	App *app.Application
	SRF controller.StandardResponseFields
}

MovieController is used as the base controller for the Movie logic

func NewMovieController

func NewMovieController(app *app.Application, srf controller.StandardResponseFields) *MovieController

NewMovieController initializes MovieController

func (*MovieController) Add

Add adds a movie to the catalog.

func (*MovieController) Delete

Delete removes the movie given the id sent in

func (*MovieController) FindAll

FindAll finds the entire set of Movies

func (*MovieController) FindByID

func (ctl *MovieController) FindByID(ctx context.Context, id string) (*SingleMovieResponse, error)

FindByID finds a movie given its' unique ID

func (*MovieController) NewListMovieResponse

func (ctl *MovieController) NewListMovieResponse(ms []*movie.Movie, r *http.Request) *ListMovieResponse

NewListMovieResponse is an initializer for ListMovieResponse

func (*MovieController) NewSingleMovieResponse

func (ctl *MovieController) NewSingleMovieResponse(mr *MovieResponse) *SingleMovieResponse

NewSingleMovieResponse is an initializer for SingleMovieResponse

func (*MovieController) Update

func (ctl *MovieController) Update(ctx context.Context, id string, r *MovieRequest) (*MovieResponse, error)

Update updates the movie given the id sent in

type MovieRequest

type MovieRequest struct {
	Title    string `json:"title"`
	Year     int    `json:"year"`
	Rated    string `json:"rated"`
	Released string `json:"release_date"`
	RunTime  int    `json:"run_time"`
	Director string `json:"director"`
	Writer   string `json:"writer"`
}

MovieRequest is the request struct

type MovieResponse

type MovieResponse struct {
	ExtlID          string `json:"extl_id"`
	Title           string `json:"title"`
	Year            int    `json:"year"`
	Rated           string `json:"rated"`
	Released        string `json:"release_date"`
	RunTime         int    `json:"run_time"`
	Director        string `json:"director"`
	Writer          string `json:"writer"`
	CreateTimestamp string `json:"create_timestamp"`
	UpdateTimestamp string `json:"update_timestamp"`
}

MovieResponse is the response struct for a single Movie

type SingleMovieResponse

type SingleMovieResponse struct {
	controller.StandardResponseFields
	Data *MovieResponse `json:"data"`
}

SingleMovieResponse is the response struct for multiple Movies

Jump to

Keyboard shortcuts

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