Versions in this module Expand all Collapse all v1 v1.0.0 Jul 6, 2017 Changes in this version + const CharsetUTF8 + const DELETE + const GET + const HeaderAccept + const HeaderAcceptCharset + const HeaderAcceptEncoding + const HeaderAcceptLanguage + const HeaderAcceptRanges + const HeaderAccessControlAllowCredentials + const HeaderAccessControlAllowHeaders + const HeaderAccessControlAllowMethods + const HeaderAccessControlAllowOrigin + const HeaderAccessControlExposeHeaders + const HeaderAccessControlMaxAge + const HeaderAccessControlRequestHeaders + const HeaderAccessControlRequestMethod + const HeaderAge + const HeaderAllow + const HeaderAuthorization + const HeaderCacheControl + const HeaderConnection + const HeaderContentDisposition + const HeaderContentEncoding + const HeaderContentLanguage + const HeaderContentLength + const HeaderContentLocation + const HeaderContentSecurityPolicy + const HeaderContentSecurityPolicyReportOnly + const HeaderContentType + const HeaderCookie + const HeaderDNT + const HeaderDate + const HeaderETag + const HeaderExpires + const HeaderForm + const HeaderHost + const HeaderIfMatch + const HeaderIfModifiedSince + const HeaderIfNoneMatch + const HeaderIfRange + const HeaderIfUnmodifiedSince + const HeaderKeepAlive + const HeaderLastModified + const HeaderLocation + const HeaderOrigin + const HeaderPublicKeyPins + const HeaderPublicKeyPinsReportOnly + const HeaderReferer + const HeaderReferrerPolicy + const HeaderRetryAfter + const HeaderServer + const HeaderSetCookie + const HeaderStrictTransportSecurity + const HeaderTE + const HeaderTK + const HeaderTrailer + const HeaderTransferEncoding + const HeaderUpgrade + const HeaderUpgradeInsecureRequests + const HeaderUserAgent + const HeaderVary + const HeaderVia + const HeaderWWWAuthenticate + const HeaderWarning + const HeaderXCSRFToken + const HeaderXContentTypeOptions + const HeaderXDNSPrefetchControl + const HeaderXForwardedFor + const HeaderXForwardedProto + const HeaderXFrameOptions + const HeaderXHTTPMethodOverride + const HeaderXRealIP + const HeaderXXSSProtection + const MIMEApplicationJSON + const MIMEApplicationJavaScript + const MIMEApplicationXML + const MIMEApplicationXWWWFormURLEncoded + const MIMEImageJPEG + const MIMEImagePNG + const MIMEImageSVGXML + const MIMEMultipartFormData + const MIMETextCSS + const MIMETextHTML + const MIMETextJavaScript + const MIMETextPlain + const MIMETextXML + const POST + const PUT + var DefaultConfig = Config + var ErrBadGateway = NewHTTPError(http.StatusBadGateway) + var ErrGatewayTimeout = NewHTTPError(http.StatusGatewayTimeout) + var ErrInternalServerError = NewHTTPError(http.StatusInternalServerError) + var ErrInvalidRedirectCode = errors.New("invalid redirect status code") + var ErrMethodNotAllowed = NewHTTPError(http.StatusMethodNotAllowed) + var ErrNotFound = NewHTTPError(http.StatusNotFound) + var ErrServiceUnavailable = NewHTTPError(http.StatusServiceUnavailable) + var ErrStatusRequestEntityTooLarge = NewHTTPError(http.StatusRequestEntityTooLarge) + var ErrUnauthorized = NewHTTPError(http.StatusUnauthorized) + var ErrUnsupportedMediaType = NewHTTPError(http.StatusUnsupportedMediaType) + var MethodNotAllowedHandler = func(c *Context) error + var NotFoundHandler = func(c *Context) error + func DefaultHTTPErrorHandler(err error, c *Context) + type Air struct + Binder Binder + Coffer Coffer + Config *Config + HTTPErrorHandler HTTPErrorHandler + Logger Logger + Minifier Minifier + Renderer Renderer + func New() *Air + func (a *Air) Close() error + func (a *Air) Contain(gases ...Gas) + func (a *Air) DELETE(path string, h Handler, gases ...Gas) + func (a *Air) File(path, file string) + func (a *Air) GET(path string, h Handler, gases ...Gas) + func (a *Air) POST(path string, h Handler, gases ...Gas) + func (a *Air) PUT(path string, h Handler, gases ...Gas) + func (a *Air) Precontain(gases ...Gas) + func (a *Air) Serve() error + func (a *Air) Shutdown(c *Context) error + func (a *Air) Static(prefix, root string) + func (a *Air) URL(h Handler, params ...interface{}) string + type Asset struct + func NewAsset(name string, modTime time.Time, content []byte) *Asset + func (a *Asset) ModTime() time.Time + func (a *Asset) Name() string + func (a *Asset) Read(b []byte) (int, error) + func (a *Asset) Seek(offset int64, whence int) (int64, error) + type Binder interface + Bind func(i interface{}, req *Request) error + type Coffer interface + Asset func(name string) *Asset + Init func() error + type Config struct + Address string + AppName string + AssetExts []string + AssetMinified bool + AssetRoot string + CofferEnabled bool + Data Map + DebugMode bool + LogFormat string + LoggerEnabled bool + MaxHeaderBytes int + ReadTimeout time.Duration + TLSCertFile string + TLSKeyFile string + TemplateExts []string + TemplateLeftDelim string + TemplateMinified bool + TemplateRightDelim string + TemplateRoot string + WriteTimeout time.Duration + func NewConfig(filename string) *Config + func (c *Config) Parse(src string) error + func (c *Config) ParseFile(filename string) error + type Context struct + Air *Air + Cancel context.CancelFunc + Data Map + Handler Handler + ParamNames []string + ParamValues []string + PristinePath string + Request *Request + Response *Response + func NewContext(a *Air) *Context + func (c *Context) Attachment(file, filename string) error + func (c *Context) Bind(i interface{}) error + func (c *Context) Blob(contentType string, b []byte) error + func (c *Context) Cookie(name string) (*http.Cookie, error) + func (c *Context) Cookies() []*http.Cookie + func (c *Context) File(file string) error + func (c *Context) FormFile(key string) (multipart.File, *multipart.FileHeader, error) + func (c *Context) FormValue(key string) string + func (c *Context) FormValues() url.Values + func (c *Context) HTML(html string) error + func (c *Context) HasFormValue(key string) bool + func (c *Context) HasQueryValue(key string) bool + func (c *Context) Inline(file, filename string) error + func (c *Context) JSON(i interface{}) error + func (c *Context) JSONP(i interface{}, callback string) error + func (c *Context) NoContent() error + func (c *Context) Param(name string) string + func (c *Context) Push(target string, pos *http.PushOptions) error + func (c *Context) QueryValue(key string) string + func (c *Context) QueryValues() url.Values + func (c *Context) Redirect(statusCode int, url string) error + func (c *Context) Render(templates ...string) error + func (c *Context) SetCancel() + func (c *Context) SetCookie(cookie *http.Cookie) + func (c *Context) SetDeadline(deadline time.Time) + func (c *Context) SetTimeout(timeout time.Duration) + func (c *Context) SetValue(key interface{}, val interface{}) + func (c *Context) Stream(contentType string, r io.Reader) error + func (c *Context) String(s string) error + func (c *Context) XML(i interface{}) error + type Gas func(Handler) Handler + func WrapGas(h Handler) Gas + type Group struct + func NewGroup(a *Air, prefix string, gases ...Gas) *Group + func (g *Group) Contain(gases ...Gas) + func (g *Group) DELETE(path string, h Handler, gases ...Gas) + func (g *Group) File(path, file string) + func (g *Group) GET(path string, h Handler, gases ...Gas) + func (g *Group) NewSubGroup(prefix string, gases ...Gas) *Group + func (g *Group) POST(path string, h Handler, gases ...Gas) + func (g *Group) PUT(path string, h Handler, gases ...Gas) + func (g *Group) Static(prefix, root string) + type HTTPError struct + Code int + Message string + func NewHTTPError(code int, messages ...interface{}) *HTTPError + func (he *HTTPError) Error() string + type HTTPErrorHandler func(error, *Context) + type Handler func(*Context) error + func WrapHandler(h http.Handler) Handler + type Logger interface + Debug func(i ...interface{}) + Debugf func(format string, args ...interface{}) + Debugj func(m Map) + Error func(i ...interface{}) + Errorf func(format string, args ...interface{}) + Errorj func(m Map) + Fatal func(i ...interface{}) + Fatalf func(format string, args ...interface{}) + Fatalj func(m Map) + Info func(i ...interface{}) + Infof func(format string, args ...interface{}) + Infoj func(m Map) + Output func() io.Writer + Print func(i ...interface{}) + Printf func(format string, args ...interface{}) + Printj func(m Map) + SetOutput func(w io.Writer) + Warn func(i ...interface{}) + Warnf func(format string, args ...interface{}) + Warnj func(m Map) + type Map map[string]interface + type Minifier interface + Init func() error + Minify func(mimeType string, b []byte) ([]byte, error) + type Renderer interface + Init func() error + Render func(w io.Writer, templateName string, data Map) error + SetTemplateFunc func(name string, f interface{}) + type Request struct + URL *URL + func NewRequest(c *Context) *Request + func (r *Request) Bind(i interface{}) error + func (r *Request) FormValues() url.Values + func (r *Request) HasFormValue(key string) bool + func (r *Request) HasQueryValue(key string) bool + func (r *Request) QueryValue(key string) string + func (r *Request) QueryValues() url.Values + type Response struct + Data Map + Size int + StatusCode int + Written bool + func NewResponse(c *Context) *Response + func (r *Response) Attachment(file, filename string) error + func (r *Response) Blob(contentType string, b []byte) error + func (r *Response) File(file string) error + func (r *Response) HTML(html string) error + func (r *Response) Inline(file, filename string) error + func (r *Response) JSON(i interface{}) error + func (r *Response) JSONP(i interface{}, callback string) error + func (r *Response) NoContent() error + func (r *Response) Redirect(statusCode int, url string) error + func (r *Response) Render(templates ...string) error + func (r *Response) SetCookie(cookie *http.Cookie) + func (r *Response) Stream(contentType string, reader io.Reader) error + func (r *Response) String(s string) error + func (r *Response) Write(b []byte) (int, error) + func (r *Response) WriteHeader(statusCode int) + func (r *Response) XML(i interface{}) error + type URL struct + func NewURL(r *Request) *URL + func (u *URL) HasQueryValue(key string) bool + func (u *URL) QueryValue(key string) string + func (u *URL) QueryValues() url.Values