Documentation ¶
Index ¶
- Constants
- Variables
- func DelRequestHeader(request *fasthttp.Request)
- func DelResponseHeader(response *fasthttp.Response)
- func Error(ctx *fasthttp.RequestCtx, msg string, statusCode int)
- func GetHeader(ctx *fasthttp.RequestCtx, key, defaultV string) string
- func GetParams(ctx *fasthttp.RequestCtx, key, defaultV string) string
- func GetToken(ctx *fasthttp.RequestCtx) string
- func Header(ctx *fasthttp.RequestCtx, key, defaultV string) (string, bool)
- func HijackClientRequest(websocketConn *websocket.Conn, httpConn *httputil.ClientConn, ...) error
- func InitClientDial(endpoint string) (net.Conn, error)
- func JsonBody2Object(ctx *fasthttp.RequestCtx, obj any) error
- func JsonBodyUnmarshalObject[T fastjson.Unmarshalable](ctx *fasthttp.RequestCtx, obj T) error
- func NewFastHTTPHandler(h http.Handler) fasthttp.RequestHandler
- func Param(ctx *fasthttp.RequestCtx, key string) (string, bool)
- func Params(ctx *fasthttp.RequestCtx) map[string]any
- func Proxy(host string, schema string, uri string, query string, ctx *fasthttp.RequestCtx, ...) error
- func UnixSocketProxy(unixPath string, host string, schema string, uri string, query string, ...) error
- func WithHttpReverseProxy(host string, schema string, uri string, query string, ctx *fasthttp.RequestCtx) (rtn error)
- func WithHttpReverseUnixSocketProxy(unixPath string, uri string, query string, ctx *fasthttp.RequestCtx) (rtn error)
- type EchoWSRequestHandler
- type RequestChainHandler
- type RequestHandlerChain
- type Upgrader
Constants ¶
View Source
const ( SUCCESS = 0 FAIL = 1 )
Variables ¶
View Source
var DEFAULT_CONTENTTYPE = []byte("application/json;charset=utf-8")
View Source
var Logger = log4go.LoggerManager.GetLogger("gohutool.util4go.http.proxy")
View Source
var PageResultData = pageResultData{}
View Source
var PageResultDataBuilder = pageResultDataBuilder{}
View Source
var Result = result{}
Functions ¶
func DelRequestHeader ¶ added in v1.0.47
func DelResponseHeader ¶ added in v1.0.47
func GetHeader ¶ added in v1.0.1
func GetHeader(ctx *fasthttp.RequestCtx, key, defaultV string) string
func GetParams ¶ added in v1.0.1
func GetParams(ctx *fasthttp.RequestCtx, key, defaultV string) string
func GetToken ¶ added in v1.0.1
func GetToken(ctx *fasthttp.RequestCtx) string
func Header ¶ added in v1.0.3
func Header(ctx *fasthttp.RequestCtx, key, defaultV string) (string, bool)
func HijackClientRequest ¶ added in v1.0.49
func InitClientDial ¶ added in v1.0.49
InitClientDial /var/run/docker.sock
func JsonBody2Object ¶ added in v1.0.1
func JsonBody2Object(ctx *fasthttp.RequestCtx, obj any) error
func JsonBodyUnmarshalObject ¶ added in v1.0.1
func JsonBodyUnmarshalObject[T fastjson.Unmarshalable](ctx *fasthttp.RequestCtx, obj T) error
func NewFastHTTPHandler ¶ added in v1.0.47
func NewFastHTTPHandler(h http.Handler) fasthttp.RequestHandler
func UnixSocketProxy ¶ added in v1.0.47
func WithHttpReverseProxy ¶ added in v1.0.47
func WithHttpReverseUnixSocketProxy ¶ added in v1.0.47
Types ¶
type EchoWSRequestHandler ¶ added in v1.0.49
type EchoWSRequestHandler struct {
Upgrader Upgrader
}
func (*EchoWSRequestHandler) Handle ¶ added in v1.0.51
func (h *EchoWSRequestHandler) Handle(ctx *fasthttp.RequestCtx) error
type RequestChainHandler ¶ added in v1.0.15
type RequestChainHandler func(next fasthttp.RequestHandler) fasthttp.RequestHandler
type RequestHandlerChain ¶ added in v1.0.15
type RequestHandlerChain struct {
// contains filtered or unexported fields
}
func (*RequestHandlerChain) Add ¶ added in v1.0.15
func (c *RequestHandlerChain) Add(handler RequestChainHandler) *RequestHandlerChain
func (*RequestHandlerChain) Then ¶ added in v1.0.15
func (c *RequestHandlerChain) Then(handler fasthttp.RequestHandler) fasthttp.RequestHandler
type Upgrader ¶ added in v1.0.49
type Upgrader = websocket.FastHTTPUpgrader
Click to show internal directories.
Click to hide internal directories.