Documentation ¶
Overview ¶
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Index ¶
- Constants
- Variables
- func DecryptMessage(message string, logger *zap.SugaredLogger) (string, error)
- func EncryptMessage(message string, logger *zap.SugaredLogger) (string, error)
- func FormatFilename(content string, filename string) (string, error)
- func FormatJSON(v any) (string, error)
- func FormatLang(content string, lang string) (string, error)
- func FormatLangIgnoreErrors(content string, lang string) string
- func FormatString(content string, l chroma.Lexer) (string, error)
- func GetContentType(rc *fasthttp.RequestCtx) string
- func GetFromSession(key string, websess util.ValueMap) (string, error)
- func IsContentTypeJSON(c string) bool
- func IsContentTypeXML(c string) bool
- func IsContentTypeYAML(c string) bool
- func NewCookie(v string) *fasthttp.Cookie
- func ParamSetFromRequest(rc *fasthttp.RequestCtx) filter.ParamSet
- func ParseForm(rc *fasthttp.RequestCtx) (util.ValueMap, error)
- func ParseFormAsChanges(rc *fasthttp.RequestCtx) (util.ValueMap, error)
- func RemoveFromSession(k string, rc *fasthttp.RequestCtx, websess util.ValueMap, ...) error
- func RequestCtxBool(rc *fasthttp.RequestCtx, key string) bool
- func RequestCtxToMap(rc *fasthttp.RequestCtx, data any) map[string]any
- func RespondDebug(rc *fasthttp.RequestCtx, filename string, body any) (string, error)
- func RespondJSON(rc *fasthttp.RequestCtx, filename string, body any) (string, error)
- func RespondMIME(filename string, mime string, ext string, ba []byte, rc *fasthttp.RequestCtx) (string, error)
- func RespondXML(rc *fasthttp.RequestCtx, filename string, body any) (string, error)
- func RespondYAML(rc *fasthttp.RequestCtx, filename string, body any) (string, error)
- func SaveProfile(n *user.Profile, rc *fasthttp.RequestCtx, sess util.ValueMap, ...) error
- func SaveSession(rc *fasthttp.RequestCtx, websess util.ValueMap, logger *zap.SugaredLogger) error
- func StoreInSession(k string, v string, rc *fasthttp.RequestCtx, websess util.ValueMap, ...) error
- func WriteCORS(rc *fasthttp.RequestCtx)
- type Arg
- type ArgResults
- type Args
- type Breadcrumbs
- type Location
- type Locations
- type PageState
- type XMLResponse
Constants ¶
const ( WebAuthKey = "auth" WebFlashKey = "flash" ReferKey = "refer" )
const (
PageComment = "Thanks for viewing the source; we tried to make it pretty for you"
)
Variables ¶
var AllowedHeaders = "*"
Functions ¶
func DecryptMessage ¶
func DecryptMessage(message string, logger *zap.SugaredLogger) (string, error)
func EncryptMessage ¶
func EncryptMessage(message string, logger *zap.SugaredLogger) (string, error)
func FormatJSON ¶
func FormatLangIgnoreErrors ¶
func GetContentType ¶
func GetContentType(rc *fasthttp.RequestCtx) string
func IsContentTypeJSON ¶
func IsContentTypeXML ¶
func IsContentTypeYAML ¶
func ParamSetFromRequest ¶
func ParamSetFromRequest(rc *fasthttp.RequestCtx) filter.ParamSet
func ParseFormAsChanges ¶
func ParseFormAsChanges(rc *fasthttp.RequestCtx) (util.ValueMap, error)
func RemoveFromSession ¶
func RemoveFromSession(k string, rc *fasthttp.RequestCtx, websess util.ValueMap, logger *zap.SugaredLogger) error
func RequestCtxBool ¶
func RequestCtxBool(rc *fasthttp.RequestCtx, key string) bool
func RequestCtxToMap ¶
func RequestCtxToMap(rc *fasthttp.RequestCtx, data any) map[string]any
func RespondDebug ¶
func RespondJSON ¶
func RespondMIME ¶
func RespondXML ¶
func RespondYAML ¶
func SaveProfile ¶
func SaveProfile(n *user.Profile, rc *fasthttp.RequestCtx, sess util.ValueMap, logger *zap.SugaredLogger) error
func SaveSession ¶
func SaveSession(rc *fasthttp.RequestCtx, websess util.ValueMap, logger *zap.SugaredLogger) error
func StoreInSession ¶
func StoreInSession(k string, v string, rc *fasthttp.RequestCtx, websess util.ValueMap, logger *zap.SugaredLogger) error
func WriteCORS ¶
func WriteCORS(rc *fasthttp.RequestCtx)
Types ¶
type ArgResults ¶
type ArgResults struct { Args Args `json:"args"` Values map[string]string `json:"values"` Missing []string `json:"missing,omitempty"` }
func CollectArgs ¶
func CollectArgs(rc *fasthttp.RequestCtx, args Args) *ArgResults
type Breadcrumbs ¶
type Breadcrumbs []string
type PageState ¶
type PageState struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Method string `json:"method,omitempty"` URI *fasthttp.URI `json:"-"` Menu menu.Items `json:"menu,omitempty"` Breadcrumbs Breadcrumbs `json:"breadcrumbs,omitempty"` Flashes []string `json:"flashes,omitempty"` Session util.ValueMap `json:"-"` Profile *user.Profile `json:"profile,omitempty"` Accounts user.Accounts `json:"accounts,omitempty"` Authed bool `json:"authed,omitempty"` Admin bool `json:"admin,omitempty"` Icons []string `json:"icons,omitempty"` RootIcon string `json:"rootIcon,omitempty"` RootPath string `json:"rootPath,omitempty"` RootTitle string `json:"rootTitle,omitempty"` SearchPath string `json:"searchPath,omitempty"` ProfilePath string `json:"profilePath,omitempty"` HideMenu bool `json:"hideMenu,omitempty"` ForceRedirect string `json:"forceRedirect,omitempty"` HeaderContent string `json:"headerContent,omitempty"` Data any `json:"data,omitempty"` Logger *zap.SugaredLogger `json:"-"` Context context.Context `json:"-"` Span *telemetry.Span `json:"-"` RenderElapsed float64 `json:"renderElapsed,omitempty"` }
func (*PageState) TitleString ¶
type XMLResponse ¶
type XMLResponse struct {
Result any `xml:"result"`
}