Documentation
¶
Index ¶
- func SetEnvCorsAllowOrigin(name string)
- func SetEnvMode(name string)
- func SetEnvPort(name string)
- type HttpApi
- func (r *HttpApi) Controller(path string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (r *HttpApi) Delete(path string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (r *HttpApi) Get(path string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (r *HttpApi) Head(path string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (r *HttpApi) Options(path string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (r *HttpApi) Patch(path string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (r *HttpApi) Post(path string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (r *HttpApi) Put(path string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (r *HttpApi) Request(method, path string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (r *HttpApi) Run() error
- type HttpApiInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetEnvCorsAllowOrigin ¶
func SetEnvCorsAllowOrigin(name string)
SetEnvCorsAllowOrigin sets the environment variable name for env_name_cors_allow_origin.
func SetEnvMode ¶
func SetEnvMode(name string)
SetEnvMode sets the environment variable name for env_name_mode.
func SetEnvPort ¶
func SetEnvPort(name string)
SetEnvPort sets the environment variable name for env_name_port.
Types ¶
type HttpApi ¶
type HttpApi struct {
// contains filtered or unexported fields
}
HttpApi wraps a gin.Engine and manages the server port.
func (*HttpApi) Controller ¶
Controller creates a new route group with the given relative path and handlers.
type HttpApiInterface ¶
type HttpApiInterface interface {
Run() error
Request(method, path string, handlers ...gin.HandlerFunc) gin.IRoutes
Controller(path string, handlers ...gin.HandlerFunc) gin.IRoutes
Get(path string, handlers ...gin.HandlerFunc) gin.IRoutes
Post(path string, handlers ...gin.HandlerFunc) gin.IRoutes
Delete(path string, handlers ...gin.HandlerFunc) gin.IRoutes
Patch(path string, handlers ...gin.HandlerFunc) gin.IRoutes
Put(path string, handlers ...gin.HandlerFunc) gin.IRoutes
Options(path string, handlers ...gin.HandlerFunc) gin.IRoutes
Head(path string, handlers ...gin.HandlerFunc) gin.IRoutes
}
HttpApiInterface defines the public methods for HttpApi.
Click to show internal directories.
Click to hide internal directories.