Documentation ¶
Index ¶
- func Cookie(c *gin.Context, name, value string, maxAge int)
- func FoundRedirect(c *gin.Context, location string)
- func GetOrigin(c *gin.Context) string
- func JSON(c *gin.Context)
- func JSONBadRequest(c *gin.Context, err error)
- func JSONData(c *gin.Context, data interface{})
- func JSONError(c *gin.Context, status int, err error)
- func JSONForbidden(c *gin.Context, err error)
- func JSONList(c *gin.Context, list interface{}, total int64)
- func JSONServerError(c *gin.Context, err error)
- func JSONUnauthorized(c *gin.Context, err error)
- func MovedRedirect(c *gin.Context, location string)
- func ParamInt(c *gin.Context, name string) int
- func ParamInt64(c *gin.Context, name string) int64
- func QueryInt(c *gin.Context, name string) int
- func QueryInt64(c *gin.Context, name string) int64
- func SetupEmbedAssets(rg *gin.RouterGroup, fs http.FileSystem, relativePaths ...string)
- func SetupPing(e *gin.Engine)
- func SetupResource(rg *gin.RouterGroup, resources ...Resource)
- func SetupStaticAssets(rg *gin.RouterGroup, dir string)
- func SetupSwagger(engine *gin.Engine)
- func Startup(e *gin.Engine, addr string)
- func TemporaryRedirect(c *gin.Context, location string)
- type Resource
- type SRI
- type Server
- type SimpleRouter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FoundRedirect ¶
FoundRedirect redirect with the StatusFound
func MovedRedirect ¶
MovedRedirect redirect with the StatusMovedPermanently
func SetupEmbedAssets ¶
func SetupEmbedAssets(rg *gin.RouterGroup, fs http.FileSystem, relativePaths ...string)
func SetupResource ¶
func SetupResource(rg *gin.RouterGroup, resources ...Resource)
func SetupStaticAssets ¶
func SetupStaticAssets(rg *gin.RouterGroup, dir string)
func SetupSwagger ¶
func TemporaryRedirect ¶
TemporaryRedirect redirect with the StatusTemporaryRedirect
Types ¶
type Resource ¶
type Resource interface {
Register(router *gin.RouterGroup)
}
type SRI ¶
type SRI struct { Pattern string Handlers gin.HandlersChain }
type SimpleRouter ¶
type SimpleRouter struct {
// contains filtered or unexported fields
}
func NewSimpleRouter ¶
func NewSimpleRouter() *SimpleRouter
func (*SimpleRouter) Handler ¶
func (si *SimpleRouter) Handler(c *gin.Context)
func (*SimpleRouter) Route ¶
func (si *SimpleRouter) Route(relativePath string, handlerFunc ...gin.HandlerFunc)
func (*SimpleRouter) StaticFsIndex ¶
func (si *SimpleRouter) StaticFsIndex(pattern string, fs http.FileSystem)
func (*SimpleRouter) StaticIndex ¶
func (si *SimpleRouter) StaticIndex(pattern, dir string)
Click to show internal directories.
Click to hide internal directories.