fasthttp

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapHandler

func WrapHandler(h fasthttp.RequestHandler) echo.HandlerFunc

WrapHandler wraps `fasthttp.RequestHandler` into `echo.HandlerFunc`.

func WrapMiddleware

WrapMiddleware wraps `func(fasthttp.RequestHandler) fasthttp.RequestHandler` into `echo.MiddlewareFunc`

Types

type Cookie struct {
	*fasthttp.Cookie
}

Cookie implements `engine.Cookie`.

func (*Cookie) Domain

func (c *Cookie) Domain() string

Domain implements `engine.Cookie#Domain` function.

func (*Cookie) Expires

func (c *Cookie) Expires() time.Time

Expires implements `engine.Cookie#Expires` function.

func (*Cookie) HTTPOnly

func (c *Cookie) HTTPOnly() bool

HTTPOnly implements `engine.Cookie#HTTPOnly` function.

func (*Cookie) Name

func (c *Cookie) Name() string

Name implements `engine.Cookie#Name` function.

func (*Cookie) Path

func (c *Cookie) Path() string

Path implements `engine.Cookie#Path` function.

func (*Cookie) Secure

func (c *Cookie) Secure() bool

Secure implements `engine.Cookie#Secure` function.

func (*Cookie) Value

func (c *Cookie) Value() string

Value implements `engine.Cookie#Value` function.

type Request

type Request struct {
	*fasthttp.RequestCtx
	// contains filtered or unexported fields
}

Request implements `engine.Request`.

func NewRequest

func NewRequest(c *fasthttp.RequestCtx, l log.Logger) *Request

NewRequest returns `Request` instance.

func (*Request) Body

func (r *Request) Body() io.Reader

Body implements `engine.Request#Body` function.

func (*Request) ContentLength

func (r *Request) ContentLength() int64

ContentLength implements `engine.Request#ContentLength` function.

func (*Request) Cookie

func (r *Request) Cookie(name string) (engine.Cookie, error)

Cookie implements `engine.Request#Cookie` function.

func (*Request) Cookies

func (r *Request) Cookies() []engine.Cookie

Cookies implements `engine.Request#Cookies` function.

func (*Request) FormFile

func (r *Request) FormFile(name string) (*multipart.FileHeader, error)

FormFile implements `engine.Request#FormFile` function.

func (*Request) FormParams

func (r *Request) FormParams() (params map[string][]string)

FormParams implements `engine.Request#FormParams` function.

func (*Request) FormValue

func (r *Request) FormValue(name string) string

FormValue implements `engine.Request#FormValue` function.

func (*Request) Header

func (r *Request) Header() engine.Header

Header implements `engine.Request#Header` function.

func (*Request) Host

func (r *Request) Host() string

Host implements `engine.Request#Host` function.

func (*Request) IsTLS

func (r *Request) IsTLS() bool

IsTLS implements `engine.Request#TLS` function.

func (*Request) Method

func (r *Request) Method() string

Method implements `engine.Request#Method` function.

func (*Request) MultipartForm

func (r *Request) MultipartForm() (*multipart.Form, error)

MultipartForm implements `engine.Request#MultipartForm` function.

func (*Request) Referer

func (r *Request) Referer() string

Referer implements `engine.Request#Referer` function.

func (*Request) RemoteAddress

func (r *Request) RemoteAddress() string

RemoteAddress implements `engine.Request#RemoteAddress` function.

func (*Request) Scheme

func (r *Request) Scheme() string

Scheme implements `engine.Request#Scheme` function.

func (*Request) SetBody

func (r *Request) SetBody(reader io.Reader)

SetBody implements `engine.Request#SetBody` function.

func (*Request) SetMethod

func (r *Request) SetMethod(method string)

SetMethod implements `engine.Request#SetMethod` function.

func (*Request) SetURI

func (r *Request) SetURI(uri string)

SetURI implements `engine.Request#SetURI` function.

func (*Request) URI

func (r *Request) URI() string

URI implements `engine.Request#URI` function.

func (*Request) URL

func (r *Request) URL() engine.URL

URL implements `engine.Request#URL` function.

func (*Request) UserAgent

func (r *Request) UserAgent() string

UserAgent implements `engine.Request#UserAgent` function.

type RequestHeader

type RequestHeader struct {
	*fasthttp.RequestHeader
}

RequestHeader holds `fasthttp.RequestHeader`.

func (*RequestHeader) Add

func (h *RequestHeader) Add(key, val string)

Add implements `engine.Header#Add` function.

func (*RequestHeader) Contains

