routes

package
v0.0.0-...-a03367d Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

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

func Hello() hero.Result

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/hidevopsio/iris/hero#Result` interface.

func HelloName

func HelloName(name string) hero.Result

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.

Jump to

Keyboard shortcuts

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