Documentation ¶
Index ¶
- func DeleteMovieByID(service services.MovieService, id int64) interface{}
- func Hello() hero.Result
- func HelloName(name string) hero.Result
- func MovieByID(service services.MovieService, id int64) (movie datamodels.Movie, found bool)
- func Movies(service services.MovieService) (results []datamodels.Movie)
- func UpdateMovieByID(ctx iris.Context, service services.MovieService, id int64) (datamodels.Movie, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteMovieByID ¶
func DeleteMovieByID(service services.MovieService, id int64) interface{}
DeleteMovieByID deletes a movie. Demo: curl -i -X DELETE -u admin:password http://localhost:8080/movies/1
func Hello ¶
Hello will return a predefined view with bind data.
`hero.Result` is just an interface with a `Dispatch` function. `hero.Response` and `hero.View` are the built'n result type dispatchers you can even create custom response dispatchers by implementing the `github.com/kataras/iris/hero#Result` interface.
func HelloName ¶
HelloName returns a "Hello {name}" response. Demos: curl -i http://localhost:8080/hello/iris curl -i http://localhost:8080/hello/anything
func MovieByID ¶
func MovieByID(service services.MovieService, id int64) (movie datamodels.Movie, found bool)
MovieByID returns a movie. Demo: curl -i http://localhost:8080/movies/1
func Movies ¶
func Movies(service services.MovieService) (results []datamodels.Movie)
Movies returns list of the movies. Demo: curl -i http://localhost:8080/movies
func UpdateMovieByID ¶
func UpdateMovieByID(ctx iris.Context, service services.MovieService, id int64) (datamodels.Movie, error)
UpdateMovieByID updates a movie. Demo: curl -i -X PUT -F "genre=Thriller" -F "poster=@/Users/kataras/Downloads/out.gif" http://localhost:8080/movies/1
Types ¶
This section is empty.