Versions in this module Expand all Collapse all v6 v6.0.3 Jan 6, 2021 v6.0.2 Jan 6, 2021 v6.0.1 Jan 6, 2021 Changes in this version + const BestCompressionLevel + const BestSpeedLevel + const ConstantCompressionLevel + const DefaultCharset + const DefaultCompressionLevel + const DefaultDisablePathCorrection + const DefaultEnablePathEscape + const DefaultMaxHeaderBytes + const DefaultReadTimeout + const DefaultServerHostname + const DefaultServerPort + const DefaultWriteTimeout + const DynamicSubdomainIndicator + const MethodConnect + const MethodDelete + const MethodGet + const MethodHead + const MethodNone + const MethodOptions + const MethodPatch + const MethodPost + const MethodPut + const MethodTrace + const NoCompressionLevel + const NoLayout + const RouterNameConfigKey + const SchemeHTTP + const SchemeHTTPS + const StatusAccepted + const StatusAlreadyReported + const StatusBadGateway + const StatusBadRequest + const StatusConflict + const StatusContinue + const StatusCreated + const StatusExpectationFailed + const StatusFailedDependency + const StatusForbidden + const StatusFound + const StatusGatewayTimeout + const StatusGone + const StatusHTTPVersionNotSupported + const StatusIMUsed + const StatusInsufficientStorage + const StatusInternalServerError + const StatusLengthRequired + const StatusLocked + const StatusLoopDetected + const StatusMethodNotAllowed + const StatusMovedPermanently + const StatusMultiStatus + const StatusMultipleChoices + const StatusNetworkAuthenticationRequired + const StatusNoContent + const StatusNonAuthoritativeInfo + const StatusNotAcceptable + const StatusNotExtended + const StatusNotFound + const StatusNotImplemented + const StatusNotModified + const StatusOK + const StatusPartialContent + const StatusPaymentRequired + const StatusPermanentRedirect + const StatusPreconditionFailed + const StatusPreconditionRequired + const StatusProcessing + const StatusProxyAuthRequired + const StatusRequestEntityTooLarge + const StatusRequestHeaderFieldsTooLarge + const StatusRequestTimeout + const StatusRequestURITooLong + const StatusRequestedRangeNotSatisfiable + const StatusResetContent + const StatusSeeOther + const StatusServiceUnavailable + const StatusSwitchingProtocols + const StatusTeapot + const StatusTemporaryRedirect + const StatusTooManyRequests + const StatusUnauthorized + const StatusUnavailableForLegalReasons + const StatusUnprocessableEntity + const StatusUnsupportedMediaType + const StatusUpgradeRequired + const StatusUseProxy + const StatusVariantAlsoNegotiates + const TemplateLayoutContextKey + const Version + const ViewDataContextKey + const ViewLayoutContextKey + var AllMethods = [...]string + var DefaultServerAddr = DefaultServerHostname + ":" + strconv.Itoa(DefaultServerPort) + var DefaultTimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT" + var ErrPushNotSupported = errors.New("push feature is not supported by this ResponseWriter") + var LimitRequestBodySize = func(maxRequestBodySizeBytes int64) HandlerFunc + var OptionCharset = func(val string) OptionSet + var OptionCheckForUpdates = func(val bool) OptionSet + var OptionDisableBodyConsumptionOnUnmarshal = func(val bool) OptionSet + var OptionDisablePathCorrection = func(val bool) OptionSet + var OptionEnablePathEscape = func(val bool) OptionSet + var OptionFireMethodNotAllowed = func(val bool) OptionSet + var OptionGzip = func(val bool) OptionSet + var OptionMaxHeaderBytes = func(val int) OptionSet + var OptionOther = func(key string, val interface{}) OptionSet + var OptionReadTimeout = func(val time.Duration) OptionSet + var OptionTimeFormat = func(val string) OptionSet + var OptionVHost = func(val string) OptionSet + var OptionVScheme = func(val string) OptionSet + var OptionWriteTimeout = func(val time.Duration) OptionSet + var ProxyHandler = func(redirectSchemeAndHost string) http.HandlerFunc + var Recorder = HandlerFunc(func(ctx *Context) { ... }) + var RequestTransactionScope = TransactionScopeFunc(func(maybeErr TransactionErrResult, ctx *Context) bool { ... }) + var StaticCacheDuration = 20 * time.Second + var TransientTransactionScope = TransactionScopeFunc(func(maybeErr TransactionErrResult, ctx *Context) bool { ... }) + var TranslateFunctionContextKey = "translate" + var TranslateLanguageContextKey = "language" + func CERT(addr string, cert tls.Certificate) (net.Listener, error) + func CheckForUpdates(force bool) + func DecodeQuery(path string) string + func DecodeURL(uri string) string + func LETSENCRYPT(addr string, serverName string, cacheDirOptional ...string) (net.Listener, error) + func ParseHost(addr string) string + func ParseHostname(addr string) string + func ParsePort(addr string) int + func ParseScheme(domain string) string + func Proxy(proxyAddr string, redirectSchemeAndHost string) func(context.Context) error + func RouteConflicts(r RouteInfo, with string) bool + func StatusText(code int) string + func TCP4(addr string) (net.Listener, error) + func TCPKeepAlive(addr string) (net.Listener, error) + func TLS(addr, certFile, keyFile string) (net.Listener, error) + func ToNativeHandler(s *Framework, h Handler) http.Handler + func UNIX(socketFile string, mode os.FileMode) (net.Listener, error) + type BodyDecoder interface + Decode func(data []byte) error + type Configuration struct + Charset string + CheckForUpdates bool + DisableBodyConsumptionOnUnmarshal bool + DisablePathCorrection bool + EnablePathEscape bool + FireMethodNotAllowed bool + Gzip bool + MaxHeaderBytes int + Other map[string]interface{} + ReadTimeout time.Duration + TimeFormat string + VHost string + VScheme string + WriteTimeout time.Duration + func DefaultConfiguration() Configuration + func TOML(filename string) Configuration + func YAML(filename string) Configuration + func (c Configuration) Set(main *Configuration) + type Context struct + Middleware Middleware + Pos int + Request *http.Request + func (ctx *Context) BeginTransaction(pipe func(transaction *Transaction)) + func (ctx *Context) Data(status int, data []byte) error + func (ctx *Context) Deadline() (deadline time.Time, ok bool) + func (ctx *Context) Do() + func (ctx *Context) Done() <-chan struct{} + func (ctx *Context) EmitError(statusCode int) + func (ctx *Context) Err() error + func (ctx *Context) ExecRoute(r RouteInfo) + func (ctx *Context) ExecRouteAgainst(r RouteInfo, againstRequestPath string) + func (ctx *Context) FormFile(key string) (multipart.File, *multipart.FileHeader, error) + func (ctx *Context) FormValue(name string) string + func (ctx *Context) FormValues() map[string][]string + func (ctx *Context) Framework() *Framework + func (ctx *Context) Get(key string) interface{} + func (ctx *Context) GetCookie(name string) string + func (ctx *Context) GetHandlerName() string + func (ctx *Context) GetInt(key string) (int, error) + func (ctx *Context) GetString(key string) string + func (ctx *Context) HTML(status int, htmlContents string) error + func (ctx *Context) Host() string + func (ctx *Context) IsAjax() bool + func (ctx *Context) IsRecording() (*ResponseRecorder, bool) + func (ctx *Context) IsStopped() bool + func (ctx *Context) JSON(status int, v interface{}) error + func (ctx *Context) JSONP(status int, callback string, v interface{}) error + func (ctx *Context) Log(mode LogMode, format string, a ...interface{}) + func (ctx *Context) Markdown(status int, markdown string) error + func (ctx *Context) MarkdownString(markdownText string) string + func (ctx *Context) MaxAge() int64 + func (ctx *Context) Method() string + func (ctx *Context) MustRender(name string, binding interface{}, options ...map[string]interface{}) + func (ctx *Context) Next() + func (ctx *Context) NextHandler() Handler + func (ctx *Context) NotFound() + func (ctx *Context) Panic() + func (ctx *Context) Param(key string) string + func (ctx *Context) ParamDecoded(key string) string + func (ctx *Context) ParamInt(key string) (int, error) + func (ctx *Context) ParamInt64(key string) (int64, error) + func (ctx *Context) ParamIntWildcard(key string) (int, error) + func (ctx *Context) ParamValidate(compiledExpr *regexp.Regexp, paramName string) bool + func (ctx *Context) ParamsLen() (n int) + func (ctx *Context) ParamsSentence() string + func (ctx *Context) Path() string + func (ctx *Context) PostValue(name string) string + func (ctx *Context) ReadForm(formObject interface{}) error + func (ctx *Context) ReadJSON(jsonObject interface{}) error + func (ctx *Context) ReadXML(xmlObject interface{}) error + func (ctx *Context) Record() + func (ctx *Context) Recorder() *ResponseRecorder + func (ctx *Context) Redirect(urlToRedirect string, statusHeader ...int) + func (ctx *Context) RedirectTo(routeName string, args ...interface{}) + func (ctx *Context) RemoteAddr() string + func (ctx *Context) RemoveCookie(name string) + func (ctx *Context) Render(name string, binding interface{}, options ...map[string]interface{}) error + func (ctx *Context) RenderWithStatus(status int, name string, binding interface{}, ...) (err error) + func (ctx *Context) RequestHeader(k string) string + func (ctx *Context) RequestPath(escape bool) string + func (ctx *Context) SendFile(filename string, destinationName string) error + func (ctx *Context) ServeContent(content io.ReadSeeker, filename string, modtime time.Time, ...) error + func (ctx *Context) ServeFile(filename string, gzipCompression bool) error + func (ctx *Context) ServerHost() string + func (ctx *Context) Session() Session + func (ctx *Context) SessionDestroy() + func (ctx *Context) Set(key string, value interface{}) + func (ctx *Context) SetClientCachedBody(status int, bodyContent []byte, cType string, modtime time.Time) error + func (ctx *Context) SetContentType(s string) + func (ctx *Context) SetCookie(cookie *http.Cookie) + func (ctx *Context) SetCookieKV(name, value string) + func (ctx *Context) SetHeader(k string, v string) + func (ctx *Context) SetMaxRequestBodySize(limitOverBytes int64) + func (ctx *Context) SetStatusCode(statusCode int) + func (ctx *Context) SkipTransactions() + func (ctx *Context) StopExecution() + func (ctx *Context) StreamWriter(writer func(w io.Writer) bool) + func (ctx *Context) Subdomain() (subdomain string) + func (ctx *Context) Text(status int, text string) error + func (ctx *Context) TransactionsSkipped() bool + func (ctx *Context) Translate(format string, args ...interface{}) string + func (ctx *Context) TryWriteGzip(b []byte) (int, error) + func (ctx *Context) URLParam(key string) string + func (ctx *Context) URLParamInt(key string) (int, error) + func (ctx *Context) URLParamInt64(key string) (int64, error) + func (ctx *Context) URLParams() map[string]string + func (ctx *Context) URLParamsAsMulti() map[string][]string + func (ctx *Context) UnmarshalBody(v interface{}, unmarshaler Unmarshaler) error + func (ctx *Context) Value(key interface{}) interface{} + func (ctx *Context) ValuesLen() (n int) + func (ctx *Context) ViewData(key string, value interface{}) + func (ctx *Context) ViewLayout(layoutTmplFile string) + func (ctx *Context) VirtualHostname() string + func (ctx *Context) VisitAllCookies(visitor func(key string, value string)) + func (ctx *Context) VisitValues(visitor func(string, interface{})) + func (ctx *Context) WriteGzip(b []byte) (int, error) + func (ctx *Context) XML(status int, v interface{}) error + type ContextPool interface + Acquire func(w http.ResponseWriter, r *http.Request) *Context + Framework func() *Framework + Release func(ctx *Context) + Run func(w http.ResponseWriter, r *http.Request, runner func(ctx *Context)) + type ErrorHandlers struct + func (e *ErrorHandlers) Fire(statusCode int, ctx *Context) + func (e *ErrorHandlers) Get(statusCode int) Handler + func (e *ErrorHandlers) GetOrRegister(statusCode int) Handler + func (e *ErrorHandlers) Register(statusCode int, handler Handler) + func (e *ErrorHandlers) RegisterRegex(statusCode int, handler Handler, expr string) error + type EventListener func(*Framework) + type EventPolicy struct + Boot EventListener + Build EventListener + Interrupted EventListener + Recover func(*Framework, error) + func (e EventPolicy) Adapt(frame *Policies) + func (e EventPolicy) Fire(ln EventListener, s *Framework) bool + type Framework struct + Config *Configuration + ConnState func(net.Conn, http.ConnState) + Shutdown func(context.Context) error + TLSNextProto map[string]func(*http.Server, *tls.Conn, http.Handler) + var Default *Framework + var ResetDefault = func() { ... } + func New(setters ...OptionSetter) *Framework + func (s *Framework) Adapt(policies ...Policy) + func (s *Framework) Boot() (firstTime bool) + func (s *Framework) Cache(bodyHandler HandlerFunc, expiration time.Duration) HandlerFunc + func (s *Framework) Listen(addr string) + func (s *Framework) ListenLETSENCRYPT(addr string, cacheFileOptional ...string) + func (s *Framework) ListenTLS(addr string, certFile, keyFile string) + func (s *Framework) ListenUNIX(socketFile string, mode os.FileMode) + func (s *Framework) Log(mode LogMode, log string) + func (s *Framework) Must(err error) + func (s *Framework) Path(routeName string, args ...interface{}) string + func (s *Framework) Regex(pairParamExpr ...string) HandlerFunc + func (s *Framework) RegexSingle(paramName string, expr string, onFail HandlerFunc) HandlerFunc + func (s *Framework) Render(w io.Writer, name string, bind interface{}, options ...map[string]interface{}) error + func (s *Framework) RouteParam(paramName string) string + func (s *Framework) RouteWildcardPath(path string, paramName string) string + func (s *Framework) Serve(ln net.Listener) error + func (s *Framework) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Framework) Set(setters ...OptionSetter) + func (s *Framework) URL(routeName string, args ...interface{}) (url string) + type Handler interface + Serve func(ctx *Context) + type HandlerFunc func(*Context) + func Prioritize(r RouteInfo) HandlerFunc + func StaticHandler(systemPath string, showList bool, enableGzip bool, exceptRoutes ...RouteInfo) HandlerFunc + func StripPrefix(prefix string, h HandlerFunc) HandlerFunc + func ToHandler(handler interface{}) HandlerFunc + func (h HandlerFunc) Serve(ctx *Context) + type LogMode uint8 + const DevMode + const ProdMode + type LoggerPolicy func(mode LogMode, log string) + func DevLogger() LoggerPolicy + func (l LoggerPolicy) Adapt(frame *Policies) + func (l LoggerPolicy) ToLogger(flag int) *log.Logger + func (l LoggerPolicy) Write(p []byte) (n int, err error) + type Map map[string]interface + type MethodChangedListener func(routeInfo RouteInfo, oldMethod string) + type Middleware []Handler + type OptionSet func(c *Configuration) + func (o OptionSet) Set(c *Configuration) + type OptionSetter interface + Set func(c *Configuration) + type Policies struct + func (p Policies) Adapt(frame *Policies) + type Policy interface + Adapt func(frame *Policies) + type RenderOptions map[string]interface + type RenderPolicy func(out io.Writer, name string, bind interface{}, ...) (bool, error) + func (r RenderPolicy) Adapt(frame *Policies) + type ResponseRecorder struct + func (w *ResponseRecorder) Body() []byte + func (w *ResponseRecorder) Flush() + func (w *ResponseRecorder) Header() http.Header + func (w *ResponseRecorder) Push(target string, opts *http.PushOptions) error + func (w *ResponseRecorder) ReseAllHeaders() + func (w *ResponseRecorder) Reset() + func (w *ResponseRecorder) ResetBody() + func (w *ResponseRecorder) ResetHeaders() + func (w *ResponseRecorder) SetBody(b []byte) + func (w *ResponseRecorder) SetBodyString(s string) + func (w *ResponseRecorder) Write(contents []byte) (int, error) + func (w *ResponseRecorder) WriteString(s string) (n int, err error) + func (w *ResponseRecorder) Writef(format string, a ...interface{}) (n int, err error) + func (w ResponseRecorder) CloseNotify() <-chan bool + func (w ResponseRecorder) ContentType() string + func (w ResponseRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) + func (w ResponseRecorder) SetBeforeFlush(cb func()) + func (w ResponseRecorder) SetContentType(cType string) + func (w ResponseRecorder) StatusCode() int + func (w ResponseRecorder) WriteHeader(statusCode int) + type ResponseWriter interface + ContentType func() string + SetBeforeFlush func(cb func()) + SetContentType func(cType string) + StatusCode func() int + WriteString func(s string) (n int, err error) + Writef func(format string, a ...interface{}) (n int, err error) + type RouteInfo interface + AllowOPTIONS func() RouteInfo + ChangeName func(name string) RouteInfo + HasCors func() bool + IsOnline func() bool + Method func() string + Middleware func() Middleware + Name func() string + Path func() string + Subdomain func() string + type RouteRepository interface + ChangeMethod func(routeInfo RouteInfo, newMethod string) + ChangeMiddleware func(routeInfo RouteInfo, newMiddleware Middleware) + ChangeName func(routeInfo RouteInfo, newName string) + ChangePath func(routeInfo RouteInfo, newPath string) + type Router struct + Context ContextPool + Errors *ErrorHandlers + func (router *Router) Any(registeredPath string, handlersFn ...HandlerFunc) + func (router *Router) Connect(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Delete(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Done(handlers ...Handler) *Router + func (router *Router) DoneFunc(handlersFn ...HandlerFunc) *Router + func (router *Router) EmitError(statusCode int, ctx *Context) + func (router *Router) Favicon(favPath string, requestPath ...string) RouteInfo + func (router *Router) Get(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Handle(method string, registeredPath string, handlers ...Handler) RouteInfo + func (router *Router) HandleFunc(method string, registeredPath string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Head(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Layout(tmplLayoutFile string) *Router + func (router *Router) None(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) OnError(statusCode int, handlerFn HandlerFunc, rgexp ...string) + func (router *Router) Options(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Party(relativePath string, handlersFn ...HandlerFunc) *Router + func (router *Router) Patch(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Post(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Put(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Routes() RoutesInfo + func (router *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (router *Router) StaticContent(reqPath string, cType string, content []byte) RouteInfo + func (router *Router) StaticEmbedded(requestPath string, vdir string, assetFn func(name string) ([]byte, error), ...) RouteInfo + func (router *Router) StaticHandler(reqPath string, systemPath string, showList bool, enableGzip bool, ...) HandlerFunc + func (router *Router) StaticServe(systemPath string, requestPath ...string) RouteInfo + func (router *Router) StaticWeb(reqPath string, systemPath string, exceptRoutes ...RouteInfo) RouteInfo + func (router *Router) Trace(path string, handlersFn ...HandlerFunc) RouteInfo + func (router *Router) Use(handlers ...Handler) *Router + func (router *Router) UseFunc(handlersFn ...HandlerFunc) *Router + func (router *Router) UseGlobal(handlers ...Handler) + func (router *Router) UseGlobalFunc(handlersFn ...HandlerFunc) + type RouterBuilderPolicy func(repo RouteRepository, cPool ContextPool) http.Handler + func (r RouterBuilderPolicy) Adapt(frame *Policies) + type RouterReversionPolicy struct + Param func(paramName string) string + StaticPath func(path string) string + URLPath func(r RouteInfo, args ...string) string + WildcardPath func(path string, paramName string) string + func (r RouterReversionPolicy) Adapt(frame *Policies) + type RouterWrapperPolicy func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) + func (rw RouterWrapperPolicy) Adapt(frame *Policies) + type RoutesInfo interface + Lookup func(routeName string) RouteInfo + Offline func(routeInfo RouteInfo) bool + OnMethodChanged func(methodChangedListener MethodChangedListener) + Online func(routeInfo RouteInfo, HTTPMethod string) bool + Visit func(visitor func(RouteInfo)) + type Session interface + Clear func() + ClearFlashes func() + Delete func(string) + DeleteFlash func(string) + Get func(string) interface{} + GetAll func() map[string]interface{} + GetBoolean func(key string) (bool, error) + GetFlash func(string) interface{} + GetFlashString func(string) string + GetFlashes func() map[string]interface{} + GetFloat32 func(key string) (float32, error) + GetFloat64 func(key string) (float64, error) + GetInt func(key string) (int, error) + GetInt64 func(key string) (int64, error) + GetString func(key string) string + HasFlash func() bool + ID func() string + Set func(string, interface{}) + SetFlash func(string, interface{}) + VisitAll func(cb func(k string, v interface{})) + type SessionsPolicy struct + Destroy func(http.ResponseWriter, *http.Request) + Start func(http.ResponseWriter, *http.Request) Session + func (s SessionsPolicy) Adapt(frame *Policies) + type StaticHandlerBuilder interface + Build func() HandlerFunc + Except func(r ...RouteInfo) StaticHandlerBuilder + Gzip func(enable bool) StaticHandlerBuilder + Listing func(listDirectoriesOnOff bool) StaticHandlerBuilder + func NewStaticHandlerBuilder(dir string) StaticHandlerBuilder + type TCPKeepAliveListener struct + func (ln TCPKeepAliveListener) Accept() (c net.Conn, err error) + type TemplateFuncsPolicy map[string]interface + func (t TemplateFuncsPolicy) Adapt(frame *Policies) + type Transaction struct + Context *Context + func (t *Transaction) Complete(err error) + func (t *Transaction) SetScope(scope TransactionScope) + type TransactionErrResult struct + ContentType string + Reason string + StatusCode int + func NewTransactionErrResult() TransactionErrResult + func (err TransactionErrResult) Error() string + func (err TransactionErrResult) IsFailure() bool + type TransactionScope interface + EndTransaction func(maybeErr TransactionErrResult, ctx *Context) bool + type TransactionScopeFunc func(maybeErr TransactionErrResult, ctx *Context) bool + func (tsf TransactionScopeFunc) EndTransaction(maybeErr TransactionErrResult, ctx *Context) bool + type Unmarshaler interface + Unmarshal func(data []byte, v interface{}) error + type UnmarshalerFunc func(data []byte, v interface{}) error + func (u UnmarshalerFunc) Unmarshal(data []byte, v interface{}) error Other modules containing this package github.com/h4tr3d/iris