# Functions
AcquireCompressResponseWriter returns a CompressResponseWriter from the pool.
AcquireResponseRecorder returns a new *AcquireResponseRecorder from the pool.
AcquireResponseWriter returns a new *ResponseWriter from the pool.
AddCompressHeaders just adds the headers "Vary" to "Accept-Encoding" and "Content-Encoding" to the given encoding.
CookieAllowReclaim accepts the Context itself.
CookieAllowSubdomains set to the Cookie Options in order to allow subdomains to have access to the cookies.
CookieCleanPath is a `CookieOption`.
CookieDomain is a CookieOption which sets the cookie's Domain field.
CookieEncoding accepts a value which implements `Encode` and `Decode` methods.
CookieExpires is a `CookieOption`.
CookieHTTPOnly is a `CookieOption`.
CookieIncluded reports whether the "cookie.Name" is in the list of "cookieNames".
CookieOverride is a CookieOption which overrides the cookie explicitly to the given "cookie".
CookiePath is a `CookieOption`.
CookieSameSite sets a same-site rule for cookies to set.
CookieSecure sets the cookie's Secure option if the current request's connection is using TLS.
CopyHandlers returns a copy of "handlers" Handlers slice.
DecodeQuery returns the uri parameter as url (string) useful when you want to pass something to a database and be valid to retrieve it via context.Param use it only for special cases, when the default behavior doesn't suits you.
DecodeURL returns the decoded uri useful when you want to pass something to a database and be valid to retrieve it via context.Param use it only for special cases, when the default behavior doesn't suits you.
DefaultLogger returns a Logger instance for an Iris module.
FindNames accepts a "http.FileSystem" and a root name and returns the list containing its file names.
FormValueDefault retruns a single parsed form value.
GetApplication returns a registered Application based on its name.
GetApplications returns a slice of all the registered Applications.
GetBody reads and returns the request body.
GetEncoding extracts the best available encoding from the request.
GetForm returns the request form (url queries, post or multipart) values.
GetHost returns the host part of the current URI.
GetScheme returns the full scheme of the request URL (https://, http:// or ws:// and e.t.c.).
GetSubdomainFull returns the full subdomain level, e.g.
HandlerExists reports whether a handler exists in the "handlers" slice.
HandlerFileLine returns the handler's file and line information.
HandlerFileLineRel same as `HandlerFileLine` but it returns the path corresponding to its relative based on the package-level "WorkingDir" variable.
HandlerName returns the handler's function name.
HandlersNames returns a slice of "handlers" names separated by commas.
IgnoreHandlerName compares a static slice of Iris builtin internal methods that should be ignored from trace.
IsErrCanceled reports whether the "err" is caused by a cancellation or timeout.
IsErrPanicRecovery reports whether the given "err" is a type of ErrPanicRecovery.
IsNoOpFS reports whether the given "fileSystem" is a no operation fs.
IsZeroTime reports whether t is obviously unspecified (either zero or Unix()=0).
JoinHandlers returns a copy of "h1" and "h2" Handlers slice joined as one slice of Handlers.
LastApplication returns the last registered Application.
MainHandlerName tries to find the main handler that end-developer registered on the provided chain of handlers and returns its function name.
MakeDisposition generates an HTTP Content-Disposition field-value.
MustGetApplication same as `GetApplication` but it panics if "appName" is not a registered Application's name.
New creates and returns a new context pool.
NewCompressReader returns a new "compressReader" wrapper of "src".
NewCompressWriter returns a CompressWriter of "w" based on the given "encoding".
NewConditionalHandler returns a single Handler which can be registered as a middleware.
NewContext returns a new Context instance.
NewGlobalCounter returns a fresh instance of a global counter.
NewProblem retruns a new Problem.
OnApplicationRegistered adds a function which fires when a new application is registered.
ParamResolverByTypeAndIndex will return a function that can be used to bind path parameter's exact value by its Go std type and the parameter's index based on the registered path.
PrivateError accepts an error and returns a wrapped private one.
RegisterApplication registers an application to the global shared storage.
SafeFilename returns a safe filename based on the given name.
SetHandlerName sets a handler name that could be fetched through `HandlerName`.
StatusText returns a text for the HTTP status code.
TrimHeaderValue returns the "v[0:first space or semicolon]".
TrimParamFilePart is a middleware which replaces all route dynamic path parameters with values that do not contain any part after the last dot (.) character.
UpsertHandlers like `JoinHandlers` but it does NOT copies the handlers entries and it does remove duplicates.
XMLMap wraps a map[string]interface{} to compatible xml marshaler, in order to be able to render maps as XML on the `Context.XML` method.
# Constants
AcceptEncodingHeaderKey is the header key of "Accept-Encoding".
The available builtin compression algorithms.
CacheControlHeaderKey is the header key of "Cache-Control".
ContentBinaryHeaderValue header value for binary data.
ContentDispositionHeaderKey is the header key of "Content-Disposition".
ContentEncodingHeaderKey is the header key of "Content-Encoding".
ContentFormHeaderValue header value for post form data.
ContentFormMultipartHeaderValue header value for post multipart form data.
ContentGRPCHeaderValue Content-Type header value for gRPC.
ContentHTMLHeaderValue is the string of text/html response header's content type value.
ContentJavascriptHeaderValue header value for JSONP & Javascript data.
ContentJSONHeaderValue header value for JSON data.
ContentJSONProblemHeaderValue header value for JSON API problem error.
ContentLengthHeaderKey is the header key of "Content-Length".
ContentMarkdownHeaderValue custom key/content type, the real is the text/html.
ContentMsgPack2HeaderValue alternative header value for MsgPack data.
ContentMsgPackHeaderValue header value for MsgPack data.
ContentMultipartRelatedHeaderValue header value for multipart related data.
ContentProtobufHeaderValue header value for Protobuf messages data.
ContentTextHeaderValue header value for Text data.
ContentTypeHeaderKey is the header key of "Content-Type".
ContentWebassemblyHeaderValue header value for web assembly files.
ContentXMLHeaderValue header value for XML data.
ContentXMLProblemHeaderValue header value for XML API problem error.
ContentXMLUnreadableHeaderValue obselete header value for XML.
ContentYAMLHeaderValue header value for YAML data.
ContentYAMLTextHeaderValue header value for YAML plain text.
ControllerContextKey returns the context key from which the `Context.Controller` method returns the store's value.
CSRFTokenFormKey the CSRF token key of the form data.
The available builtin compression algorithms.
DependenciesContextKey is the context key for the context's value to keep the serve-time static dependencies raw values.
ETagHeaderKey is the header key of "ETag".
The available builtin compression algorithms.
GzipHeaderValue is the header value of "gzip".
IDENTITY no transformation whatsoever.
IfModifiedSinceHeaderKey is the header key of "If-Modified-Since".
LastModifiedHeaderKey is the header key of "Last-Modified".
NoWritten !=-1 => when nothing written before.
Set of Cookie actions for `CookieOption`.
Set of Cookie actions for `CookieOption`.
Set of Cookie actions for `CookieOption`.
Contains the available values of the goreferrer enums.
Contains the available values of the goreferrer enums.
Contains the available values of the goreferrer enums.
Contains the available values of the goreferrer enums.
Contains the available values of the goreferrer enums.
Contains the available values of the goreferrer enums.
Contains the available values of the goreferrer enums.
Contains the available values of the goreferrer enums.
Contains the available values of the goreferrer enums.
The available builtin compression algorithms.
The available builtin compression algorithms.
5xx.
Unofficial status error codes.
StatusCodeWritten != 0 => when only status code written.
Unofficial status error codes.
Unofficial status error codes.
Unofficial status error codes.
4xx.
Unofficial status error codes.
Unofficial status error codes.
Unofficial status error codes.
VaryHeaderKey is the header key of "Vary".
# Variables
AllEncodings is a slice of default content encodings.
BuildRevision holds the vcs commit id information of the program's build.
BuildTime holds the vcs commit time information of the program's build.
ClientAndServerErrorCodes is the static list of all client and server error codes.
ClientErrorCodes holds the 4xx Client errors.
ConnectionCloseErrorSubstr if at least one of the given substrings are found in a net.OpError:os.SyscallError error type on `IsErrConnectionReset` then the function will report true.
CookieExpireDelete may be set on Cookie.Expire for expiring the given cookie.
CookieExpireUnlimited indicates that does expires after 24 years.
it's not used anywhere, currently but it's here.
DefaultJSONOptions is the optional settings that are being used inside `Context.JSON`.
DefaultJSONPOptions is the optional settings that are being used inside `ctx.JSONP`.
DefaultMarkdownOptions is the optional settings that are being used from `WriteMarkdown` and `ctx.Markdown`.
DefaultProblemOptions the default options for `Context.Problem` method.
DefaultProblemStatusCode is being sent to the client when Problem's status is not a valid one.
DefaultXMLOptions is the optional settings that are being used from `ctx.XML`.
ErrContentNotSupported returns from the `Negotiate` method when server responds with 406.
ErrEmptyForm is returned by - `context#ReadForm` - `context#ReadQuery` - `context#ReadBody` when the request data (form, query and body respectfully) is empty.
ErrEmptyFormField reports whether a specific field exists but it's empty.
ErrHijackNotSupported is returned by the Hijack method to indicate that Hijack feature is not available.
ErrInvalidArgs fires when the `Context.CallFunc` is called with invalid number of arguments.
ErrNotFound is the type error which API users can make use of to check if a `Context` action of a `Handler` is type of Not Found, e.g.
ErrNotSupported is fired when a specific method is not implemented or not supported entirely.
ErrNotSupportedCompression returned from AcquireCompressResponseWriter, NewCompressWriter and NewCompressReader when the request's Accept-Encoding was not found in the server's supported compression algorithms.
ErrPreconditionFailed may be returned from `Context` methods that has to perform one or more client side preconditions before the actual check, e.g.
ErrPushNotSupported is returned by the Push method to indicate that HTTP/2 Push support is not available.
ErrRequestNotCompressed returned from NewCompressReader when request is not compressed.
ErrResponseNotCompressed returned from AcquireCompressResponseWriter when response's Content-Type header is missing due to golang/go/issues/31753 or when accept-encoding is empty.
FormatTime returns a textual representation of the time value formatted according to the Application's configuration's TimeFormat field which defines the format.
GetDomain resolves and returns the server's domain.
IsErrConnectionClosed reports whether the given "err" is caused because of a broken connection.
IsErrEmptyJSON reports whether the given "err" is caused by a Client.ReadJSON call when the request body was empty or didn't start with { or [.
IsErrPath can be used at `context#ReadForm` and `context#ReadQuery`.
IsErrPathCRSFToken reports whether the given "err" is caused by unknown key error on "csrf.token".
LimitRequestBodySize is a middleware which sets a request body size limit for all next handlers in the chain.
PackageName is the Iris Go module package name.
ParamResolvers is the global param resolution for a parameter type for a specific go std or custom type.
ParseTime parses a time header (such as the Date: header), trying each forth formats (or three if Application's configuration's TimeFormat is defaulted) that are allowed by HTTP/1.1: Application's configuration's TimeFormat or/and http.TimeFormat, time.RFC850, and time.ANSIC.
Recorder the middleware to enable response writer recording ( ResponseWriter -> ResponseRecorder).
ResolveFS accepts a single input argument of any type and tries to cast it to fs.FS.
ResolveHTTPFS accepts a single input argument of any type and tries to cast it to http.FileSystem.
ServerErrorCodes holds the 5xx Server errors.
SetCookieKVExpiration is 365 days by-default you can change it or simple, use the SetCookie for more control.
StatusCodeNotSuccessful defines if a specific "statusCode" is not a valid status code for a successful response.
ValidExtensionRegexp acts as an allowlist of valid extensions.
ValidFileNameRegexp is used to validate the user input by using a regular expression.
WorkingDir is the (initial) current directory.
WriteJSON marshals the given interface object and writes the JSON response to the 'writer'.
WriteJSONP marshals the given interface object and writes the JSONP response to the writer.
WriteMarkdown parses the markdown to html and writes these contents to the writer.
WriteXML marshals the given interface object and writes the XML response to the writer.
WriteYAML sends YAML response to the client.
# Structs
CompressReader is a structure which wraps a compressed reader.
CompressResponseWriter is a compressed data http.ResponseWriter.
Context is the midle-man server's "object" dealing with incoming requests.
ErrPanicRecovery may be returned from `Context` actions of a `Handler` which recovers from a manual panic.
ErrViewNotExist it's an error.
Func represents a function registered by the Context.
FuncMeta holds the necessary information about a registered context function.
GlobalCounter is a counter which atomically increments until Max.
JSON contains the options for the JSON (Context's) Renderer.
JSONP contains the options for the JSONP (Context's) Renderer.
JSONReader holds the JSON decode options of the `Context.ReadJSON, ReadBody` methods.
Markdown contains the options for the Markdown (Context's) Renderer.
N is a struct which can be passed on the `Context.Negotiate` method.
NameExpr regex or literal comparison through `MatchString`.
NegotiationAcceptBuilder builds the accepted mime types and charset
and "Accept-Charset" headers respectfully.
NegotiationBuilder returns from the `Context.Negotitation` and can be used inside chain of handlers to build server-side mime type(s), charset(s) and encoding algorithm(s) that should match with the client's Accept, Accept-Charset and Accept-Encoding headers (by-default).
Pool is the context pool, it's used inside router and the framework by itself.
ProblemOptions the optional settings when server replies with a Problem.
RequestParams is a key string - value string storage which context's request dynamic path params are being kept.
A ResponseRecorder is used mostly for testing in order to record and modify, if necessary, the body and status code and headers.
SimpleUser is a simple implementation of the User interface.
XML contains the options for the XML (Context's) Renderer.
# Interfaces
Application is the context's owner.
Component is the interface which all components must implement.
CompressWriter is an interface which all compress writers should implement.
ConfigurationReadOnly can be implemented by Configuration, it's being used inside the Context.
ContentNegotiator is the interface which structs can implement to override the `Context.Negotiate` default implementation and manually respond to the client based on a manuall call of `Context.Negotiation().Build()` to get the final negotiated mime and charset.
ContentSelector is the interface which structs can implement to manually choose a content based on the negotiated mime (content type).
ErrPrivate if provided then the error saved in context should NOT be visible to the client no matter what.
FallbackViewProvider is an interface which can be registered to the `Party.FallbackView` or `Context.FallbackView` methods to handle fallback views.
I18nReadOnly is the interface which contains the read-only i18n features.
Locale is the interface which returns from a `Localizer.GetLocale` method.
ResponseWriter interface is used by the context to serve an HTTP handler to construct an HTTP response.
ResponseWriterBodyReseter can be implemented by response writers that supports response body overriding (e.g.
ResponseWriterDisabler can be implemented by response writers that can be disabled and restored to their previous state (e.g.
ResponseWriterReseter can be implemented by response writers that can clear the whole response so a new handler can write into this from the beginning.
ResponseWriterWriteTo can be implemented by response writers that needs a special encoding before writing to their buffers.
RouteReadOnly allows decoupled access to the current route inside the context.
SecureCookie should encodes and decodes authenticated and optionally encrypted cookie values.
User is a generic view of an authorized client.
Validator is the validator for request body on Context methods such as ReadJSON, ReadMsgPack, ReadXML, ReadYAML, ReadForm, ReadQuery, ReadBody and e.t.c.
ViewEngine is the interface which all view engines should be implemented in order to be registered inside iris.
ViewEngineFuncer is an addition of a view engine, if a view engine implements that interface then iris can add some closed-relative iris functions like {{ url }}, {{ urlpath }} and {{ tr }}.
# Type aliases
CookieOption is the type of function that is accepted on context's methods like `SetCookieKV`, `RemoveCookie` and `SetCookie` as their (last) variadic input argument to amend the to-be-sent cookie.
DependenciesMap is the type which context serve-time struct dependencies are stored with.
FallbackView is a helper to register a single template filename as a fallback when the provided tempate filename was not found.
FallbackViewFunc is a function that can be registered to handle view fallbacks.
FallbackViewLayout is a helper to register a single template filename as a fallback layout when the provided layout filename was not found.
Filter is just a type of func(Context) bool which reports whether an action must be performed based on the incoming request.
A Handler responds to an HTTP request.
Handlers is just a type of slice of []Handler.
Map is just a type alias of the map[string]interface{} type.
Problem Details for HTTP APIs.
ProtoMarshalOptions is a type alias for protojson.MarshalOptions.
ProtoUnmarshalOptions is a type alias for protojson.UnmarshalOptions.
UserMap can be used to convert a common map[string]interface{} to a User.