Documentation ¶
Index ¶
- func HTTPGet(url string, header map[string]string) (int, []byte, error)
- func HTTPPost(url string, header map[string]string, bodyObj interface{}) (int, []byte, error)
- func HTTPPostEx(url string, header map[string]string, body []byte) (int, []byte, error)
- type APIHandle
- type Serv
- func (s *Serv) HandleFastHTTP(ctx *fasthttp.RequestCtx)
- func (s *Serv) ParseBody(ctx *fasthttp.RequestCtx, params interface{}) error
- func (s *Serv) RegHandle(name string, handle APIHandle)
- func (s *Serv) SetHTTPStatus(ctx *fasthttp.RequestCtx, statusCode int)
- func (s *Serv) SetResponse(ctx *fasthttp.RequestCtx, jsonObj interface{})
- func (s *Serv) SetStringResponse(ctx *fasthttp.RequestCtx, str string)
- func (s *Serv) Start() error
- func (s *Serv) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Serv ¶
type Serv struct {
// contains filtered or unexported fields
}
Serv -
func (*Serv) HandleFastHTTP ¶
func (s *Serv) HandleFastHTTP(ctx *fasthttp.RequestCtx)
HandleFastHTTP -
func (*Serv) ParseBody ¶
func (s *Serv) ParseBody(ctx *fasthttp.RequestCtx, params interface{}) error
ParseBody - parse body
func (*Serv) SetHTTPStatus ¶
func (s *Serv) SetHTTPStatus(ctx *fasthttp.RequestCtx, statusCode int)
SetHTTPStatus - set a response with status
func (*Serv) SetResponse ¶
func (s *Serv) SetResponse(ctx *fasthttp.RequestCtx, jsonObj interface{})
SetResponse - set a response
func (*Serv) SetStringResponse ¶
func (s *Serv) SetStringResponse(ctx *fasthttp.RequestCtx, str string)
SetStringResponse - set a response with string
Click to show internal directories.
Click to hide internal directories.