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) 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) Run() error
- func (h *HttpServer) SetInit(i HttpServerIniter)
- func (h *HttpServer) Stop()
- type HttpServerIniter
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 { NoGinLog bool UseHttps bool HttpsCertFilePath string HttpsKeyFilePath string HttpServerShutdownTimeout int64 HttpServerReadTimeout int64 HttpServerWriteTimeout int64 HttpServerRunHost string HttpServerIniter HttpServerIniter 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) 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) Run ¶
func (h *HttpServer) Run() error
func (*HttpServer) SetInit ¶
func (h *HttpServer) SetInit(i HttpServerIniter)
func (*HttpServer) Stop ¶
func (h *HttpServer) Stop()
type HttpServerIniter ¶
Click to show internal directories.
Click to hide internal directories.