Versions in this module Expand all Collapse all v0 v0.0.3 Nov 15, 2022 v0.0.2 Nov 15, 2022 v0.0.1 Sep 15, 2022 Changes in this version + const AcceptEncodingHeaderKey + const CacheControlHeaderKey + const ContentBinaryHeaderValue + const ContentDispositionHeaderKey + const ContentEncodingHeaderKey + const ContentFormHeaderValue + const ContentFormMultipartHeaderValue + const ContentHTMLHeaderValue + const ContentJSONHeaderValue + const ContentJSONProblemHeaderValue + const ContentJavascriptHeaderValue + const ContentLengthHeaderKey + const ContentMarkdownHeaderValue + const ContentTextHeaderValue + const ContentTypeHeaderKey + const ContentWebassemblyHeaderValue + const ContentXMLHeaderValue + const ContentXMLProblemHeaderValue + const ContentXMLUnreadableHeaderValue + const ContentYAMLHeaderValue + const ETagHeaderKey + const GzipHeaderValue + const IfModifiedSinceHeaderKey + const LastModifiedHeaderKey + const NoLayout + const NoWritten + const ReferrerDirect + const ReferrerEmail + const ReferrerGoogleAdwords + const ReferrerGoogleOrganicSearch + const ReferrerIndirect + const ReferrerInvalid + const ReferrerNotGoogleSearch + const ReferrerSearch + const ReferrerSocial + const StatusCodeWritten + const VaryHeaderKey + var DefaultJSONOptions = JSON + var DefaultJSONPOptions = JSONP + var DefaultMarkdownOptions = Markdown + var DefaultProblemOptions = ProblemOptions + var DefaultProblemStatusCode = http.StatusBadRequest + var DefaultXMLOptions = XML + var ErrContentNotSupported = errors.New("unsupported content") + var ErrGzipNotSupported = errors.New("client does not support gzip compression") + var ErrNotFound = errors.New("not found") + var ErrPreconditionFailed = errors.New("precondition failed") + var ErrPushNotSupported = errors.New("push feature is not supported by this ResponseWriter") + var ErrTransactionInterrupt = errors.New("transaction interrupted") + var FormatTime = func(ctx Context, t time.Time) string + var Gzip = func(ctx Context) + var IsErrPath = schema.IsErrPath + var LimitRequestBodySize = func(maxRequestBodySizeBytes int64) Handler + var Next = DefaultNext + var ParamResolvers = map[reflect.Type]func(paramIndex int) interface + var ParseTime = func(ctx Context, text string) (t time.Time, err error) + var Recorder = func(ctx Context) + var RequestTransactionScope = TransactionScopeFunc(func(maybeErr TransactionErrResult, ctx Context) bool { ... }) + var SetCookieKVExpiration = time.Duration(8760) * time.Hour + var StatusCodeNotSuccessful = func(statusCode int) bool + var TransientTransactionScope = TransactionScopeFunc(func(maybeErr TransactionErrResult, ctx Context) bool { ... }) + func AddGzipHeaders(w ResponseWriter) + func CookieCleanPath(c *http.Cookie) + func DecodeQuery(path string) string + func DecodeURL(uri string) string + func DefaultNext(ctx Context) + func Do(ctx Context, handlers Handlers) + func FormValueDefault(r *http.Request, name string, def string, postMaxMemory int64, resetBody bool) string + func GetBody(r *http.Request, resetBody bool) ([]byte, error) + func GetForm(r *http.Request, postMaxMemory int64, resetBody bool) (form map[string][]string, found bool) + func GetHost(r *http.Request) string + func HandlerFileLine(h Handler) (file string, line int) + func HandlerName(h Handler) string + func IsZeroTime(t time.Time) bool + func LastCapturedContextID() uint64 + func MainHandlerName(handlers Handlers) (name string) + func ParamResolverByTypeAndIndex(typ reflect.Type, paramIndex int) (reflect.Value, bool) + func WriteJSON(writer io.Writer, v interface{}, options JSON, enableOptimization ...bool) (int, error) + func WriteJSONP(writer io.Writer, v interface{}, options JSONP, enableOptimization ...bool) (int, error) + func WriteMarkdown(writer io.Writer, markdownB []byte, options Markdown) (int, error) + func WriteXML(writer io.Writer, v interface{}, options XML) (int, error) + func XMLMap(elementName string, v Map) xml.Marshaler + type Application interface + ConfigurationReadOnly func() ConfigurationReadOnly + FindClosestPaths func(subdomain, searchPath string, n int) []string + FireErrorCode func(ctx Context) + GetRouteReadOnly func(routeName string) RouteReadOnly + GetRoutesReadOnly func() []RouteReadOnly + I18nReadOnly func() I18nReadOnly + Logger func() *golog.Logger + RouteExists func(ctx Context, method, path string) bool + ServeHTTP func(w http.ResponseWriter, r *http.Request) + ServeHTTPC func(ctx Context) + View func(writer io.Writer, filename string, layout string, bindingData interface{}) error + type BodyDecoder interface + Decode func(data []byte) error + type ConfigurationReadOnly interface + GetCharset func() string + GetDisableAutoFireStatusCode func() bool + GetDisableBodyConsumptionOnUnmarshal func() bool + GetDisablePathCorrection func() bool + GetDisablePathCorrectionRedirection func() bool + GetEnableOptimizations func() bool + GetEnablePathEscape func() bool + GetFireMethodNotAllowed func() bool + GetLocaleContextKey func() string + GetOther func() map[string]interface{} + GetPostMaxMemory func() int64 + GetRemoteAddrHeaders func() map[string]bool + GetTimeFormat func() string + GetVHost func() string + GetViewDataContextKey func() string + GetViewLayoutContextKey func() string + type ContentNegotiator interface + Negotiate func(ctx Context) (int, error) + type ContentSelector interface + SelectContent func(mime string) interface{} + type Context interface + AbsoluteURI func(s string) string + AddHandler func(...Handler) + Application func() Application + BeginRequest func(http.ResponseWriter, *http.Request) + BeginTransaction func(pipe func(t *Transaction)) + Binary func(data []byte) (int, error) + CheckIfModifiedSince func(modtime time.Time) (bool, error) + ClientSupportsGzip func() bool + ContentType func(cType string) + Do func(Handlers) + EndRequest func() + Exec func(method, path string) + FindClosest func(n int) []string + FormFile func(key string) (multipart.File, *multipart.FileHeader, error) + FormValue func(name string) string + FormValueDefault func(name string, def string) string + FormValues func() map[string][]string + FullRequestURI func() string + GetBody func() ([]byte, error) + GetContentLength func() int64 + GetContentType func() string + GetContentTypeRequested func() string + GetCookie func(name string, options ...CookieOption) string + GetCurrentRoute func() RouteReadOnly + GetHeader func(name string) string + GetLocale func() Locale + GetReferrer func() Referrer + GetStatusCode func() int + GetViewData func() map[string]interface{} + Gzip func(enable bool) + GzipResponseWriter func() *GzipResponseWriter + HTML func(format string, args ...interface{}) (int, error) + HandlerFileLine func() (file string, line int) + HandlerIndex func(n int) (currentIndex int) + HandlerName func() string + Handlers func() Handlers + Header func(name string, value string) + Host func() string + IsAjax func() bool + IsMobile func() bool + IsRecording func() (*ResponseRecorder, bool) + IsScript func() bool + IsStopped func() bool + IsWWW func() bool + JSON func(v interface{}, options ...JSON) (int, error) + JSONP func(v interface{}, options ...JSONP) (int, error) + Markdown func(markdownB []byte, options ...Markdown) (int, error) + MaxAge func() int64 + Method func() string + Negotiate func(v interface{}) (int, error) + Negotiation func() *NegotiationBuilder + Next func() + NextHandler func() Handler + NextOr func(handlers ...Handler) bool + NextOrNotFound func() bool + NotFound func() + OnClose func(cb func()) + OnConnectionClose func(fnGoroutine func()) bool + Params func() *RequestParams + Path func() string + PostValue func(name string) string + PostValueBool func(name string) (bool, error) + PostValueDefault func(name string, def string) string + PostValueFloat64 func(name string) (float64, error) + PostValueFloat64Default func(name string, def float64) float64 + PostValueInt func(name string) (int, error) + PostValueInt64 func(name string) (int64, error) + PostValueInt64Default func(name string, def int64) int64 + PostValueIntDefault func(name string, def int) int + PostValueTrim func(name string) string + PostValues func(name string) []string + Problem func(v interface{}, opts ...ProblemOptions) (int, error) + Proceed func(Handler) bool + ReadForm func(formObject interface{}) error + ReadJSON func(jsonObjectPtr interface{}) error + ReadQuery func(ptr interface{}) error + ReadXML func(xmlObjectPtr interface{}) error + ReadYAML func(outPtr interface{}) error + Record func() + Recorder func() *ResponseRecorder + Redirect func(urlToRedirect string, statusHeader ...int) + ReflectValue func() []reflect.Value + RemoteAddr func() string + RemoveCookie func(name string, options ...CookieOption) + Request func() *http.Request + RequestPath func(escape bool) string + ResetRequest func(r *http.Request) + ResetResponseWriter func(ResponseWriter) + ResponseWriter func() ResponseWriter + RouteExists func(method, path string) bool + RouteName func() string + SendFile func(filename string, destinationName string) error + ServeContent func(content io.ReadSeeker, filename string, modtime time.Time, ...) error + ServeFile func(filename string, gzipCompression bool) error + SetCookie func(cookie *http.Cookie, options ...CookieOption) + SetCookieKV func(name, value string, options ...CookieOption) + SetCurrentRouteName func(currentRouteName string) + SetHandlers func(Handlers) + SetLastModified func(modtime time.Time) + SetMaxRequestBodySize func(limitOverBytes int64) + Skip func() + SkipTransactions func() + StatusCode func(statusCode int) + StopExecution func() + StreamWriter func(writer func(w io.Writer) bool) + String func() string + Subdomain func() (subdomain string) + Text func(format string, args ...interface{}) (int, error) + Tr func(format string, args ...interface{}) string + TransactionsSkipped func() bool + TryWriteGzip func(b []byte) (int, error) + URLParam func(name string) string + URLParamBool func(name string) (bool, error) + URLParamDefault func(name string, def string) string + URLParamEscape func(name string) string + URLParamExists func(name string) bool + URLParamFloat64 func(name string) (float64, error) + URLParamFloat64Default func(name string, def float64) float64 + URLParamInt func(name string) (int, error) + URLParamInt32Default func(name string, def int32) int32 + URLParamInt64 func(name string) (int64, error) + URLParamInt64Default func(name string, def int64) int64 + URLParamIntDefault func(name string, def int) int + URLParamTrim func(name string) string + URLParams func() map[string]string + UnmarshalBody func(outPtr interface{}, unmarshaler Unmarshaler) error + UploadFormFiles func(destDirectory string, before ...func(Context, *multipart.FileHeader)) (n int64, err error) + Values func() *memstore.Store + View func(filename string, optionalViewModel ...interface{}) error + ViewData func(key string, value interface{}) + ViewLayout func(layoutTmplFile string) + VisitAllCookies func(visitor func(name string, value string)) + Write func(body []byte) (int, error) + WriteGzip func(b []byte) (int, error) + WriteNotModified func() + WriteString func(body string) (int, error) + WriteWithExpiration func(body []byte, modtime time.Time) (int, error) + Writef func(format string, args ...interface{}) (int, error) + XML func(v interface{}, options ...XML) (int, error) + YAML func(v interface{}) (int, error) + func NewContext(app Application) Context + type CookieDecoder func(cookieName string, cookieValue string, v interface{}) error + type CookieEncoder func(cookieName string, value interface{}) (string, error) + type CookieOption func(*http.Cookie) + func CookieDecode(decode CookieDecoder) CookieOption + func CookieEncode(encode CookieEncoder) CookieOption + func CookieExpires(durFromNow time.Duration) CookieOption + func CookieHTTPOnly(httpOnly bool) CookieOption + func CookiePath(path string) CookieOption + type Filter func(Context) bool + type GzipResponseWriter struct + func AcquireGzipResponseWriter() *GzipResponseWriter + func (w *GzipResponseWriter) BeginGzipResponse(underline ResponseWriter) + func (w *GzipResponseWriter) Disable() + func (w *GzipResponseWriter) EndResponse() + func (w *GzipResponseWriter) FlushResponse() + func (w *GzipResponseWriter) ResetBody() + func (w *GzipResponseWriter) Write(contents []byte) (int, error) + func (w *GzipResponseWriter) WriteNow(contents []byte) (int, error) + func (w *GzipResponseWriter) WriteString(s string) (n int, err error) + func (w *GzipResponseWriter) Writef(format string, a ...interface{}) (n int, err error) + type Handler func(Context) + func NewConditionalHandler(filter Filter, handlers ...Handler) Handler + type Handlers []Handler + type I18nReadOnly interface + GetLocale func(ctx Context) Locale + Tags func() []language.Tag + Tr func(lang string, format string, args ...interface{}) string + type JSON struct + Indent string + Prefix string + StreamingJSON bool + UnescapeHTML bool + type JSONP struct + Callback string + Indent string + type Locale interface + GetMessage func(key string, args ...interface{}) string + Index func() int + Language func() string + Tag func() *language.Tag + type Map = map[string]interface + type Markdown struct + Sanitize bool + type N struct + Binary []byte + HTML string + JSON interface{} + JSONP interface{} + Markdown []byte + Other []byte + Problem Problem + Text string + XML interface{} + YAML interface{} + func (n N) SelectContent(mime string) interface{} + type NegotiationAcceptBuilder struct + func (n *NegotiationAcceptBuilder) Binary() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) Charset(charset ...string) *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) Encoding(encoding ...string) *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) EncodingGzip() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) HTML() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) JSON() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) JSONP() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) MIME(mimeType ...string) *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) Markdown() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) Override() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) Problem() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) Text() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) XML() *NegotiationAcceptBuilder + func (n *NegotiationAcceptBuilder) YAML() *NegotiationAcceptBuilder + type NegotiationBuilder struct + Accept NegotiationAcceptBuilder + func (n *NegotiationBuilder) Any(v ...interface{}) *NegotiationBuilder + func (n *NegotiationBuilder) Binary(v ...[]byte) *NegotiationBuilder + func (n *NegotiationBuilder) Build() (contentType, charset, encoding string, content interface{}) + func (n *NegotiationBuilder) Charset(charset ...string) *NegotiationBuilder + func (n *NegotiationBuilder) Clear() *NegotiationBuilder + func (n *NegotiationBuilder) Encoding(encoding ...string) *NegotiationBuilder + func (n *NegotiationBuilder) EncodingGzip() *NegotiationBuilder + func (n *NegotiationBuilder) HTML(v ...string) *NegotiationBuilder + func (n *NegotiationBuilder) JSON(v ...interface{}) *NegotiationBuilder + func (n *NegotiationBuilder) JSONP(v ...interface{}) *NegotiationBuilder + func (n *NegotiationBuilder) MIME(mime string, content interface{}) *NegotiationBuilder + func (n *NegotiationBuilder) Markdown(v ...[]byte) *NegotiationBuilder + func (n *NegotiationBuilder) Problem(v ...interface{}) *NegotiationBuilder + func (n *NegotiationBuilder) Text(v ...string) *NegotiationBuilder + func (n *NegotiationBuilder) XML(v ...interface{}) *NegotiationBuilder + func (n *NegotiationBuilder) YAML(v ...interface{}) *NegotiationBuilder + type Pool struct + func New(newFunc func() Context) *Pool + func (c *Pool) Acquire(w http.ResponseWriter, r *http.Request) Context + func (c *Pool) Attach(newFunc func() Context) + func (c *Pool) Release(ctx Context) + func (c *Pool) ReleaseLight(ctx Context) + type Problem map[string]interface + func (p Problem) Cause(cause Problem) Problem + func (p Problem) Detail(detail string) Problem + func (p Problem) Error() string + func (p Problem) GetTempKey(key string) interface{} + func (p Problem) Instance(instanceURI string) Problem + func (p Problem) Key(key string, value interface{}) Problem + func (p Problem) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (p Problem) Status(statusCode int) Problem + func (p Problem) TempKey(key string, value interface{}) Problem + func (p Problem) Title(title string) Problem + func (p Problem) Type(uri string) Problem + func (p Problem) Validate() bool + func NewProblem() Problem + type ProblemOptions struct + JSON JSON + RenderXML bool + RetryAfter interface{} + RetryAfterFunc func(Context) interface{} + XML XML + func (o *ProblemOptions) Apply(ctx Context) + type Referrer struct + Domain string + GoogleType ReferrerGoogleSearchType + Label string + Path string + Query string + Subdomain string + Tld string + Type ReferrerType + URL string + type ReferrerGoogleSearchType = goreferrer.GoogleSearchType + type ReferrerType = goreferrer.ReferrerType + type RequestParams struct + func (r *RequestParams) GetEntry(key string) memstore.Entry + func (r *RequestParams) GetEntryAt(index int) memstore.Entry + func (r *RequestParams) Set(key, value string) + func (r *RequestParams) Visit(visitor func(key string, value string)) + func (r RequestParams) Get(key string) string + func (r RequestParams) GetDecoded(key string) string + func (r RequestParams) GetEscape(key string) string + func (r RequestParams) GetIntUnslashed(key string) (int, bool) + func (r RequestParams) GetTrim(key string) string + type ResponseRecorder struct + func AcquireResponseRecorder() *ResponseRecorder + func (w *ResponseRecorder) BeginRecord(underline ResponseWriter) + func (w *ResponseRecorder) Body() []byte + func (w *ResponseRecorder) ClearHeaders() + func (w *ResponseRecorder) Clone() ResponseWriter + func (w *ResponseRecorder) EndResponse() + func (w *ResponseRecorder) Flush() + func (w *ResponseRecorder) FlushResponse() + func (w *ResponseRecorder) Naive() http.ResponseWriter + func (w *ResponseRecorder) Push(target string, opts *http.PushOptions) error + 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) WriteTo(res ResponseWriter) + func (w *ResponseRecorder) Writef(format string, a ...interface{}) (n int, err error) + type ResponseWriter interface + BeginResponse func(http.ResponseWriter) + Clone func() ResponseWriter + CloseNotifier func() (http.CloseNotifier, bool) + EndResponse func() + FlushResponse func() + Flusher func() (http.Flusher, bool) + GetBeforeFlush func() func() + IsHijacked func() bool + Naive func() http.ResponseWriter + SetBeforeFlush func(cb func()) + SetWritten func(int) + StatusCode func() int + WriteString func(s string) (n int, err error) + WriteTo func(ResponseWriter) + Writef func(format string, a ...interface{}) (n int, err error) + Written func() int + func AcquireResponseWriter() ResponseWriter + type RouteReadOnly interface + GetChangeFreq func() string + GetLastMod func() time.Time + GetPriority func() float32 + IsOnline func() bool + IsStatic func() bool + MainHandlerName func() string + Method func() string + Name func() string + Path func() string + ResolvePath func(args ...string) string + StaticPath func() string + StaticSites func() []StaticSite + String func() string + Subdomain func() string + Tmpl func() macro.Template + Trace func() string + type StaticSite struct + Dir string + RequestPath string + func GetStaticSites(rootDir, rootRequestPath, indexName string) (sites []StaticSite) + type Transaction struct + func (t *Transaction) Complete(err error) + func (t *Transaction) Context() Context + 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, outPtr interface{}) error + type UnmarshalerFunc func(data []byte, outPtr interface{}) error + func (u UnmarshalerFunc) Unmarshal(data []byte, v interface{}) error + type XML struct + Indent string + Prefix string