Documentation
¶
Index ¶
- Variables
- func Compile(root string)
- func EscapeHTML(html []byte, mode ...string) []byte
- func GenRsaKey(crtPath string, keyPath string) error
- func GenRsaKeyIfNeeded(crtPath string, keyPath string) error
- func Gunzip(path string) ([]byte, error)
- func IsBotHeader(c fiber.Ctx) bool
- func PrintMsg(color string, msg string, size int, end bool)
- type App
- type CSP
- type Config
- type FormCtx
- type FormHandler
- type Map
- type Plugin
- type ThemeConfig
Constants ¶
This section is empty.
Variables ¶
var DebugCompiler = false
var Helmet helmet.Config
Functions ¶
func EscapeHTML ¶
EscapeHTML escapes HTML characters and HTML arg quotes
@mode (optional):
- "html": escapes html characters
- "args": escapes quotes for html args
func GenRsaKey ¶
GenRsaKey generates a new ssl certificate and key pair
- expires: 3 years
- rsa: 4096
- x509
- sha256
- recommended renewal: once a year
func GenRsaKeyIfNeeded ¶
GenRsaKeyIfNeeded auto detects if the certificates generated by the GenRsaKey method are either
- not synchronized by date modified
- are possibly expired (assuming a 1 year renewal)
If it detects this is true, it will automatically regenerate a new certificate
func IsBotHeader ¶ added in v0.1.0
func IsBotHeader(c fiber.Ctx) bool
IsBotHeader does a lightweight check for any missing or susspicious headers for bots
returns true if it could be a bot
Notice: Do not rely on this check alone. It only preforms a basic check to reduce potential spam.
Types ¶
type App ¶
type App struct {
*fiber.App
Config Config
// contains filtered or unexported fields
}
func (*App) BlockBotHeader ¶ added in v0.1.1
BlockBotHeader does a lightweight check for any missing or susspicious headers for bots
Notice: Do not rely on this check alone. It only preforms a basic check to reduce potential spam.
func (*App) Error ¶
Error renders an error page
if the page is not found, it will return a default error page
func (*App) Listen ¶
Listen to both http and https ports and auto generate a self signed ssl certificate (will also auto renew every year)
by using self signed certs, you can use a proxy like cloudflare and not have to worry about verifying a certificate athority like lets encrypt
type FormCtx ¶ added in v0.3.0
type FormCtx struct {
fiber.Ctx
Body map[string]any
Session *map[string]string
// contains filtered or unexported fields
}
type FormHandler ¶ added in v0.3.0
type FormHandler struct {
// contains filtered or unexported fields
}
func (*FormHandler) API ¶ added in v0.3.0
func (handler *FormHandler) API(uri string, cb func(c FormCtx) error)
API verifies and continues a verified form session, and updates the token every request.
Note: this method assumes forms will be submitted with the client fetch api. Your API should include the "session" and updated "token" on every request.
type Plugin ¶ added in v0.2.0
type Plugin struct {
// contains filtered or unexported fields
}
type ThemeConfig ¶ added in v0.4.0
type ThemeConfig struct {
FontSize string
Font map[string]string
Scheme string
ForceScheme bool
Theme map[string]*struct {
Scheme string
BGChroma float64
TextChroma float64
FGChroma float64
ColorChroma float64
BGDark uint8
BG uint8
BGLight uint8
FG uint8
Text uint8
TextMuted uint8
}
Colors map[string]*struct {
Hue int16
Dark uint8
Light uint8
}
Vars map[string]string
}