GinS

ginS

github.com/gin-gonic/gin/ginS

import "github.com/gin-gonic/gin/ginS"

Functions

func Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:101

Any is a wrapper for Engine.Any.

func DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:76

DELETE is a shortcut for router.Handle("DELETE", path, handle)

func GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:66

GET is a shortcut for router.Handle("GET", path, handle)

func Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup

Source: ginS/gins.go:51

Group creates a new router group. You should add all the routes that have common middlewares or the same path prefix. For example, all the routes that use a common middleware for authorization could be grouped.

func HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:96

HEAD is a shortcut for router.Handle("HEAD", path, handle)

func Handle(httpMethod, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:56

Handle is a wrapper for Engine.Handle.

func LoadHTMLFS(fs http.FileSystem, patterns ...string)

Source: ginS/gins.go:30

LoadHTMLFS is a wrapper for Engine.LoadHTMLFS.

func LoadHTMLFiles(files ...string)

Source: ginS/gins.go:25

LoadHTMLFiles is a wrapper for Engine.LoadHTMLFiles.

func LoadHTMLGlob(pattern string)

Source: ginS/gins.go:20

LoadHTMLGlob is a wrapper for Engine.LoadHTMLGlob.

func NoMethod(handlers ...gin.HandlerFunc)

Source: ginS/gins.go:45

NoMethod is a wrapper for Engine.NoMethod.

func NoRoute(handlers ...gin.HandlerFunc)

Source: ginS/gins.go:40

NoRoute adds handlers for NoRoute. It returns a 404 code by default.

func OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:91

OPTIONS is a shortcut for router.Handle("OPTIONS", path, handle)

func PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:81

PATCH is a shortcut for router.Handle("PATCH", path, handle)

func POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:61

POST is a shortcut for router.Handle("POST", path, handle)

func PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:86

PUT is a shortcut for router.Handle("PUT", path, handle)

func QUERY(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:71

QUERY is a shortcut for router.Handle("QUERY", path, handle)

func Routes() gin.RoutesInfo

Source: ginS/gins.go:134

Routes returns a slice of registered routes.

func Run(addr ...string) (err error)

Source: ginS/gins.go:141

Run attaches to a http.Server and starts listening and serving HTTP requests. It is a shortcut for http.ListenAndServe(addr, router) Note: this method will block the calling goroutine indefinitely unless an error happens.

func RunFd(fd int) (err error)

Source: ginS/gins.go:162

RunFd attaches the router to a http.Server and starts listening and serving HTTP requests through the specified file descriptor. Note: the method will block the calling goroutine indefinitely unless an error happens.

func RunTLS(addr, certFile, keyFile string) (err error)

Source: ginS/gins.go:148

RunTLS attaches to a http.Server and starts listening and serving HTTPS requests. It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router) Note: this method will block the calling goroutine indefinitely unless an error happens.

func RunUnix(file string) (err error)

Source: ginS/gins.go:155

RunUnix attaches to a http.Server and starts listening and serving HTTP requests through the specified unix socket (i.e. a file) Note: this method will block the calling goroutine indefinitely unless an error happens.

func SetHTMLTemplate(templ *template.Template)

Source: ginS/gins.go:35

SetHTMLTemplate is a wrapper for Engine.SetHTMLTemplate.

func Static(relativePath, root string) gin.IRoutes

Source: ginS/gins.go:117

Static serves files from the given file system root. Internally a http.FileServer is used, therefore http.NotFound is used instead of the Router's NotFound handler. To use the operating system's file system implementation, use :

router.Static("/static", "/var/www")

func StaticFS(relativePath string, fs http.FileSystem) gin.IRoutes

Source: ginS/gins.go:122

StaticFS is a wrapper for Engine.StaticFS.

func StaticFile(relativePath, filepath string) gin.IRoutes

Source: ginS/gins.go:106

StaticFile is a wrapper for Engine.StaticFile.

func Use(middlewares ...gin.HandlerFunc) gin.IRoutes

Source: ginS/gins.go:129

Use attaches a global middleware to the router. i.e. the middlewares attached through Use() will be included in the handlers chain for every single request. Even 404, 405, static files... For example, this is the right place for a logger or error management middleware.