Skip to content
Myr

chore: update ginS (#1822)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by 田欧 · committed by GitHub · parent 0c1f3c4 · Browse files · 1 file+15 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+15 added−3 removed

  • other:+15 added−3 removed

1 file+15 added−3 removed

modified:ginS/gins.go+15 added-3 removed
123 unmodified lines
124func Use(middlewares ...gin.HandlerFunc) gin.IRoutes {125 return engine().Use(middlewares...)126}127128// Routes returns a slice of registered routes.129func Routes() gin.RoutesInfo {130 return engine().Routes()131}132128// Run : The router is attached to a http.Server and starts listening and serving HTTP requests.133// Run attaches to a http.Server and starts listening and serving HTTP requests.134// It is a shortcut for http.ListenAndServe(addr, router)135// Note: this method will block the calling goroutine indefinitely unless an error happens.136func Run(addr ...string) (err error) {137 return engine().Run(addr...)138}139135// RunTLS : The router is attached to a http.Server and starts listening and serving HTTPS requests.140// RunTLS attaches to a http.Server and starts listening and serving HTTPS requests.141// It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router)142// Note: this method will block the calling goroutine indefinitely unless an error happens.143func RunTLS(addr, certFile, keyFile string) (err error) {144 return engine().RunTLS(addr, certFile, keyFile)145}146142// RunUnix : The router is attached to a http.Server and starts listening and serving HTTP requests147// RunUnix attaches to a http.Server and starts listening and serving HTTP requests148// through the specified unix socket (ie. a file)149// Note: this method will block the calling goroutine indefinitely unless an error happens.150func RunUnix(file string) (err error) {151 return engine().RunUnix(file)152}153154// RunFd attaches the router to a http.Server and starts listening and serving HTTP requests155// through the specified file descriptor.156// Note: thie method will block the calling goroutine indefinitely unless on error happens.157func RunFd(fd int) (err error) {158 return engine().RunFd(fd)159}