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
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
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 ¶
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.