Documentation ¶
Index ¶
- Constants
- Variables
- type BodyRequestHandler
- func (b *BodyRequestHandler) AddFile(key string, file *multipart.FileHeader) error
- func (b *BodyRequestHandler) AddForm(key, value string) error
- func (b *BodyRequestHandler) BodyForm() (url.Values, error)
- func (b *BodyRequestHandler) ContentType() string
- func (b *BodyRequestHandler) Files() (map[string][]*multipart.FileHeader, error)
- func (b *BodyRequestHandler) GetFile(key string) ([]*multipart.FileHeader, bool)
- func (b *BodyRequestHandler) GetForm(key string) string
- func (b *BodyRequestHandler) MultipartForm() (*multipart.Form, error)
- func (b *BodyRequestHandler) RawBody() ([]byte, error)
- func (b *BodyRequestHandler) SetFile(files map[string][]*multipart.FileHeader) error
- func (b *BodyRequestHandler) SetForm(values url.Values) error
- func (b *BodyRequestHandler) SetRaw(contentType string, body []byte)
- func (b *BodyRequestHandler) SetToForm(key, value string) error
- type HttpContext
- func (ctx *HttpContext) AcceptTime() time.Time
- func (ctx *HttpContext) Assert(i interface{}) error
- func (ctx *HttpContext) Clone() (eoscContext.EoContext, error)
- func (ctx *HttpContext) Context() context.Context
- func (ctx *HttpContext) FastFinish()
- func (ctx *HttpContext) GetBalance() eoscContext.BalanceHandler
- func (ctx *HttpContext) GetComplete() eoscContext.CompleteHandler
- func (ctx *HttpContext) GetEntry() eosc.IEntry
- func (ctx *HttpContext) GetFinish() eoscContext.FinishHandler
- func (ctx *HttpContext) GetLabel(name string) string
- func (ctx *HttpContext) GetUpstreamHostHandler() eoscContext.UpstreamHostHandler
- func (ctx *HttpContext) IsCloneable() bool
- func (ctx *HttpContext) Labels() map[string]string
- func (ctx *HttpContext) LocalAddr() net.Addr
- func (ctx *HttpContext) LocalIP() net.IP
- func (ctx *HttpContext) LocalPort() int
- func (ctx *HttpContext) Proxies() []http_service.IProxy
- func (ctx *HttpContext) Proxy() http_service.IRequest
- func (ctx *HttpContext) ProxyClone() http_service.IRequest
- func (ctx *HttpContext) RealIP() string
- func (ctx *HttpContext) Request() http_service.IRequestReader
- func (ctx *HttpContext) RequestId() string
- func (ctx *HttpContext) Response() http_service.IResponse
- func (ctx *HttpContext) Scheme() string
- func (ctx *HttpContext) SendTo(scheme string, node eoscContext.INode, timeout time.Duration) error
- func (ctx *HttpContext) SetBalance(handler eoscContext.BalanceHandler)
- func (ctx *HttpContext) SetCompleteHandler(handler eoscContext.CompleteHandler)
- func (ctx *HttpContext) SetFinish(handler eoscContext.FinishHandler)
- func (ctx *HttpContext) SetLabel(name, value string)
- func (ctx *HttpContext) SetProxy(proxy http_service.IRequest)
- func (ctx *HttpContext) SetUpstreamHostHandler(handler eoscContext.UpstreamHostHandler)
- func (ctx *HttpContext) Value(key interface{}) interface{}
- func (ctx *HttpContext) WithValue(key, val interface{})
- type ProxyRequest
- type RequestHeader
- func (h *RequestHeader) AddHeader(key, value string)
- func (h *RequestHeader) DelHeader(key string)
- func (h *RequestHeader) GetCookie(key string) string
- func (h *RequestHeader) GetHeader(name string) string
- func (h *RequestHeader) Headers() http.Header
- func (h *RequestHeader) Host() string
- func (h *RequestHeader) RawHeader() string
- func (h *RequestHeader) SetHeader(key, value string)
- func (h *RequestHeader) SetHost(host string)
- type RequestReader
- func (r *RequestReader) Body() http_service.IBodyDataReader
- func (r *RequestReader) ContentLength() int
- func (r *RequestReader) ContentType() string
- func (r *RequestReader) Finish() error
- func (r *RequestReader) ForwardIP() string
- func (r *RequestReader) Header() http_service.IHeaderReader
- func (r *RequestReader) Method() string
- func (r *RequestReader) RealIp() string
- func (r *RequestReader) RemoteAddr() string
- func (r *RequestReader) RemotePort() string
- func (r *RequestReader) Request() *fasthttp.Request
- func (r *RequestReader) String() string
- func (r *RequestReader) URI() http_service.IURIReader
- type Response
- func (r *Response) BodyLen() int
- func (r *Response) ClearError()
- func (r *Response) ContentLength() int
- func (r *Response) ContentType() string
- func (r *Response) Finish() error
- func (r *Response) GetBody() []byte
- func (r *Response) HeadersString() string
- func (r *Response) ProxyStatus() string
- func (r *Response) ProxyStatusCode() int
- func (r *Response) RemoteIP() string
- func (r *Response) RemotePort() int
- func (r *Response) ResponseError() error
- func (r *Response) ResponseTime() time.Duration
- func (r *Response) SetBody(bytes []byte)
- func (r *Response) SetProxyStatus(code int, status string)
- func (r *Response) SetResponseTime(t time.Duration)
- func (r *Response) SetStatus(code int, status string)
- func (r *Response) Status() string
- func (r *Response) StatusCode() int
- type ResponseHeader
- type URIRequest
- func (ur *URIRequest) AddQuery(key, value string)
- func (ur *URIRequest) DelQuery(key string)
- func (ur *URIRequest) GetQuery(key string) string
- func (ur *URIRequest) Host() string
- func (ur *URIRequest) Path() string
- func (ur *URIRequest) RawQuery() string
- func (ur *URIRequest) RawURL() string
- func (ur *URIRequest) RequestURI() string
- func (ur *URIRequest) Scheme() string
- func (ur *URIRequest) SetHost(host string)
- func (ur *URIRequest) SetPath(s string)
- func (ur *URIRequest) SetQuery(key, value string)
- func (ur *URIRequest) SetRawQuery(raw string)
- func (ur *URIRequest) SetScheme(scheme string)
- type UrlAgent
- type WebsocketContext
- func (w *WebsocketContext) Assert(i interface{}) error
- func (w *WebsocketContext) Clone() (eoscContext.EoContext, error)
- func (w *WebsocketContext) IsCloneable() bool
- func (w *WebsocketContext) IsWebsocket() bool
- func (w *WebsocketContext) SetUpstreamConn(conn net.Conn)
- func (w *WebsocketContext) Upgrade() error
Constants ¶
View Source
const ( MultipartForm = "multipart/form-data" FormData = "application/x-www-form-urlencoded" TEXT = "text/plain" JSON = "application/json" JavaScript = "application/javascript" AppLicationXML = "application/xml" TextXML = "text/xml" Html = "text/html" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BodyRequestHandler ¶
type BodyRequestHandler struct {
// contains filtered or unexported fields
}
BodyRequestHandler body请求处理器
func NewBodyRequestHandler ¶
func NewBodyRequestHandler(request *fasthttp.Request) *BodyRequestHandler
func (*BodyRequestHandler) AddFile ¶
func (b *BodyRequestHandler) AddFile(key string, file *multipart.FileHeader) error
AddFile 新增文件参数
func (*BodyRequestHandler) AddForm ¶
func (b *BodyRequestHandler) AddForm(key, value string) error
AddForm 新增表单参数
func (*BodyRequestHandler) BodyForm ¶
func (b *BodyRequestHandler) BodyForm() (url.Values, error)
BodyForm 获取表单参数
func (*BodyRequestHandler) ContentType ¶
func (b *BodyRequestHandler) ContentType() string
ContentType 获取contentType
func (*BodyRequestHandler) Files ¶
func (b *BodyRequestHandler) Files() (map[string][]*multipart.FileHeader, error)
func (*BodyRequestHandler) GetFile ¶
func (b *BodyRequestHandler) GetFile(key string) ([]*multipart.FileHeader, bool)
func (*BodyRequestHandler) GetForm ¶
func (b *BodyRequestHandler) GetForm(key string) string
GetForm 获取表单参数
func (*BodyRequestHandler) MultipartForm ¶ added in v0.8.0
func (b *BodyRequestHandler) MultipartForm() (*multipart.Form, error)
func (*BodyRequestHandler) RawBody ¶
func (b *BodyRequestHandler) RawBody() ([]byte, error)
RawBody 获取raw数据
func (*BodyRequestHandler) SetFile ¶
func (b *BodyRequestHandler) SetFile(files map[string][]*multipart.FileHeader) error
SetFile 设置文件参数
func (*BodyRequestHandler) SetForm ¶
func (b *BodyRequestHandler) SetForm(values url.Values) error
SetForm 设置表单参数
func (*BodyRequestHandler) SetRaw ¶
func (b *BodyRequestHandler) SetRaw(contentType string, body []byte)
SetRaw 设置raw数据
func (*BodyRequestHandler) SetToForm ¶
func (b *BodyRequestHandler) SetToForm(key, value string) error
type HttpContext ¶ added in v0.9.0
type HttpContext struct {
// contains filtered or unexported fields
}
HttpContext fasthttpRequestCtx
func NewContext ¶
func NewContext(ctx *fasthttp.RequestCtx, port int) *HttpContext
NewContext 创建Context
func (*HttpContext) AcceptTime ¶ added in v0.9.0
func (ctx *HttpContext) AcceptTime() time.Time
func (*HttpContext) Assert ¶ added in v0.9.0
func (ctx *HttpContext) Assert(i interface{}) error
func (*HttpContext) Clone ¶ added in v0.12.1
func (ctx *HttpContext) Clone() (eoscContext.EoContext, error)
func (*HttpContext) Context ¶ added in v0.9.0
func (ctx *HttpContext) Context() context.Context
func (*HttpContext) GetBalance ¶ added in v0.9.0
func (ctx *HttpContext) GetBalance() eoscContext.BalanceHandler
func (*HttpContext) GetComplete ¶ added in v0.9.0
func (ctx *HttpContext) GetComplete() eoscContext.CompleteHandler
func (*HttpContext) GetEntry ¶ added in v0.14.2
func (ctx *HttpContext) GetEntry() eosc.IEntry
func (*HttpContext) GetFinish ¶ added in v0.9.0
func (ctx *HttpContext) GetFinish() eoscContext.FinishHandler
func (*HttpContext) GetLabel ¶ added in v0.9.0
func (ctx *HttpContext) GetLabel(name string) string
func (*HttpContext) GetUpstreamHostHandler ¶ added in v0.9.0
func (ctx *HttpContext) GetUpstreamHostHandler() eoscContext.UpstreamHostHandler
func (*HttpContext) IsCloneable ¶ added in v0.12.1
func (ctx *HttpContext) IsCloneable() bool
func (*HttpContext) Labels ¶ added in v0.9.0
func (ctx *HttpContext) Labels() map[string]string
func (*HttpContext) LocalAddr ¶ added in v0.9.0
func (ctx *HttpContext) LocalAddr() net.Addr
func (*HttpContext) LocalIP ¶ added in v0.9.0
func (ctx *HttpContext) LocalIP() net.IP
func (*HttpContext) LocalPort ¶ added in v0.9.0
func (ctx *HttpContext) LocalPort() int
func (*HttpContext) Proxies ¶ added in v0.9.0
func (ctx *HttpContext) Proxies() []http_service.IProxy
func (*HttpContext) Proxy ¶ added in v0.9.0
func (ctx *HttpContext) Proxy() http_service.IRequest
func (*HttpContext) ProxyClone ¶ added in v0.19.5
func (ctx *HttpContext) ProxyClone() http_service.IRequest
func (*HttpContext) RealIP ¶ added in v0.12.5
func (ctx *HttpContext) RealIP() string
func (*HttpContext) Request ¶ added in v0.9.0
func (ctx *HttpContext) Request() http_service.IRequestReader
func (*HttpContext) RequestId ¶ added in v0.9.0
func (ctx *HttpContext) RequestId() string
RequestId 请求ID
func (*HttpContext) Response ¶ added in v0.9.0
func (ctx *HttpContext) Response() http_service.IResponse
func (*HttpContext) Scheme ¶ added in v0.9.0
func (ctx *HttpContext) Scheme() string
func (*HttpContext) SendTo ¶ added in v0.9.0
func (ctx *HttpContext) SendTo(scheme string, node eoscContext.INode, timeout time.Duration) error
func (*HttpContext) SetBalance ¶ added in v0.9.0
func (ctx *HttpContext) SetBalance(handler eoscContext.BalanceHandler)
func (*HttpContext) SetCompleteHandler ¶ added in v0.9.0
func (ctx *HttpContext) SetCompleteHandler(handler eoscContext.CompleteHandler)
func (*HttpContext) SetFinish ¶ added in v0.9.0
func (ctx *HttpContext) SetFinish(handler eoscContext.FinishHandler)
func (*HttpContext) SetLabel ¶ added in v0.9.0
func (ctx *HttpContext) SetLabel(name, value string)
func (*HttpContext) SetProxy ¶ added in v0.19.5
func (ctx *HttpContext) SetProxy(proxy http_service.IRequest)
func (*HttpContext) SetUpstreamHostHandler ¶ added in v0.9.0
func (ctx *HttpContext) SetUpstreamHostHandler(handler eoscContext.UpstreamHostHandler)
func (*HttpContext) Value ¶ added in v0.9.0
func (ctx *HttpContext) Value(key interface{}) interface{}
func (*HttpContext) WithValue ¶ added in v0.9.0
func (ctx *HttpContext) WithValue(key, val interface{})
type ProxyRequest ¶
type ProxyRequest struct {
RequestReader
}
func (*ProxyRequest) Body ¶
func (r *ProxyRequest) Body() http_service.IBodyDataWriter
func (*ProxyRequest) Finish ¶
func (r *ProxyRequest) Finish() error
func (*ProxyRequest) Header ¶
func (r *ProxyRequest) Header() http_service.IHeaderWriter
func (*ProxyRequest) SetMethod ¶
func (r *ProxyRequest) SetMethod(s string)
func (*ProxyRequest) URI ¶
func (r *ProxyRequest) URI() http_service.IURIWriter
type RequestHeader ¶
type RequestHeader struct {
// contains filtered or unexported fields
}
func (*RequestHeader) AddHeader ¶
func (h *RequestHeader) AddHeader(key, value string)
func (*RequestHeader) DelHeader ¶
func (h *RequestHeader) DelHeader(key string)
func (*RequestHeader) GetCookie ¶
func (h *RequestHeader) GetCookie(key string) string
func (*RequestHeader) GetHeader ¶
func (h *RequestHeader) GetHeader(name string) string
func (*RequestHeader) Headers ¶
func (h *RequestHeader) Headers() http.Header
func (*RequestHeader) Host ¶
func (h *RequestHeader) Host() string
func (*RequestHeader) RawHeader ¶
func (h *RequestHeader) RawHeader() string
func (*RequestHeader) SetHeader ¶
func (h *RequestHeader) SetHeader(key, value string)
func (*RequestHeader) SetHost ¶
func (h *RequestHeader) SetHost(host string)
type RequestReader ¶
type RequestReader struct {
// contains filtered or unexported fields
}
func (*RequestReader) Body ¶
func (r *RequestReader) Body() http_service.IBodyDataReader
func (*RequestReader) ContentLength ¶ added in v0.9.0
func (r *RequestReader) ContentLength() int
func (*RequestReader) ContentType ¶ added in v0.9.0
func (r *RequestReader) ContentType() string
func (*RequestReader) Finish ¶
func (r *RequestReader) Finish() error
func (*RequestReader) ForwardIP ¶
func (r *RequestReader) ForwardIP() string
func (*RequestReader) Header ¶
func (r *RequestReader) Header() http_service.IHeaderReader
func (*RequestReader) Method ¶
func (r *RequestReader) Method() string
func (*RequestReader) RealIp ¶ added in v0.12.5
func (r *RequestReader) RealIp() string
func (*RequestReader) RemoteAddr ¶
func (r *RequestReader) RemoteAddr() string
func (*RequestReader) RemotePort ¶
func (r *RequestReader) RemotePort() string
func (*RequestReader) Request ¶
func (r *RequestReader) Request() *fasthttp.Request
func (*RequestReader) String ¶
func (r *RequestReader) String() string
func (*RequestReader) URI ¶
func (r *RequestReader) URI() http_service.IURIReader
type Response ¶
type Response struct { ResponseHeader *fasthttp.Response // contains filtered or unexported fields }
func (*Response) ClearError ¶
func (r *Response) ClearError()
func (*Response) ContentLength ¶ added in v0.9.0
func (*Response) ContentType ¶ added in v0.9.0
func (*Response) HeadersString ¶
func (*Response) ProxyStatus ¶
func (*Response) RemotePort ¶ added in v0.14.9
func (*Response) ResponseError ¶
func (*Response) ResponseTime ¶ added in v0.9.0
func (*Response) SetProxyStatus ¶
func (*Response) SetResponseTime ¶ added in v0.9.0
func (*Response) StatusCode ¶
type ResponseHeader ¶
type ResponseHeader struct {
// contains filtered or unexported fields
}
func (*ResponseHeader) AddHeader ¶
func (r *ResponseHeader) AddHeader(key, value string)
func (*ResponseHeader) DelHeader ¶
func (r *ResponseHeader) DelHeader(key string)
func (*ResponseHeader) Finish ¶ added in v0.12.5
func (r *ResponseHeader) Finish()
func (*ResponseHeader) GetHeader ¶
func (r *ResponseHeader) GetHeader(name string) string
func (*ResponseHeader) Headers ¶
func (r *ResponseHeader) Headers() http.Header
func (*ResponseHeader) SetHeader ¶
func (r *ResponseHeader) SetHeader(key, value string)
type URIRequest ¶
type URIRequest struct {
// contains filtered or unexported fields
}
func NewURIRequest ¶
func NewURIRequest(uri *fasthttp.URI) *URIRequest
func (*URIRequest) AddQuery ¶
func (ur *URIRequest) AddQuery(key, value string)
func (*URIRequest) DelQuery ¶
func (ur *URIRequest) DelQuery(key string)
func (*URIRequest) GetQuery ¶
func (ur *URIRequest) GetQuery(key string) string
func (*URIRequest) Host ¶
func (ur *URIRequest) Host() string
func (*URIRequest) Path ¶
func (ur *URIRequest) Path() string
func (*URIRequest) RawQuery ¶
func (ur *URIRequest) RawQuery() string
func (*URIRequest) RawURL ¶
func (ur *URIRequest) RawURL() string
func (*URIRequest) RequestURI ¶
func (ur *URIRequest) RequestURI() string
func (*URIRequest) Scheme ¶
func (ur *URIRequest) Scheme() string
func (*URIRequest) SetHost ¶
func (ur *URIRequest) SetHost(host string)
func (*URIRequest) SetPath ¶
func (ur *URIRequest) SetPath(s string)
func (*URIRequest) SetQuery ¶
func (ur *URIRequest) SetQuery(key, value string)
func (*URIRequest) SetRawQuery ¶
func (ur *URIRequest) SetRawQuery(raw string)
func (*URIRequest) SetScheme ¶
func (ur *URIRequest) SetScheme(scheme string)
type UrlAgent ¶ added in v0.8.5
type UrlAgent struct { http_service.IURIWriter // contains filtered or unexported fields }
func NewUrlAgent ¶ added in v0.8.5
func NewUrlAgent(IURIWriter http_service.IURIWriter, host string, scheme string) *UrlAgent
type WebsocketContext ¶ added in v0.9.0
type WebsocketContext struct { *HttpContext // contains filtered or unexported fields }
func NewWebsocketContext ¶ added in v0.9.0
func NewWebsocketContext(ctx http_context.IHttpContext) (*WebsocketContext, error)
func (*WebsocketContext) Assert ¶ added in v0.9.0
func (w *WebsocketContext) Assert(i interface{}) error
func (*WebsocketContext) Clone ¶ added in v0.12.1
func (w *WebsocketContext) Clone() (eoscContext.EoContext, error)
func (*WebsocketContext) IsCloneable ¶ added in v0.12.1
func (w *WebsocketContext) IsCloneable() bool
func (*WebsocketContext) IsWebsocket ¶ added in v0.9.0
func (w *WebsocketContext) IsWebsocket() bool
func (*WebsocketContext) SetUpstreamConn ¶ added in v0.9.0
func (w *WebsocketContext) SetUpstreamConn(conn net.Conn)
func (*WebsocketContext) Upgrade ¶ added in v0.9.0
func (w *WebsocketContext) Upgrade() error
Click to show internal directories.
Click to hide internal directories.