Documentation
¶
Index ¶
- type App
- func (app *App) CONNECT(path string, h Handler, mws ...Middleware)
- func (app *App) DELETE(path string, h Handler, mws ...Middleware)
- func (app *App) GET(path string, h Handler, mws ...Middleware)
- func (app *App) Group(prefix string, mws ...Middleware) *Group
- func (app *App) HEAD(path string, h Handler, mws ...Middleware)
- func (app *App) Handle(method, path string, h Handler, mws ...Middleware)
- func (app *App) OPTIONS(path string, h Handler, mws ...Middleware)
- func (app *App) PATCH(path string, h Handler, mws ...Middleware)
- func (app *App) POST(path string, h Handler, mws ...Middleware)
- func (app *App) PUT(path string, h Handler, mws ...Middleware)
- func (app *App) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (app *App) SetErrorHandler(errorHandler ErrorHandler)
- func (app *App) SetGlobalOptionsHandler(globalOptionsHandler Handler)
- func (app *App) SetMethodNotAllowedHandler(methodNotAllowedHandler Handler)
- func (app *App) SetNotFoundHandler(notFoundHandler Handler)
- func (app *App) SetRedirectFixedPath(redirectFixedPath bool)
- func (app *App) SetRedirectTrailingSlash(redirectTrailingSlash bool)
- func (app *App) SetServerIdleTimeout(idleTimeout time.Duration)
- func (app *App) SetServerMaxHeaderBytes(maxHeaderBytes int)
- func (app *App) SetServerReadHeaderTimeout(readHeaderTimeout time.Duration)
- func (app *App) SetServerReadTimeout(readTimeout time.Duration)
- func (app *App) SetServerShutdownTimeout(shutdownTimeout time.Duration)
- func (app *App) SetServerWriteTimeout(writeTimeout time.Duration)
- func (app *App) Start(listenAddr string) error
- func (app *App) StartTLS(listenAddr, certFile, keyFile string) error
- func (app *App) Static(prefix, root string, mws ...Middleware)
- func (app *App) StaticFS(prefix string, fs http.FileSystem, mws ...Middleware)
- func (app *App) TRACE(path string, h Handler, mws ...Middleware)
- func (app *App) Use(mws ...Middleware)
- type CORSConfig
- type Context
- func (ctx *Context) AddHeader(name, value string)
- func (ctx *Context) BasicAuth() (string, string, bool)
- func (ctx *Context) Body() io.ReadCloser
- func (ctx *Context) Bytes(status int, contentType string, body []byte) error
- func (ctx *Context) ContentType() string
- func (ctx *Context) Cookie(name string) (*http.Cookie, error)
- func (ctx *Context) Cookies() []*http.Cookie
- func (ctx *Context) DecodeForm(destination any) error
- func (ctx *Context) DecodeJSON(destination any) error
- func (ctx *Context) DecodeXML(destination any) error
- func (ctx *Context) DeleteCookie(cookie *http.Cookie)
- func (ctx *Context) DeleteHeader(name string)
- func (ctx *Context) DeleteValue(key string)
- func (ctx *Context) File(path string) error
- func (ctx *Context) Flush() error
- func (ctx *Context) FormFile(name string) (multipart.File, *multipart.FileHeader, error)
- func (ctx *Context) FormValue(name string) string
- func (ctx *Context) FormValues(name string) ([]string, error)
- func (ctx *Context) Forms() (url.Values, error)
- func (ctx *Context) HTML(status int, value string) error
- func (ctx *Context) HasQuery(name string) bool
- func (ctx *Context) Header(name string) string
- func (ctx *Context) Headers() http.Header
- func (ctx *Context) Host() string
- func (ctx *Context) IsTLS() bool
- func (ctx *Context) JSON(status int, value any) error
- func (ctx *Context) LimitBody(maxBytes int64)
- func (ctx *Context) Method() string
- func (ctx *Context) MultipartForm(maxMemory int64) (*multipart.Form, error)
- func (ctx *Context) MultipartReader() (*multipart.Reader, error)
- func (ctx *Context) NoContent(status int) error
- func (ctx *Context) Param(name string) string
- func (ctx *Context) Params() map[string]string
- func (ctx *Context) ParseForm() error
- func (ctx *Context) ParseQuery() (url.Values, error)
- func (ctx *Context) Path() string
- func (ctx *Context) Queries() url.Values
- func (ctx *Context) Query(name string) string
- func (ctx *Context) QueryValues(name string) []string
- func (ctx *Context) Redirect(status int, location string)
- func (ctx *Context) RemoteIP() string
- func (ctx *Context) Render(status int, component templ.Component) error
- func (ctx *Context) Request() *http.Request
- func (ctx *Context) RequestContext() context.Context
- func (ctx *Context) Response() http.ResponseWriter
- func (ctx *Context) ResponseHeader(name string) string
- func (ctx *Context) Scheme() string
- func (ctx *Context) SetContentType(contentType string)
- func (ctx *Context) SetCookie(cookie *http.Cookie)
- func (ctx *Context) SetHeader(name, value string)
- func (ctx *Context) SetRequestContext(c context.Context)
- func (ctx *Context) SetValue(key string, value any)
- func (ctx *Context) Size() int64
- func (ctx *Context) Status() int
- func (ctx *Context) Stream(status int, contentType string, reader io.Reader) error
- func (ctx *Context) String(status int, value string) error
- func (ctx *Context) Validate(value any) error
- func (ctx *Context) Value(key string) (any, bool)
- func (ctx *Context) Values() map[string]any
- func (ctx *Context) WriteHeader(status int)
- func (ctx *Context) Written() bool
- func (ctx *Context) XML(status int, value any) error
- type ErrorHandler
- type Group
- func (g *Group) CONNECT(path string, h Handler, mws ...Middleware)
- func (g *Group) DELETE(path string, h Handler, mws ...Middleware)
- func (g *Group) GET(path string, h Handler, mws ...Middleware)
- func (g *Group) Group(prefix string, mws ...Middleware) *Group
- func (g *Group) HEAD(path string, h Handler, mws ...Middleware)
- func (g *Group) Handle(method, path string, h Handler, mws ...Middleware)
- func (g *Group) OPTIONS(path string, h Handler, mws ...Middleware)
- func (g *Group) PATCH(path string, h Handler, mws ...Middleware)
- func (g *Group) POST(path string, h Handler, mws ...Middleware)
- func (g *Group) PUT(path string, h Handler, mws ...Middleware)
- func (g *Group) TRACE(path string, h Handler, mws ...Middleware)
- func (g *Group) Use(mws ...Middleware)
- type Handler
- type Map
- type Middleware
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) SetErrorHandler ¶
func (app *App) SetErrorHandler(errorHandler ErrorHandler)
func (*App) SetGlobalOptionsHandler ¶
func (*App) SetMethodNotAllowedHandler ¶
func (*App) SetNotFoundHandler ¶
func (*App) SetRedirectFixedPath ¶
func (*App) SetRedirectTrailingSlash ¶
func (*App) SetServerIdleTimeout ¶
func (*App) SetServerMaxHeaderBytes ¶
func (*App) SetServerReadHeaderTimeout ¶
func (*App) SetServerReadTimeout ¶
func (*App) SetServerShutdownTimeout ¶
func (*App) SetServerWriteTimeout ¶
func (*App) Static ¶
func (app *App) Static(prefix, root string, mws ...Middleware)
func (*App) StaticFS ¶
func (app *App) StaticFS(prefix string, fs http.FileSystem, mws ...Middleware)
func (*App) Use ¶
func (app *App) Use(mws ...Middleware)
type CORSConfig ¶ added in v1.1.0
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) Body ¶
func (ctx *Context) Body() io.ReadCloser
---------------------------------------------------------------------- Request body ----------------------------------------------------------------------
func (*Context) Bytes ¶
---------------------------------------------------------------------- Response bodies ----------------------------------------------------------------------
func (*Context) ContentType ¶
func (*Context) Cookie ¶
---------------------------------------------------------------------- Request cookies ----------------------------------------------------------------------
func (*Context) DecodeForm ¶ added in v1.2.0
func (*Context) DecodeJSON ¶
func (*Context) DeleteCookie ¶
func (*Context) DeleteHeader ¶
func (*Context) DeleteValue ¶
func (*Context) File ¶
---------------------------------------------------------------------- Files ----------------------------------------------------------------------
func (*Context) Header ¶
---------------------------------------------------------------------- Request headers ----------------------------------------------------------------------
func (*Context) Method ¶
---------------------------------------------------------------------- Request metadata ----------------------------------------------------------------------
func (*Context) MultipartForm ¶
---------------------------------------------------------------------- Multipart forms and uploads ----------------------------------------------------------------------
func (*Context) Param ¶
---------------------------------------------------------------------- Routing ----------------------------------------------------------------------
func (*Context) ParseForm ¶
---------------------------------------------------------------------- Forms ----------------------------------------------------------------------
func (*Context) Query ¶
---------------------------------------------------------------------- Query parameters ----------------------------------------------------------------------
func (*Context) QueryValues ¶
func (*Context) Redirect ¶
---------------------------------------------------------------------- Redirects ----------------------------------------------------------------------
func (*Context) Request ¶
---------------------------------------------------------------------- Core ----------------------------------------------------------------------
func (*Context) RequestContext ¶
---------------------------------------------------------------------- Standard context ----------------------------------------------------------------------
func (*Context) Response ¶
func (ctx *Context) Response() http.ResponseWriter
func (*Context) ResponseHeader ¶
---------------------------------------------------------------------- Response headers ----------------------------------------------------------------------
func (*Context) SetContentType ¶
func (*Context) SetCookie ¶
---------------------------------------------------------------------- Response cookies ----------------------------------------------------------------------
func (*Context) SetRequestContext ¶
func (*Context) SetValue ¶
---------------------------------------------------------------------- Request-scoped values ----------------------------------------------------------------------
func (*Context) Status ¶
---------------------------------------------------------------------- Response state ----------------------------------------------------------------------
func (*Context) Stream ¶
---------------------------------------------------------------------- Streaming ----------------------------------------------------------------------
func (*Context) Validate ¶ added in v1.2.0
---------------------------------------------------------------------- Validation ----------------------------------------------------------------------
func (*Context) WriteHeader ¶
---------------------------------------------------------------------- Response status ----------------------------------------------------------------------
type ErrorHandler ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) Use ¶
func (g *Group) Use(mws ...Middleware)
type Middleware ¶
func BodyLimit ¶ added in v1.1.0
func BodyLimit(maxBytes int64) Middleware
func CORS ¶ added in v1.1.0
func CORS(config CORSConfig) Middleware
func Recovery ¶ added in v1.1.0
func Recovery() Middleware
type Router ¶
type Router interface {
Use(mws ...Middleware)
Group(prefix string, mws ...Middleware) *Group
Handle(method, path string, h Handler, mws ...Middleware)
CONNECT(path string, h Handler, mws ...Middleware)
DELETE(path string, h Handler, mws ...Middleware)
GET(path string, h Handler, mws ...Middleware)
HEAD(path string, h Handler, mws ...Middleware)
OPTIONS(path string, h Handler, mws ...Middleware)
PATCH(path string, h Handler, mws ...Middleware)
POST(path string, h Handler, mws ...Middleware)
PUT(path string, h Handler, mws ...Middleware)
TRACE(path string, h Handler, mws ...Middleware)
}