Documentation
¶
Index ¶
- Constants
- func CheckWrap(toWrap interface{}) error
- func GlFilter() gin.HandlerFunc
- func GroupFilter() gin.HandlerFunc
- func Logger(pk string) gin.HandlerFunc
- func ParseRet(c *gin.Context) (ret interface{}, origErr interface{})
- func Return(c *gin.Context, code int, message string, err error, result interface{})
- func StatFilter() gin.HandlerFunc
- func Wrap(toWrap interface{}) gin.HandlerFunc
- type HttpClient
- func (c *HttpClient) Method(method string, path string, header map[string]string, params interface{}) (*http.Response, string, error)
- func (c *HttpClient) MethodTimeout(method string, path string, header map[string]string, params interface{}, ...) (*http.Response, string, error)
- func (c *HttpClient) Start() error
- type HttpServer
- func (h *HttpServer) AddHandler(url string, handle interface{})
- func (h *HttpServer) CheckHandle() error
- func (h *HttpServer) Close()
- func (h *HttpServer) DELETE(group *gin.RouterGroup, relativePath string, handler interface{})
- func (h *HttpServer) GET(group *gin.RouterGroup, relativePath string, handler interface{})
- func (h *HttpServer) Handle(group *gin.RouterGroup, httpMethod, relativePath string, handler interface{})
- func (h *HttpServer) OPTIONS(group *gin.RouterGroup, relativePath string, handler interface{})
- func (h *HttpServer) PATCH(group *gin.RouterGroup, relativePath string, handler interface{})
- func (h *HttpServer) POST(group *gin.RouterGroup, relativePath string, handler interface{})
- func (h *HttpServer) PUT(group *gin.RouterGroup, relativePath string, handler interface{})
- func (h *HttpServer) SetInit(i HttpServerInit)
- func (h *HttpServer) Start() error
- type HttpServerInit
Constants ¶
View Source
const ( RemoteIP = "remote_ip" Ret = "ret" RwtRawStr = "ret_raw_str" Code = "code" Err = "err" SessionLogLevel = "session_log_level" Debug = "debug" Data = "data" DataRaw = "data_raw" RedirectUrl = "redirect_url" TraceID = "trace_id" )
Variables ¶
This section is empty.
Functions ¶
func Wrap ¶
func Wrap(toWrap interface{}) gin.HandlerFunc
example: wrap to gin.HandlerFunc -- func(*Context)
Types ¶
type HttpClient ¶
func (*HttpClient) MethodTimeout ¶
func (*HttpClient) Start ¶
func (c *HttpClient) Start() error
type HttpServer ¶
type HttpServer struct { GinLog bool `inject:"httpServerGinLog" canNil:"true"` UseHttps bool `inject:"httpServerUseHttps" canNil:"true"` HttpsCertFilePath string `inject:"httpServerHttpsCertFile" canNil:"true"` HttpsKeyFilePath string `inject:"httpServerHttpsKeyFile" canNil:"true"` HttpServerShutdownTimeout int64 `inject:"httpServerShutdownTimeout" canNil:"true"` HttpServerReadTimeout int64 `inject:"httpServerReadTimeout" canNil:"true"` HttpServerWriteTimeout int64 `inject:"httpServerWriteTimeout" canNil:"true"` HttpServerRunHost int `inject:"httpServerRunHost"` HttpServerInit HttpServerInit `inject:"httpServerInit"` HandlerMap map[string]interface{} // contains filtered or unexported fields }
func (*HttpServer) AddHandler ¶ added in v1.6.3
func (h *HttpServer) AddHandler(url string, handle interface{})
func (*HttpServer) CheckHandle ¶ added in v1.6.3
func (h *HttpServer) CheckHandle() error
func (*HttpServer) Close ¶ added in v1.7.2
func (h *HttpServer) Close()
func (*HttpServer) DELETE ¶ added in v1.6.3
func (h *HttpServer) DELETE(group *gin.RouterGroup, relativePath string, handler interface{})
func (*HttpServer) GET ¶ added in v1.6.3
func (h *HttpServer) GET(group *gin.RouterGroup, relativePath string, handler interface{})
func (*HttpServer) Handle ¶ added in v1.6.3
func (h *HttpServer) Handle(group *gin.RouterGroup, httpMethod, relativePath string, handler interface{})
For GET, POST, PUT, PATCH and DELETE requests the respective shortcut functions can be used.
func (*HttpServer) OPTIONS ¶ added in v1.6.3
func (h *HttpServer) OPTIONS(group *gin.RouterGroup, relativePath string, handler interface{})
func (*HttpServer) PATCH ¶ added in v1.6.3
func (h *HttpServer) PATCH(group *gin.RouterGroup, relativePath string, handler interface{})
func (*HttpServer) POST ¶ added in v1.6.3
func (h *HttpServer) POST(group *gin.RouterGroup, relativePath string, handler interface{})
func (*HttpServer) PUT ¶ added in v1.6.3
func (h *HttpServer) PUT(group *gin.RouterGroup, relativePath string, handler interface{})
func (*HttpServer) SetInit ¶
func (h *HttpServer) SetInit(i HttpServerInit)
func (*HttpServer) Start ¶ added in v1.7.2
func (h *HttpServer) Start() error
type HttpServerInit ¶ added in v1.7.2
Click to show internal directories.
Click to hide internal directories.