func (h *RequestHeader) Contains(key string) bool

Contains implements `engine.Header#Contains` function.

func (*RequestHeader) Del

func (h *RequestHeader) Del(key string)

Del implements `engine.Header#Del` function.

func (*RequestHeader) Get

func (h *RequestHeader) Get(key string) string

Get implements `engine.Header#Get` function.

func (*RequestHeader) Keys

func (h *RequestHeader) Keys() (keys []string)

Keys implements `engine.Header#Keys` function.

func (*RequestHeader) Set

func (h *RequestHeader) Set(key, val string)

Set implements `engine.Header#Set` function.

type Response

type Response struct {
	*fasthttp.RequestCtx
	// contains filtered or unexported fields
}

Response implements `engine.Response`.

func NewResponse

func NewResponse(c *fasthttp.RequestCtx, l log.Logger) *Response

NewResponse returns `Response` instance.

func (*Response) Committed

func (r *Response) Committed() bool

Committed implements `engine.Response#Committed` function.

func (*Response) Header

func (r *Response) Header() engine.Header

Header implements `engine.Response#Header` function.

func (*Response) SetCookie

func (r *Response) SetCookie(c engine.Cookie)

SetCookie implements `engine.Response#SetCookie` function.

func (*Response) SetWriter

func (r *Response) SetWriter(w io.Writer)

SetWriter implements `engine.Response#SetWriter` function.

func (*Response) Size

func (r *Response) Size() int64

Size implements `engine.Response#Size` function.

func (*Response) Status

func (r *Response) Status() int

Status implements `engine.Response#Status` function.

func (*Response) Write

func (r *Response) Write(b []byte) (n int, err error)

Write implements `engine.Response#Write` function.

func (*Response) WriteHeader

func (r *Response) WriteHeader(code int)

WriteHeader implements `engine.Response#WriteHeader` function.

func (*Response) Writer

func (r *Response) Writer() io.Writer

Writer implements `engine.Response#Writer` function.

type ResponseHeader

type ResponseHeader struct {
	*fasthttp.ResponseHeader
}

ResponseHeader holds `fasthttp.ResponseHeader`.

func (*ResponseHeader) Add

func (h *ResponseHeader) Add(key, val string)

Add implements `engine.Header#Add` function.

func (*ResponseHeader) Contains

func (h *ResponseHeader) Contains(key string) bool

Contains implements `engine.Header#Contains` function.

func (*ResponseHeader) Del

func (h *ResponseHeader) Del(key string)

Del implements `engine.Header#Del` function.

func (*ResponseHeader) Get

func (h *ResponseHeader) Get(key string) string

Get implements `engine.Header#Get` function.

func (*ResponseHeader) Keys

func (h *ResponseHeader) Keys() (keys []string)

Keys implements `engine.Header#Keys` function.

func (*ResponseHeader) Set

func (h *ResponseHeader) Set(key, val string)

Set implements `engine.Header#Set` function.

type Server

type Server struct {
	*fasthttp.Server
	// contains filtered or unexported fields
}

Server implements `engine.Server`.

func New

func New(addr string) *Server

New returns `Server` with provided listen address.

func WithConfig

func WithConfig(c engine.Config) (s *Server)

WithConfig returns `Server` with provided config.

func WithTLS

func WithTLS(addr, certFile, keyFile string) *Server

WithTLS returns `Server` with provided TLS config.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(c *fasthttp.RequestCtx)

func (*Server) SetHandler

func (s *Server) SetHandler(h engine.Handler)

SetHandler implements `engine.Server#SetHandler` function.

func (*Server) SetLogger

func (s *Server) SetLogger(l log.Logger)

SetLogger implements `engine.Server#SetLogger` function.

func (*Server) Start

func (s *Server) Start() error

Start implements `engine.Server#Start` function.

type URL

type URL struct {
	*fasthttp.URI
}

URL implements `engine.URL`.

func (*URL) Path

func (u *URL) Path() string

Path implements `engine.URL#Path` function.

func (*URL) QueryParam

func (u *URL) QueryParam(name string) string

QueryParam implements `engine.URL#QueryParam` function.

func (*URL) QueryParams

func (u *URL) QueryParams() (params map[string][]string)

QueryParams implements `engine.URL#QueryParams` function.

func (*URL) QueryString

func (u *URL) QueryString() string

QueryString implements `engine.URL#QueryString` function.

func (*URL) SetPath

func (u *URL) SetPath(path string)

SetPath implements `engine.URL#SetPath` function.

Jump to

Keyboard shortcuts

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