constants

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_MIME = "application/octet-stream"
View Source
const DEFAULT_PASSITER = 1

Default pbkdf2 (password based key derivation) iteration count for response encryption password

View Source
const DIR_INDEX_HTML = `` /* 9795-byte string literal not displayed */

Copied from Chrome file:// url dir index page. Go html/template format.

View Source
const INFINITE_TIMEOUT = 86400 * 365 * 100

seconds of 100 years, aka: infinite.

View Source
const KEY_PASSITER = 1000000

The key flag (primary password of Simpleproxy server) pbkdf2 iteration count

View Source
const LINE_BREAKS = "\r\n"
View Source
const MEDIATYPE_HTML = "text/html"
View Source
const MEDIATYPE_MD = "text/markdown"
View Source
const MEDIATYPE_TXT = "text/plain"
View Source
const MIME_HTML = "text/html; charset=utf-8"
View Source
const MIME_TXT = "text/plain; charset=utf-8"
View Source
const NONCE_MAX_TIMEDIFF = 120 // seconds
View Source
const NONCE_MIN_LENGTH = len(NONCE_TIME_FORMAT) + 1
View Source
const NONCE_TIME_FORMAT = "2006-01-02_15-04-05"
View Source
const NONE = "none"
View Source
const REQ_INALIAS = "inalias"

Current request is a alias parsed url

View Source
const REQ_RPATH = "rpath"

Current alias request relative path

View Source
const SGP_ENV_PREFIX = "SGP_"
View Source
const TIME_FORMAT = "2006-01-02T15:04:05Z"
View Source
const TPL_PASSITER = 1

Pbkdf2 iteration count for encryption functions in template

Variables

View Source
var EncryptedUrlRegex = regexp.MustCompile(`^((?P<eid>[_a-zA-Z0-9]+?)_)?(?P<eurl>[a-zA-Z0-9]{18,})(?P<epath>/.*)?$`)

match with a encrypted url base62 string

View Source
var TextualMediatypes = func() map[string]bool {
	typesMap := map[string]bool{}
	types := []string{
		"application/json",
		"application/javascript",
		"application/yaml",
		"application/toml",
		"application/xml",
		"application/json5",
		"application/xml-dtd",
		"application/atom+xml",
		"application/rss+xml",
		"application/xhtml+xml",
		"application/x-sh",
		"application/x-shellscript",
		"application/x-pem-file",
		"application/x-subrip",
		"image/svg+xml",
	}
	for _, t := range types {
		typesMap[t] = true
	}
	return typesMap
}()

textual metiatypes besides "text/*

Functions

func NonceLess added in v0.14.0

func NonceLess(a, b Nonce) bool

Types

type Nonce added in v0.14.0

type Nonce string

Nonce must starts with UTC time string of NONCE_TIME_FORMAT and ends with a crypto random string.

func (Nonce) Time added in v0.14.0

func (n Nonce) Time() time.Time

type Template added in v0.14.0

type Template interface {
	Execute(wr io.Writer, data any) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL