standard

package
v2.26.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: Apache-2.0 Imports: 15 Imported by: 63

Documentation

Index

Constants

View Source
const Name = `standard`

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	// contains filtered or unexported fields
}

func (*Header) Add

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

func (*Header) Del

func (h *Header) Del(key string)

func (*Header) Get

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

func (*Header) Object

func (h *Header) Object() interface{}

func (*Header) Set

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

func (*Header) Std

func (h *Header) Std() http.Header

func (*Header) Values added in v1.6.0

func (h *Header) Values(key string) []string

type Request

type Request struct {
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(r *http.Request) *Request

func (*Request) BasicAuth

func (r *Request) BasicAuth() (username, password string, ok bool)

func (*Request) Body

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

func (*Request) Context added in v1.6.0

func (r *Request) Context() context.Context

func (*Request) Cookie

func (r *Request) Cookie(key string) string

func (*Request) Form

func (r *Request) Form() engine.URLValuer

func (*Request) FormFile

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

func (*Request) FormValue

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

func (*Request) Header

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

func (*Request) Host

func (r *Request) Host() string

func (*Request) IsTLS

func (r *Request) IsTLS() bool

func (*Request) MaxSize added in v1.6.0

func (r *Request) MaxSize() int

func (*Request) Method

func (r *Request) Method() string

func (*Request) MultipartForm

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

func (*Request) Object

func (r *Request) Object() interface{}

func (*Request) PostForm

func (r *Request) PostForm() engine.URLValuer

func (*Request) Proto

func (r *Request) Proto() string

func (*Request) RealIP

func (r *Request) RealIP() string

RealIP implements `engine.Request#RealIP` function.

func (*Request) Referer

func (r *Request) Referer() string

func (*Request) RemoteAddress

func (r *Request) RemoteAddress() string

func (*Request) Scheme

func (r *Request) Scheme() string

func (*Request) SetBody

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

SetBody implements `engine.Request#SetBody` function.

func (*Request) SetHost

func (r *Request) SetHost(host string)

SetHost implements `engine.Request#SetHost` function.

func (*Request) SetMaxSize added in v1.6.0

func (r *Request) SetMaxSize(maxSize int)

func (*Request) SetMethod

func (r *Request) SetMethod(method string)

func (*Request) SetURI

func (r *Request) SetURI(uri string)

SetURI implements `engine.Request#SetURI` function.

func (*Request) SetValue added in v1.6.0

func (r *Request) SetValue(key string, value interface{})

func (*Request) Size

func (r *Request) Size() int64

Size implements `engine.Request#ContentLength` function.

func (*Request) StdRequest

func (r *Request) StdRequest() *http.Request

func (*Request) URI

func (r *Request) URI() string

func (*Request) URL

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

func (*Request) UserAgent

func (r *Request) UserAgent() string

func (*Request) WithContext added in v1.6.0

func (r *Request) WithContext(ctx context.Context) *http.Request

type Response

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

func NewResponse

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

func (*Response) Body

func (r *Response) Body() []byte

func (*Response) Committed

func (r *Response) Committed() bool

func (*Response) Error

func (r *Response) Error(errMsg string, args ...int)

func (*Response) Flush added in v1.6.0

func (r *Response) Flush()

func (*Response) Header

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

func (*Response) Hijack

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

func (*Response) Hijacker added in v1.6.0

func (r *Response) Hijacker(fn func(net.Conn)) error

func (*Response) KeepBody added in v1.3.0

func (r *Response) KeepBody(on bool)

func (*Response) NotFound

func (r *Response) NotFound()

func (*Response) Object

func (r *Response) Object() interface{}

func (*Response) Redirect

func (r *Response) Redirect(url string, code int)

func (*Response) ServeContent added in v1.6.0

func (r *Response) ServeContent(content io.ReadSeeker, name string, modtime time.Time)

func (*Response) ServeFile

func (r *Response) ServeFile(file string)

func (*Response) SetCookie

func (r *Response) SetCookie(cookie *http.Cookie)

func (*Response) SetWriter

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

func (*Response) Size

func (r *Response) Size() int64

func (*Response) Status

func (r *Response) Status() int

func (*Response) StdResponseWriter

func (r *Response) StdResponseWriter() http.ResponseWriter

func (*Response) Stream added in v1.1.0

func (r *Response) Stream(step func(io.Writer) bool) (err error)

func (*Response) Write

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

func (*Response) WriteHeader

func (r *Response) WriteHeader(code int)

func (*Response) Writer

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

type Server

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

func New

func New(addr string, opts ...engine.ConfigSetter) *Server

func NewWithConfig

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

func NewWithTLS

func NewWithTLS(addr, certFile, keyFile string, opts ...engine.ConfigSetter) *Server

func (*Server) Config added in v1.6.0

func (s *Server) Config() *engine.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)

func (*Server) SetLogger

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

func (*Server) Shutdown added in v1.6.0

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

Start implements `engine.Server#Start` function.

func (*Server) Stop

func (s *Server) Stop() error

Stop implements `engine.Server#Stop` function.

type URL

type URL struct {
	// contains filtered or unexported fields
}

func (*URL) Object

func (u *URL) Object() interface{}

func (*URL) Path

func (u *URL) Path() string

func (*URL) Query

func (u *URL) Query() url.Values

func (*URL) QueryValue

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

func (*URL) QueryValues

func (u *URL) QueryValues(name string) []string

func (*URL) RawPath

func (u *URL) RawPath() string

func (*URL) RawQuery

func (u *URL) RawQuery() string

func (*URL) SetPath

func (u *URL) SetPath(path string)

func (*URL) SetRawQuery added in v1.1.1

func (u *URL) SetRawQuery(rawQuery string)

func (*URL) String added in v1.1.1

func (u *URL) String() string

type UrlValue

type UrlValue struct {
	// contains filtered or unexported fields
}

func (*UrlValue) Add

func (u *UrlValue) Add(key string, value string)

func (*UrlValue) All

func (u *UrlValue) All() map[string][]string

func (*UrlValue) Del

func (u *UrlValue) Del(key string)

func (*UrlValue) Encode

func (u *UrlValue) Encode() string

func (*UrlValue) Get

func (u *UrlValue) Get(key string) string

func (*UrlValue) Gets

func (u *UrlValue) Gets(key string) []string

func (*UrlValue) Merge added in v1.5.0

func (u *UrlValue) Merge(data url.Values)

func (*UrlValue) Reset

func (u *UrlValue) Reset(data url.Values)

func (*UrlValue) Set

func (u *UrlValue) Set(key string, value string)

type Value

type Value struct {
	// contains filtered or unexported fields
}

func NewValue

func NewValue(r *Request) *Value

func (*Value) Add

func (v *Value) Add(key string, value string)

func (*Value) All

func (v *Value) All() map[string][]string

func (*Value) Del

func (v *Value) Del(key string)

func (*Value) Encode

func (v *Value) Encode() string

func (*Value) Get

func (v *Value) Get(key string) string

func (*Value) Gets

func (v *Value) Gets(key string) []string

func (*Value) Merge added in v1.5.0

func (v *Value) Merge(data url.Values)

func (*Value) Reset

func (v *Value) Reset(data url.Values)

func (*Value) Set

func (v *Value) Set(key string, value string)

Jump to

Keyboard shortcuts

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