standard

package
v2.0.1+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapHandler

func WrapHandler(h http.Handler) echo.HandlerFunc

WrapHandler wraps `http.Handler` into `echo.HandlerFunc`.

func WrapMiddleware

func WrapMiddleware(m func(http.Handler) http.Handler) echo.MiddlewareFunc

WrapMiddleware wraps `func(http.Handler) http.Handler` into `echo.MiddlewareFunc`

Types

type Cookie struct {
	*http.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 Header struct {
	http.Header
}

Header implements `engine.Header`.

func (*Header) Add

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

Add implements `engine.Header#Add` function.

func (*Header) Contains

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

Contains implements `engine.Header#Contains` function.

func (*Header) Del

func (h *Header) Del(key string)

Del implements `engine.Header#Del` function.

func (*Header) Get

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

Get implements `engine.Header#Get` function.

func (*Header) Keys

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

Keys implements `engine.Header#Keys` function.

func (*Header) Set

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

Set implements `engine.Header#Set` function.

type Request

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

Request implements `engine.Request`.

func NewRequest

func NewRequest(r *http.Request, 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() 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#URL` 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 Response

type Response struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

Response implements `engine.Response`.

func NewResponse

func NewResponse(w http.ResponseWriter, l log.Logger) (r *Response)

NewResponse returns `Response` instance.

func (*Response) CloseNotify

func (r *Response) CloseNotify() <-chan bool

CloseNotify implements the http.CloseNotifier interface to allow detecting when the underlying connection has gone away. This mechanism can be used to cancel long operations on the server if the client has disconnected before the response is ready. See https://golang.org/pkg/net/http/#CloseNotifier

func (*Response) Committed

func (r *Response) Committed() bool

Committed implements `engine.Response#Committed` function.

func (*Response) Flush

func (r *Response) Flush()

Flush implements the http.Flusher interface to allow an HTTP handler to flush buffered data to the client. See https://golang.org/pkg/net/http/#Flusher

func (*Response) Header

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

Header implements `engine.Response#Header` function.

func (*Response) Hijack

func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack implements the http.Hijacker interface to allow an HTTP handler to take over the connection. See https://golang.org/pkg/net/http/#Hijacker

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 Server

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

Server implements `engine.Server`.

func New

func New(addr string) *Server

New returns `Server` instance with provided listen address.

func WithConfig

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

WithConfig returns `Server` instance with provided config.

func WithTLS

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

WithTLS returns `Server` instance with provided TLS config.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements `http.Handler` interface.

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 {
	*url.URL
	// contains filtered or unexported fields
}

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() 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