Documentation
¶
Index ¶
- Constants
- Variables
- type App
- func (a *App) DELETE(path string, handlers ...HandlerFunc)
- func (a *App) GET(path string, handlers ...HandlerFunc)
- func (a *App) Group(prefix string, m ...HandlerFunc) (g *Group)
- func (a *App) HEAD(path string, handlers ...HandlerFunc)
- func (a *App) Listen(addr string) error
- func (a *App) ListenTLS(addr, cert, key string) error
- func (a *App) OPTIONS(path string, handlers ...HandlerFunc)
- func (a *App) PATCH(path string, handlers ...HandlerFunc)
- func (a *App) POST(path string, handlers ...HandlerFunc)
- func (a *App) PUT(path string, handlers ...HandlerFunc)
- func (a *App) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (a *App) Use(handlers ...HandlerFunc)
- type Config
- type CookieOptions
- type Ctx
- type ErrorHandler
- type Group
- func (g *Group) DELETE(path string, handlers ...HandlerFunc)
- func (g *Group) GET(path string, handlers ...HandlerFunc)
- func (g *Group) Group(prefix string, m ...HandlerFunc) (group *Group)
- func (g *Group) HEAD(path string, handlers ...HandlerFunc)
- func (g *Group) OPTIONS(path string, handlers ...HandlerFunc)
- func (g *Group) PATCH(path string, handlers ...HandlerFunc)
- func (g *Group) POST(path string, handlers ...HandlerFunc)
- func (g *Group) PUT(path string, handlers ...HandlerFunc)
- func (g *Group) Use(middleware ...HandlerFunc)
- type HandlerFunc
- type MethodNotAllowedHandler
- type NotFoundHandler
- type OptionsHandler
- type Param
- type ParamValues
- type Range
- type RangeResult
- type Req
- func (req *Req) Accepts(types ...string) string
- func (req *Req) AcceptsCharsets(charsets ...string) string
- func (req *Req) AcceptsEncodings(encodings ...string) string
- func (req *Req) AcceptsLanguages(langs ...string) string
- func (req *Req) BaseURL() string
- func (r *Req) Body() ([]byte, error)
- func (req *Req) BodyJSON(v any) error
- func (r *Req) BodyReader() (io.ReadCloser, error)
- func (req *Req) Context() context.Context
- func (req *Req) Cookie(name string) (*http.Cookie, error)
- func (req *Req) Cookies() []*http.Cookie
- func (req *Req) FormFile(key string) (multipart.File, *multipart.FileHeader, error)
- func (req *Req) FormFiles(key string) ([]*multipart.FileHeader, error)
- func (req *Req) FormValue(key string) string
- func (req *Req) FormValues() map[string][]string
- func (req *Req) Fresh() bool
- func (req *Req) Get(name string) string
- func (req *Req) Header(name string) string
- func (req *Req) Headers() http.Header
- func (req *Req) Host() string
- func (req *Req) Hostname() string
- func (req *Req) IP() string
- func (req *Req) IPs() []string
- func (req *Req) Method() string
- func (req *Req) MultipartReader() (*multipart.Reader, error)
- func (req *Req) OriginalURL() string
- func (req *Req) Param(key string) string
- func (req *Req) Params() []Param
- func (req *Req) Path() string
- func (req *Req) Protocol() string
- func (req *Req) Query(key string) string
- func (req *Req) QueryAll() url.Values
- func (req *Req) Range(size int64, combine ...bool) (*RangeResult, error)
- func (req *Req) Secure() bool
- func (req *Req) Stale() bool
- func (req *Req) Subdomains() []string
- func (req *Req) XHR() bool
- type Res
- func (res *Res) AddHeader(key, value string) *Res
- func (res *Res) Attachment(filename ...string) *Res
- func (res *Res) ClearCookie(name string, opts ...CookieOptions) *Res
- func (res *Res) DeleteHeader(key string) *Res
- func (res *Res) Download(path string, filename ...string) error
- func (res *Res) DownloadFS(fsys http.FileSystem, path string, filename ...string) error
- func (res *Res) Format(handlers map[string]func() error) error
- func (res *Res) GetHeader(key string) string
- func (res *Res) JSON(body any) error
- func (res *Res) JSONP(body any, callback string) error
- func (res *Res) Links(links map[string]string) *Res
- func (res *Res) Location(url string) *Res
- func (res *Res) Redirect(url string, code ...int) error
- func (res *Res) ResponseStatus() int
- func (res *Res) Send(body any) error
- func (res *Res) SendBytes(body []byte) error
- func (res *Res) SendFile(path string, opts ...SendFileOptions) error
- func (res *Res) SendFileFS(fsys http.FileSystem, path string) error
- func (res *Res) SendStatus(code int) error
- func (res *Res) SendString(body string) error
- func (res *Res) SetCookie(name, value string, opts ...CookieOptions) *Res
- func (res *Res) SetHeader(key, value string) *Res
- func (res *Res) Status(code int) *Res
- func (res *Res) Type(t string) *Res
- func (res *Res) Vary(field string) *Res
- type Router
- type SendFileOptions
- type ServerConfig
Constants ¶
View Source
const ( RangeUnsatisfiable = -1 RangeMalformed = -2 )
View Source
const ( HeaderTransferEncoding = "Transfer-Encoding" HeaderContentType = "Content-Type" HeaderContentLength = "Content-Length" HeaderLink = "Link" HeaderContentDisposition = "Content-Disposition" HeaderXContentTypeOptions = "X-Content-Type-Options" HeaderReferer = "Referer" HeaderLocation = "Location" HeaderVary = "Vary" HeaderCacheControl = "Cache-Control" )
View Source
const (
MB int64 = 1 << 20
)
View Source
const (
Version = "0.4.0"
)
Variables ¶
View Source
var ( ErrBodyAlreadyRead = errors.New("aero: request body already read") ErrBodyTooLarge = errors.New("aero: request body too large") ErrBodyEmpty = errors.New("aero: request body is empty") ErrFormAlreadyParsed = errors.New("aero: form already parsed") ErrNotMultipart = errors.New("aero: content type is not multipart/form-data") ErrRangeNotPresent = errors.New("aero: Range header not present") ErrRangeUnsatisfiable = errors.New("aero: range not satisfiable") ErrRangeMalformed = errors.New("aero: range header malformed") ErrUnsupportedMediaType = errors.New("aero: unsupported content encoding") )
View Source
var ( ErrFileNotFound = errors.New("aero: file not found") ErrIsDirectory = errors.New("aero: path is a directory") ErrPathRequired = errors.New("aero: path is required") ErrPathNotAbsolute = errors.New("aero: path must be absolute or root must be specified") )
View Source
var ErrTLSCertRequired = errors.New("aero: TLS cert and key are required")
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
NotFoundHandler NotFoundHandler
MethodNotAllowedHandler MethodNotAllowedHandler
ErrorHandler ErrorHandler
OptionsHandler OptionsHandler
// contains filtered or unexported fields
}
func (*App) DELETE ¶
func (a *App) DELETE(path string, handlers ...HandlerFunc)
func (*App) GET ¶
func (a *App) GET(path string, handlers ...HandlerFunc)
func (*App) HEAD ¶
func (a *App) HEAD(path string, handlers ...HandlerFunc)
func (*App) OPTIONS ¶
func (a *App) OPTIONS(path string, handlers ...HandlerFunc)
func (*App) PATCH ¶
func (a *App) PATCH(path string, handlers ...HandlerFunc)
func (*App) POST ¶
func (a *App) POST(path string, handlers ...HandlerFunc)
func (*App) PUT ¶
func (a *App) PUT(path string, handlers ...HandlerFunc)
func (*App) Use ¶
func (a *App) Use(handlers ...HandlerFunc)
type CookieOptions ¶
type ErrorHandler ¶ added in v0.2.0
type Group ¶ added in v0.4.0
type Group struct {
// contains filtered or unexported fields
}
func (*Group) DELETE ¶ added in v0.4.0
func (g *Group) DELETE(path string, handlers ...HandlerFunc)
func (*Group) GET ¶ added in v0.4.0
func (g *Group) GET(path string, handlers ...HandlerFunc)
func (*Group) Group ¶ added in v0.4.0
func (g *Group) Group(prefix string, m ...HandlerFunc) (group *Group)
func (*Group) HEAD ¶ added in v0.4.0
func (g *Group) HEAD(path string, handlers ...HandlerFunc)
func (*Group) OPTIONS ¶ added in v0.4.0
func (g *Group) OPTIONS(path string, handlers ...HandlerFunc)
func (*Group) PATCH ¶ added in v0.4.0
func (g *Group) PATCH(path string, handlers ...HandlerFunc)
func (*Group) POST ¶ added in v0.4.0
func (g *Group) POST(path string, handlers ...HandlerFunc)
func (*Group) PUT ¶ added in v0.4.0
func (g *Group) PUT(path string, handlers ...HandlerFunc)
func (*Group) Use ¶ added in v0.4.0
func (g *Group) Use(middleware ...HandlerFunc)
type HandlerFunc ¶
type MethodNotAllowedHandler ¶ added in v0.2.0
type NotFoundHandler ¶ added in v0.2.0
type NotFoundHandler func(c *Ctx)
type OptionsHandler ¶ added in v0.3.0
type ParamValues ¶
type ParamValues [maxParamCount]Param
type RangeResult ¶
type Req ¶
type Req struct {
// contains filtered or unexported fields
}
func (*Req) AcceptsCharsets ¶
func (*Req) AcceptsEncodings ¶
func (*Req) AcceptsLanguages ¶
func (*Req) BodyReader ¶
func (r *Req) BodyReader() (io.ReadCloser, error)
func (*Req) FormValues ¶
func (*Req) OriginalURL ¶
func (*Req) Subdomains ¶
type Res ¶
type Res struct {
// contains filtered or unexported fields
}
func (*Res) Attachment ¶
func (*Res) ClearCookie ¶
func (res *Res) ClearCookie(name string, opts ...CookieOptions) *Res
func (*Res) DeleteHeader ¶
func (*Res) DownloadFS ¶
func (*Res) ResponseStatus ¶
func (*Res) SendFileFS ¶
func (res *Res) SendFileFS(fsys http.FileSystem, path string) error
func (*Res) SendStatus ¶
func (*Res) SendString ¶
type SendFileOptions ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.