http

package
v1.0.51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2022 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

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 DelRequestHeader(request *fasthttp.Request)

func DelResponseHeader added in v1.0.47

func DelResponseHeader(response *fasthttp.Response)

func Error added in v1.0.1

func Error(ctx *fasthttp.RequestCtx, msg string, statusCode int)

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(ctx *fasthttp.RequestCtx, key, defaultV string) (string, bool)

func HijackClientRequest added in v1.0.49

func HijackClientRequest(websocketConn *websocket.Conn, httpConn *httputil.ClientConn, request *http.Request) error

func InitClientDial added in v1.0.49

func InitClientDial(endpoint string) (net.Conn, error)

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 Param added in v1.0.3

func Param(ctx *fasthttp.RequestCtx, key string) (string, bool)

func Params added in v1.0.1

func Params(ctx *fasthttp.RequestCtx) map[string]any

func Proxy added in v1.0.47

func Proxy(host string, schema string, uri string, query string, ctx *fasthttp.RequestCtx, timeout int) error

func UnixSocketProxy added in v1.0.47

func UnixSocketProxy(unixPath string, host string, schema string, uri string, query string, ctx *fasthttp.RequestCtx, timeout int) error

func WithHttpReverseProxy added in v1.0.47

func WithHttpReverseProxy(host string, schema string, uri string, query string, ctx *fasthttp.RequestCtx) (rtn error)

func WithHttpReverseUnixSocketProxy added in v1.0.47

func WithHttpReverseUnixSocketProxy(unixPath string, uri string, query string, ctx *fasthttp.RequestCtx) (rtn error)

Types

type EchoWSRequestHandler added in v1.0.49

type EchoWSRequestHandler struct {
	Upgrader Upgrader
}

func (*EchoWSRequestHandler) Handle added in v1.0.51

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 (*RequestHandlerChain) Then added in v1.0.15

type Upgrader added in v1.0.49

type Upgrader = websocket.FastHTTPUpgrader

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL