smartgo

package module
v0.0.0-...-0116310 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: BSD-3-Clause Imports: 80 Imported by: 13

README

smartgo

GO Module for Smart.Framework

Documentation

Overview

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.19 or later

REQUIRE: go 1.22 or later (depends on Go generics, available since go 1.18 but stable only since go 1.19)

Index

Constants

View Source
const (
	SEPARATOR_SFZ_CHECKSUM_V1 string = "#CHECKSUM-SHA1#" // compatibility, v1
	SEPARATOR_SFZ_CHECKSUM_V2 string = "#CKSUM256#"      // compatibility, v2
	SEPARATOR_SFZ_CHECKSUM_V3 string = "#CKSUM384V3#"    // current, v3

	SIGNATURE_SFZ_DATA_ARCH_V1 string = "PHP.SF.151129/B64.ZLibRaw.HEX"  // compatibility, v1, unarchive only
	SIGNATURE_SFZ_DATA_ARCH_V2 string = "SFZ.20210818/B64.ZLibRaw.hex"   // compatibility, v2, unarchive only
	SIGNATURE_SFZ_DATA_ARCH_V3 string = "[SFZ.20231031/B64.ZLibRaw.hex]" // current, v3 ; archive + unarchive
)
View Source
const (
	// {{{SYNC-AUTH-PASS-ALGOS}}}
	ALGO_PASS_NONE                  uint8 = 0
	ALGO_PASS_PLAIN                 uint8 = 1
	ALGO_PASS_SMART_SAFE_SF_PASS    uint8 = 77
	ALGO_PASS_SMART_SAFE_ARGON_PASS uint8 = 78
	ALGO_PASS_SMART_SAFE_BCRYPT     uint8 = 123
	ALGO_PASS_SMART_SAFE_OPQ_TOKEN  uint8 = 204 // Opaque Token
	ALGO_PASS_SMART_SAFE_WEB_TOKEN  uint8 = 216 // Web (Signed) Token / JWT
	ALGO_PASS_CUSTOM_TOKEN          uint8 = 244 // other, custom implementations of token logic
	ALGO_PASS_CUSTOM_HASH_PASS      uint8 = 255 // other, custom implementations of pass hashing

	// {{{SYNC-AUTH-MODES}}}
	HTTP_AUTH_MODE_NONE   uint8 = 0
	HTTP_AUTH_MODE_BASIC  uint8 = 1
	HTTP_AUTH_MODE_TOKEN  uint8 = 28
	HTTP_AUTH_MODE_BEARER uint8 = 29
	HTTP_AUTH_MODE_COOKIE uint8 = 129
	HTTP_AUTH_MODE_APIKEY uint8 = 229
	HTTP_AUTH_MODE_RAW    uint8 = 255 // used for 3rd party

	HTTP_AUTH_DEFAULT_AREA  string = "[DEFAULT]" // this is a special area, surrounded by [] ; any other areas must allow just: A-Z 0-9 -
	HTTP_AUTH_DEFAULT_PRIV  string = "<default>" // must include only (one) the default privilege   for a valid user, not admin ; NOT FOR external JWT Auth
	HTTP_AUTH_ADMIN_PRIV    string = "<admin>"   // must include only (one) the admin privilege     for a valid user,     admin ; NOT FOR external JWT Auth
	HTTP_AUTH_DEFAULT_RESTR string = "<none>"    // must include only (one) the default restriction for a valid user, not admin ; NOT FOR external JWT Auth

	REGEX_SAFE_AUTH_AREA       string = `^[A-Z0-9\-\.]{4,48}`                       // this must not allow [] to conflict with the default area ; {{{SYNC-AUTH-EXT-AREA-REGEX}}}
	REGEX_VALID_PRIV_RESTR_KEY string = `^([a-z]{1}[a-z0-9\-\:]{0,20}[a-z0-9]{1})$` // valid name for one privilege key from list of privileges ; a valid privilege key can have 2..22 characters and can contain only: `a-z`, `0-9`, `:` and `-` ; must start with `a-z` only ; must not end with `:` or `-`

	REGEX_SAFE_HTTP_USER_NAME     string = `^[a-z0-9\.]{5,25}$`                       // Safe HTTP Auth UserName Regex ; intended as a safe user ID for all cases
	REGEX_SAFE_AUTH_EMAIL_ADDRESS string = `^[_a-z0-9\-\.]{1,41}@[a-z0-9\-\.]{3,30}$` // Safe Auth Email regex ; internet email@(subdomain.)domain.name ; max 72 ; practical
	REGEX_SAFE_AUTH_USER_NAME     string = `^[_a-z0-9\-\.@]{5,72}$`                   // Safe Auth Username Regex ; cover boths above

	REGEX_SAFE_AUTH_OPAQUE_TOKEN string = `^[a-zA-Z0-9\-]{44,126}$` // Safe (Opaque) Token Regex ; {{{SYNC-MAX-AUTH-TOKEN-LENGTH}}}
	REGEX_SAFE_AUTH_2FA_CODE     string = `^[0-9]{6,8}$`            // Safe 2FA Regex 6..8 digits

	OPAQUE_TOKEN_FULL_NAME string = "Opaque:UUID"

	HTTP_AUTH_USER_TOKEN  string = "@TOKEN@"  // used for http client to add header: 				`Authorization: Token ****`  where `****` is the opaque token
	HTTP_AUTH_USER_BEARER string = "@BEARER@" // used for http client to add header: 				`Authorization: Bearer ****` where `****` is the jwt signed token
	HTTP_AUTH_USER_APIKEY string = "@APIKEY@" // used for http client to add header: 				`Authorization: Apikey ****` where `****` is the external jwt signed token for non-existing accounts
	HTTP_AUTH_USER_RAW    string = "@RAW@"    // used for http client to add custom header like: 	`Authorization: %Custom% ****` where `%Custom% ****` is the password ; ex: `Authorization: OAuth ****`
)
View Source
const (
	SIGNATURE_3FISH_1K_V1_DEFAULT  string = "3f1kD.v1!"   // 3F ; current,       v1 1024 (default)                           ; encrypt + decrypt
	SIGNATURE_3FISH_1K_V1_ARGON2ID string = "3f1kA.v1!"   // 3F ; current,       v1 1024 (argon2id)                          ; encrypt + decrypt
	SIGNATURE_3FISH_1K_V1_2FBF_D   string = "3ffb2kD.v1!" // 3F ; current,       v1 1024 (default+twofish/256+blowfish/448)  ; encrypt + decrypt
	SIGNATURE_3FISH_1K_V1_2FBF_A   string = "3ffb2kA.v1!" // 3F ; current,       v1 1024 (argon2id+twofish/256+blowfish/448) ; encrypt + decrypt

	SIGNATURE_2FISH_V1_DEFAULT    string = "2f256.v1!" // 2F ; current,       v1  256 (default)              ; encrypt + decrypt
	SIGNATURE_2FISH_V1_BF_DEFAULT string = "2fb88.v1!" // 2F ; current,       v1  256 (default+blowfish/448) ; encrypt + decrypt ; Blowfish 56 (448) + TwoFish 32 (256) = 88 (704)

	SIGNATURE_BFISH_V3 string = "bf448.v3!" // BF ; current,       v3  448 ; encrypt + decrypt
	SIGNATURE_BFISH_V2 string = "bf448.v2!" // BF ; compatibility, v2  448 ; decrypt only
	SIGNATURE_BFISH_V1 string = "bf384.v1!" // BF ; compatibility, v1  384 ; decrypt only

	SEPARATOR_CRYPTO_CHECKSUM_V3 string = "#CKSUM512V3#"    // current,            v3 ; threefish, twofish, blowfish (v3)
	SEPARATOR_CRYPTO_CHECKSUM_V2 string = "#CKSUM256#"      // compatibility,      v2 ; blowfish v2 only
	SEPARATOR_CRYPTO_CHECKSUM_V1 string = "#CHECKSUM-SHA1#" // compatibility,      v1 ; blowfish v1 only

	REGEX_SAFE_CRYPTO_PACKAGE_STR string = `^[a-zA-Z0-9\-_\.;\!]+$` // must allow characters and exclamation sign from the signature: B64s ; !

	SALT_PREFIX    string = "Smart Framework" // fixed salt prefix
	SALT_SEPARATOR string = "#"               // fixed salt separator
	SALT_SUFFIX    string = "スマート フレームワーク"    // fixed salt suffix

	DERIVE_MIN_KLEN    uint16 = 3    // Key Derive Min Length
	DERIVE_MAX_KLEN    uint16 = 4096 // Key Derive Min Length
	DERIVE_PREKEY_LEN  uint16 = 80   // Key Derive Pre-Key Length
	DERIVE_CENTITER_EK uint16 = 87   // Key Derive EK Iterations
	DERIVE_CENTITER_EV uint16 = 78   // Key Derive EV Iterations
	DERIVE_CENTITER_PW uint16 = 77   // Key Derive PW Iterations
	DERIVE_CENTITER_TK uint16 = 88   // Key Derive TK Iterations

	PASSWORD_PLAIN_MIN_LENGTH    uint8  = 7          // Password Plain Min Lentgth
	PASSWORD_PLAIN_MAX_LENGTH    uint8  = 55         // Password Plain Max Lentgth
	PASSWORD_HASH_LENGTH         uint8  = 128        // fixed length ; {{{SYNC-AUTHADM-PASS-LENGTH}}} ; if lower then padd to right with * ; {{{SYNC-AUTHADM-PASS-PADD}}}
	PASSWORD_BHASH_LENGTH        uint8  = 60         // fixed length ; bhash passwords
	PASSWORD_PREFIX_VERSION      string = "$fPv3.7!" // {{{SYNC-AUTHADM-PASS-PREFIX}}}
	PASSWORD_PREFIX_A2ID_VERSION string = "a2idP37!" // go lang only (no PHP), curent v3, argon2id password ; must be the same length as PASSWORD_PREFIX_VERSION
)
View Source
const (
	//-- Time Zones
	TIME_ZONE_UTC string = "UTC" // UTC Time Zone Code
	//-- Time Zone Modes
	TZ_MODE_UTC   string = TIME_ZONE_UTC // Time Zone Mode UTC
	TZ_MODE_LOCAL string = "LOCAL"       // Time Zone Mode LOCAL
	//-- FIXED DATE CONSTANTS REFERENCE VALUES ... SYNCED WITH GO DATE STANDARDS !
	DATE_TIME_DEFAULT_LOCAL_TIMEZONE  string = TIME_ZONE_UTC               // Default Local Time Zone: UTC
	DATE_TIME_FMT_ISO_NOTIME_GO_EPOCH string = "2006-01-02"                // GO EPOCH:   NO TIME,   NO TZ OFFSET
	DATE_TIME_FMT_ISO_STD_GO_EPOCH    string = "2006-01-02 15:04:05"       // GO EPOCH: WITH TIME,   NO TZ OFFSET
	DATE_TIME_FMT_ISO_TZOFS_GO_EPOCH  string = "2006-01-02 15:04:05 -0700" // GO EPOCH: WITH TIME, WITH TZ OFFSET
	DATE_TIME_FMT_RFC1123_GO_EPOCH    string = "Mon, 02 Jan 2006 15:04:05" // GO EPOCH: RFC1123
	DATE_TIME_FMT_CONDENSED           string = "20060102150405"            // GO EPOCH: WITH TIME,   NO TZ OFFSET, CONDENSED

)
View Source
const (
	REGEX_SAFE_HEX_STR  string = `^[0-9a-f]+$` // as the go have internal, all lowercase
	REGEX_SAFE_B64_STR  string = `^[a-zA-Z0-9\+\/\=]+$`
	REGEX_SAFE_B64S_STR string = `^[a-zA-Z0-9\-_\.]+$`
)
View Source
const (
	CHOWN_DIRS  os.FileMode = 0755
	CHOWN_FILES os.FileMode = 0644

	//-- Cross Platform Safe Paths ; The following are disallowed in Windows paths: `< > : " / \ | ? *` ; also disallow SPACE because of the web context
	REGEX_SAFE_PATH_NAME string = `^[_a-zA-Z0-9\-\.@#\/` + "`" + `~\!\$%&\(\)\^\{\}'` + `\[\],;\+` + `]+$` // SAFETY: SAFE Cross Platform Character Set for FileSystems: Smart + MsDOS + Linux/Unix + Windows (intersect)
	REGEX_SAFE_FILE_NAME string = `^[_a-zA-Z0-9\-\.@#` + "`" + `~\!\$%&\(\)\^\{\}'` + `\[\],;\+` + `]+$`   // SAFETY: SAFE Cross Platform Character Set for FileSystems: Smart + MsDOS + Linux/Unix + Windows (intersect) ; like above, just missing slash /

	//-- Web Ultra-Safe Paths (Smart)
	REGEX_SMART_SAFE_PATH_NAME string = `^[_a-zA-Z0-9\-\.@#\/]+$` // SAFETY: SUPPORT ONLY THESE CHARACTERS IN FILE SYSTEM PATHS ...
	REGEX_SMART_SAFE_FILE_NAME string = `^[_a-zA-Z0-9\-\.@#]+$`   // SAFETY: SUPPORT ONLY THESE CHARACTERS IN FILE SYSTEM FILE AND DIR NAMES ... ; like above, just missing slash /

	MAX_PATH_LENGTH     int = 1024 // path can be up to 4096 characters, safe is 1024 to be cross platform
	MAX_FILENAME_LENGTH int = 255  // file can be up to  512 characters, safe is  255 to be cross platform

	FILE_WRITE_MODE_DEFAULT string = "w" // write
	FILE_WRITE_MODE_APPEND  string = "a" // append

	INVALID_ABSOLUTE_PATH string = "/tmp/go-invalid-path/err-absolute-path/"
	INVALID_HOMEDIR_PATH  string = "/tmp/go-invalid-path/err-user-home-dir/"
)
View Source
const (
	SMTP_TLS_STARTTLS          string = "STARTTLS"
	SMTP_TLS_OPTIONAL_STARTTLS string = "STARTTLS/OPTIONAL"
	SMTP_SSL_TLS               string = "SSL"
	SMTP_NO_TLS_NO_SSL         string = "NOTLS/NOSSL"

	MAIL_ENCODING_B64  string = "B64"
	MAIL_ENCODING_QP   string = "QP"
	MAIL_ENCODING_8BIT string = "8BIT"
)
View Source
const (
	MAX_DOC_SIZE_VALIDATE_HTML uint64 = SIZE_BYTES_16M * 4 // {{{SYNC-HTML-VALIDATOR-MAX-SIZE}}} 	; 64MB
	MAX_DOC_SIZE_MARKDOWN      uint64 = SIZE_BYTES_16M     // {{{SYNC-MARKDOWN-MAX-SIZE}}} 		; 16MB

	REGEX_HTML_LITERAL_ENTITY string = `(?i)&([a-z]+);`
	REGEX_HTML_NUMERIC_ENTITY string = `(?i)&\#(x?[a-f0-9]+);`
	REGEX_HTML_ANY_ENTITY     string = `(?i)&\#?(x?[a-z0-9]+);`
)
View Source
const (
	REGEX_SAFE_VAR_NAME string = `^[_a-zA-Z0-9]+$` // Safe VarName Regex

	REGEX_SMART_SAFE_BASE_PATH string = `^[_a-z0-9\-\/]+$` // CONFORMANCE: SUPPORT ONLY THESE CHARACTERS IN HTML BASE PATHS

	REGEX_SMART_SAFE_NET_HOSTNAME    string = `^[_a-z0-9\-\.]+$` // SAFETY: SUPPORT ONLY THESE CHARACTERS IN NET HOST NAMES AS RFC ; if a hostname have upper characters must be converted to all lower characters ; if a hostname have unicode characters must be converted using punnycode ...
	REGEX_SMART_SAFE_HTTP_HEADER_KEY string = `^[A-Za-z0-9\-]+$` // SAFETY: SUPPORT ONLY THESE CHARACTERS IN HEADER KEY VALUES

	REGEX_SMART_SAFE_EMAIL_ADDRESS string = `^[_a-zA-Z0-9\-\.\+~]{1,63}@[a-z0-9\-\.]{3,63}$` // internet email@(subdomain.)domain.name
	REGEX_SMART_SAFE_NET_USERNAME  string = `^[_a-zA-Z0-9\-\.\+~@]{3,127}$`                  // general characters accepted in a username

	MAX_HOSTNAME_FULL_LENGTH    int = 253 // The entire hostname, including the delimiting dots, has a maximum of 253 ASCII characters
	MAX_HOSTNAME_SEGMENT_LENGTH int = 63  // For example, "en.wikipedia.org" is a hostname. Each label must be 1 to 63 octets long

	HTTP_PROTO_PREFIX_HTTP  string = "http://"
	HTTP_PROTO_PREFIX_HTTPS string = "https://"

	DATA_URL_EMPTY_PREFIX     string = "data:,"
	DATA_URL_CSS_PREFIX       string = "data:text/css,"
	DATA_URL_JS_PREFIX        string = "data:application/javascript,"
	DATA_URL_SVG_IMAGE_PREFIX string = "data:image/svg+xml,"

	DEFAULT_FAKE_IP_CLIENT       string = "0.0.0.0"
	DEFAULT_FAKE_HOSTPORT_SERVER string = "256.256.256.256:65535"

	DEFAULT_BROWSER_UA string = "NetSurf/3.11 (Sf/Go)"
)
View Source
const (
	REGEX_STR_IS_NUMERIC_UINTEGER = `[0-9]+`
	REGEX_STR_IS_NUMERIC_INTEGER  = `[0-9\-]+`

	REGEX_STR_IS_NUMERIC_DEFAULT  = `[0-9\.\-]+`
	REGEX_STR_IS_NUMERIC_EXTENDED = `[0-9\.\-, ]+` // includes decimal separators: , or space
)
View Source
const (
	REGEXP2_DEFAULT_MAX_RECURSION uint32 = 1000000 // Default REGEXP2 Recursion Limit: 1 million
	REGEXP2_DEFAULT_MAX_TIMEOUT   uint8  = 1       // Default REGEXP2 Max Timeout 1 Second(s)
)
View Source
const (
	CMD_EXEC_HAMMER_SIGNATURE  string = "[»»»»»»»[SmartGo:{!HAMMER!}:Abort:(Exit):KILL.SIGNAL]«««««««]" // INTERNAL FLAG FOR CMD FORCE EXIT HAMMER
	CMD_EXEC_TIMED_MAX_TIMEOUT uint   = 86400
)
View Source
const (
	SPECIAL_TRIM string = "\n\r\x00\x0B" // {{{SYNC-TPL-FIX-TRIM-PARTS}}}

	UNDEF_VAR_NAME string = "Undef____V_a_r"

	MTPL_FILE_EXTENSION string = ".mtpl.htm"

	MAX_DOC_SIZE_TPL uint64 = SIZE_BYTES_16M // {{{SYNC-TPL-MAX-SIZE}}} ; 16MB
)
View Source
const (
	VERSION string = "v.20250118.2358"
	NAME    string = "SmartGo"

	DESCRIPTION string = "Smart.Framework.Go"
	COPYRIGHT   string = "(c) 2021-present unix-world.org"

	CHARSET           string = "UTF-8"  // DO NOT CHANGE !! This is mandatory ...
	INVALID_CHARACTER string = "\uFFFD" // Invalid UTF-8 character that will be used for UTF-8 Valid Fix: �

	NULL_BYTE    string = "\x00" // THE NULL BYTE character \x00 or \000
	BACK_SPACE   string = "\b"   // The Backspace Character \b
	ASCII_BELL   string = "\a"   // The ASCII Bell Character \a
	FORM_FEED    string = "\f"   // The Form Feed Character \f or \x0C
	VERTICAL_TAB string = "\v"   // The Vertical Tab character \v or \x0B

	HORIZONTAL_TAB  string = "\t" // The Horizontal Tab character \t
	LINE_FEED       string = "\n" // The Line Feed character \n
	CARRIAGE_RETURN string = "\r" // The Carriage Return character \r

	TRIM_WHITESPACES string = " \t\n\r\x00\x0B" // Ultra Wide Compatibility (Javascript / PHP)

	REGEX_ASCII_ANDSPACE_CHARACTERS string = `^[[:graph:] \t\r\n]+$` // match all ASCII safe printable characters ; allow extra: space, tab, line feed, carriage return
	REGEX_ASCII_NOSPACE_CHARACTERS  string = `^[[:graph:]]+$`        // match all ASCII safe printable characters except spaces
)
View Source
const (
	LOG_MAX_MSG_LEN uint16 = 65535 // max log message length
)
View Source
const (
	REGEX_SAFE_APP_NAMESPACE string = `^[_a-z0-9\-\.]+$` // Safe App Namespace Regex
)
View Source
const (
	REGEX_SMART_SAFE_NUMBER_FLOAT string = `^[0-9\-\.]+$` // SAFETY: SUPPORT ONLY THESE CHARACTERS IN SAFE FLOAT (ex: JSON)
)
View Source
const (
	SIZE_BYTES_16M uint64 = 16777216 // Reference Unit
)

Variables

View Source
var (
	DEBUG bool = false
)

Functions

func AddCSlashes

func AddCSlashes(s string, c string) string

func AppGetNamespace

func AppGetNamespace() (string, error)

func AppGetRunInBackground

func AppGetRunInBackground() bool

func AppGetSecurityKey

func AppGetSecurityKey() (string, error)

func AppSetNamespace

func AppSetNamespace(ns string) bool

func AppSetRunInBackground

func AppSetRunInBackground() bool

func AppSetSecurityKey

func AppSetSecurityKey(key string) bool

func ArrMapKeyExists

func ArrMapKeyExists[C comparable, A any](v C, arr map[C]A) bool

func ArrMapStrFlip

func ArrMapStrFlip(m map[string]string) map[string]string

func Auth2FACookieIsEnabled

func Auth2FACookieIsEnabled() bool

func Auth2FACookieNameGet

func Auth2FACookieNameGet() string

func Auth2FACookieNameSet

func Auth2FACookieNameSet(cookieName string) bool

func AuthAnyIsEnabled

func AuthAnyIsEnabled() bool

func AuthApikeyIsEnabled

func AuthApikeyIsEnabled() bool

func AuthApikeyModeSet

func AuthApikeyModeSet(mode bool) bool

func AuthBasicIsEnabled

func AuthBasicIsEnabled() bool

func AuthBasicModeSet

func AuthBasicModeSet(mode bool) bool

func AuthBearerIsEnabled

func AuthBearerIsEnabled() bool

func AuthBearerModeSet

func AuthBearerModeSet(mode bool) bool

func AuthCookieIsEnabled

func AuthCookieIsEnabled() bool

func AuthCookieNameGet

func AuthCookieNameGet() string

func AuthCookieNameSet

func AuthCookieNameSet(cookieName string) bool

func AuthGetMetaData

func AuthGetMetaData(authData AuthDataStruct, key string) (string, error)

func AuthGetUserDefaultPrivKey

func AuthGetUserDefaultPrivKey(username string) string

func AuthGetUserDefaultSecurityKey

func AuthGetUserDefaultSecurityKey(username string) string

func AuthIsValid2FACode

func AuthIsValid2FACode(code string) bool

func AuthIsValidExtArea

func AuthIsValidExtArea(area string) bool

func AuthIsValidExtUserName

func AuthIsValidExtUserName(user string) bool

func AuthIsValidPassword

func AuthIsValidPassword(pass string) bool

func AuthIsValidPrivKey

func AuthIsValidPrivKey(key string) bool

func AuthIsValidPubKey

func AuthIsValidPubKey(key string) bool

func AuthIsValidSecurityKey

func AuthIsValidSecurityKey(key string) bool

func AuthIsValidTokenOpaque

func AuthIsValidTokenOpaque(token string) bool

func AuthIsValidUserEmail

func AuthIsValidUserEmail(email string) bool

func AuthIsValidUserName

func AuthIsValidUserName(user string) bool

func AuthMethodGetNameById

func AuthMethodGetNameById(methodId uint8) string

func AuthPassHashAlgoGetNameById

func AuthPassHashAlgoGetNameById(algo uint8) string

func AuthSafeCompare

func AuthSafeCompare(val1 string, val2 string) bool

func AuthSafeListPrivsRestr

func AuthSafeListPrivsRestr(list string) string

conforms list `<one>, <two>` to a safe one

func AuthSafeTestPrivsRestr

func AuthSafeTestPrivsRestr(list string, entry string) bool

test if priv or restr `one` is in list `<one>,<two>`

func AuthTokenIsEnabled

func AuthTokenIsEnabled() bool

func AuthTokenModeSet

func AuthTokenModeSet(mode bool) bool

func AuthUserTokenBasicSepareParts

func AuthUserTokenBasicSepareParts(usernameWithTokenSuffix string, passAsTokenHash string) (string, string, error)

func AuthUserTokenDefaultSepareParts

func AuthUserTokenDefaultSepareParts(token string) (string, string, error)

func BExplode

func BExplode(delimiter []byte, src []byte) [][]byte

func BExplodeWithLimit

func BExplodeWithLimit(delimiter []byte, src []byte, limit int) [][]byte

func BImplode

func BImplode(glue []byte, pieces [][]byte) []byte

func Base64BytDecode

func Base64BytDecode(data []byte) []byte

func Base64BytEncode

func Base64BytEncode(data []byte) []byte

func Base64BytToBase64s

func Base64BytToBase64s(data []byte) []byte

func Base64BytToBase64u

func Base64BytToBase64u(data []byte) []byte

func Base64Decode

func Base64Decode(data string) string

func Base64Encode

func Base64Encode(data string) string

func Base64ToBase64s

func Base64ToBase64s(data string) string

func Base64ToBase64u

func Base64ToBase64u(data string) string

func Base64sBytDecode

func Base64sBytDecode(data []byte) []byte

func Base64sBytEncode

func Base64sBytEncode(data []byte) []byte

func Base64sBytToBase64

func Base64sBytToBase64(data []byte) []byte

func Base64sDecode

func Base64sDecode(data string) string

func Base64sEncode

func Base64sEncode(data string) string

func Base64sToBase64

func Base64sToBase64(data string) string

func Base64uBytToBase64

func Base64uBytToBase64(data []byte) []byte

func Base64uToBase64

func Base64uToBase64(data string) string

func BaseDecode

func BaseDecode(data string, fromBase string) []byte

func BaseEncode

func BaseEncode(data []byte, toBase string) string

func Bin2BytHex

func Bin2BytHex(src []byte) []byte

func Bin2Hex

func Bin2Hex(str string) string

func BlowfishDecryptCBC

func BlowfishDecryptCBC(str string, key string) string

func BlowfishEncryptCBC

func BlowfishEncryptCBC(str string, key string, randomize bool) string

func BytContains

func BytContains(src []byte, part []byte) bool

func BytEndsWith

func BytEndsWith(src []byte, part []byte) bool

func BytIContains

func BytIContains(src []byte, part []byte) bool

func BytIEndsWith

func BytIEndsWith(src []byte, part []byte) bool

func BytIPos

func BytIPos(haystack []byte, needle []byte, binary bool) int

case insensitive, find position of first occurrence of a byte slice in another byte slice ; PHP compatible return -1 if can not find the substring or the position of needle in haystack

func BytIReplaceAll

func BytIReplaceAll(s []byte, part []byte, replacement []byte) []byte

case insensitive replacer

func BytIReplaceWithLimit

func BytIReplaceWithLimit(s []byte, part []byte, replacement []byte, limit int) []byte

case insensitive replacer

func BytIStartsWith

func BytIStartsWith(src []byte, part []byte) bool

func BytLen

func BytLen(src []byte) int

PHP strlen()

func BytPos

func BytPos(haystack []byte, needle []byte, binary bool) int

case sensitive, find position of first occurrence of a byte slice in another byte slice ; PHP compatible return -1 if can not find the substring or the position of needle in haystack

func BytRIPos

func BytRIPos(haystack []byte, needle []byte, binary bool) int

case insensitive, find position of last occurrence of a byte slice in another byte slice ; PHP compatible return -1 if can not find the substring or the position of needle in haystack

func BytRPos

func BytRPos(haystack []byte, needle []byte, binary bool) int

case sensitive, find position of last occurrence of a byte slice in another byte slice ; PHP compatible return -1 if can not find the substring or the position of needle in haystack

func BytRegexCallbackReplaceAll

func BytRegexCallbackReplaceAll(rexpr string, src []byte, replFx func(mgroups [][]byte) []byte) []byte

func BytRegexCallbackReplaceWithLimit

func BytRegexCallbackReplaceWithLimit(rexpr string, src []byte, replFx func(mgroups [][]byte) []byte, limit int) []byte

func BytRegexFindAllMatches

func BytRegexFindAllMatches(rexp string, s []byte, maxRecursion uint32) ([][][]byte, error)

func BytRegexFindFirstMatch

func BytRegexFindFirstMatch(rexp string, s []byte) ([][]byte, error)

func BytRegexMatch

func BytRegexMatch(rexpr string, s []byte) bool

func BytRegexReplaceAll

func BytRegexReplaceAll(rexpr string, s []byte, repl []byte) []byte

func BytRegexReplaceFirst

func BytRegexReplaceFirst(rexpr string, s []byte, repl []byte) []byte

func BytRepeat

func BytRepeat(src []byte, count int) []byte

func BytReplaceAll

func BytReplaceAll(src []byte, part []byte, replacement []byte) []byte

case sensitive replacer

func BytReplaceWithLimit

func BytReplaceWithLimit(src []byte, part []byte, replacement []byte, limit int) []byte

case sensitive replacer

func BytStartsWith

func BytStartsWith(src []byte, part []byte) bool

func BytSubstr

func BytSubstr(s []byte, start int, stop int) []byte

func BytToLower

func BytToLower(src []byte) []byte

func BytToUpper

func BytToUpper(src []byte) []byte

func BytToValidUTF8Fix

func BytToValidUTF8Fix(src []byte) []byte

func BytTr

func BytTr(src []byte, replace map[string][]byte) []byte

func BytTrim

func BytTrim(src []byte, cutset string) []byte

func BytTrimLeft

func BytTrimLeft(src []byte, cutset string) []byte

func BytTrimLeftWhitespaces

func BytTrimLeftWhitespaces(s []byte) []byte

func BytTrimRight

func BytTrimRight(src []byte, cutset string) []byte

func BytTrimRightWhitespaces

func BytTrimRightWhitespaces(s []byte) []byte

func BytTrimWhitespaces

func BytTrimWhitespaces(s []byte) []byte

func BytesConcatenate

func BytesConcatenate(src1 []byte, src2 []byte) []byte

func BytesEqual

func BytesEqual(src1 []byte, src2 []byte) bool

func BytesIEqual

func BytesIEqual(src1 []byte, src2 []byte) bool

func BytesToExaBytes

func BytesToExaBytes(b uint64) uint64

func BytesToGigaBytes

func BytesToGigaBytes(b uint64) uint64

func BytesToKiloBytes

func BytesToKiloBytes(b uint64) uint64

func BytesToMegaBytes

func BytesToMegaBytes(b uint64) uint64

func BytesToPetaBytes

func BytesToPetaBytes(b uint64) uint64

func BytesToTeraBytes

func BytesToTeraBytes(b uint64) uint64

func Chr

func Chr(o uint8) string

func CipherDecryptCBC

func CipherDecryptCBC(algo string, str string, key string, iv string, tweak string) (string, error)

IMPORTANT: the output must be trimmed for the padding added when encrypted ; expects B64 data, so trim is OK !

func CipherEncryptCBC

func CipherEncryptCBC(algo string, str string, key string, iv string, tweak string) (string, error)

IMPORTANT: the input will be padded ; expects B64 data !

func ClearPrintTerminal

func ClearPrintTerminal()

set terminal theme Dark (bg:black ; fg:white) : print("\033[0;37;40m")

func ConformSerializedJsObjectForm

func ConformSerializedJsObjectForm(jsonStr string, dataKey string) (map[string]interface{}, error)

func ConvertBoolToStr

func ConvertBoolToStr(i bool) string

func ConvertBoolsToStr

func ConvertBoolsToStr(i bool) string

func ConvertFloat32ToStr

func ConvertFloat32ToStr(f float32) string

func ConvertFloat64ToStr

func ConvertFloat64ToStr(f float64) string

func ConvertInt16ToStr

func ConvertInt16ToStr(i int16) string

func ConvertInt32ToStr

func ConvertInt32ToStr(i int32) string

func ConvertInt64ToStr

func ConvertInt64ToStr(i int64) string

func ConvertInt8ToStr

func ConvertInt8ToStr(i int8) string

func ConvertIntToStr

func ConvertIntToStr(i int) string

func ConvertJsonNumberToFloat64

func ConvertJsonNumberToFloat64(data interface{}) (float64, error)

func ConvertJsonNumberToInt64

func ConvertJsonNumberToInt64(data interface{}) (int64, error)

func ConvertJsonNumberToStr

func ConvertJsonNumberToStr(data interface{}) string

func ConvertUInt16ToStr

func ConvertUInt16ToStr(i uint16) string

func ConvertUInt32ToStr

func ConvertUInt32ToStr(i uint32) string

func ConvertUInt64ToStr

func ConvertUInt64ToStr(i uint64) string

func ConvertUInt8ToStr

func ConvertUInt8ToStr(i uint8) string

func ConvertUIntToStr

func ConvertUIntToStr(i uint) string

func Crc32b

func Crc32b(str string) string

func Crc32bB36

func Crc32bB36(str string) string

func CurrentFunctionName

func CurrentFunctionName() string

func CurrentOSArch

func CurrentOSArch() string

func CurrentOSName

func CurrentOSName() string

func CurrentRuntimeVersion

func CurrentRuntimeVersion() string

func DataArchive

func DataArchive(str string) string

func DataRRot13

func DataRRot13(s string) string

func DataRot13

func DataRot13(s string) string

func DataUnArchive

func DataUnArchive(str string) string

func DateFromStr

func DateFromStr(dateIsoStr string, withTime bool, withTzOffset bool, isUTC bool) string

func DateFromTime

func DateFromTime(t time.Time) string

func DateFromUnixTimeLocal

func DateFromUnixTimeLocal(timestamp int64) string

func DateFromUnixTimeUtc

func DateFromUnixTimeUtc(timestamp int64) string

func DateIsoFromTime

func DateIsoFromTime(t time.Time) string

func DateIsoFromUnixTimeLocal

func DateIsoFromUnixTimeLocal(timestamp int64) string

func DateIsoFromUnixTimeUtc

func DateIsoFromUnixTimeUtc(timestamp int64) string

func DateNoTimeFromTime

func DateNoTimeFromTime(t time.Time) string

func DateNoTimeFromUnixTimeLocal

func DateNoTimeFromUnixTimeLocal(timestamp int64) string

func DateNoTimeFromUnixTimeUtc

func DateNoTimeFromUnixTimeUtc(timestamp int64) string

func DateNowIsoLocal

func DateNowIsoLocal() string

func DateNowIsoUtc

func DateNowIsoUtc() string

func DateNowLocal

func DateNowLocal() string

func DateNowNoTimeLocal

func DateNowNoTimeLocal() string

func DateNowNoTimeUtc

func DateNowNoTimeUtc() string

func DateNowUtc

func DateNowUtc() string

func DateTimeGetLocation

func DateTimeGetLocation() string

func DateTimeSetLocation

func DateTimeSetLocation(loc string) bool

func DateTimeStructLocal

func DateTimeStructLocal(dateIsoStr string) uxmDateTimeStruct

func DateTimeStructUtc

func DateTimeStructUtc(dateIsoStr string) uxmDateTimeStruct

func EscapeCss

func EscapeCss(s string) string

func EscapeHtml

func EscapeHtml(s string) string

func EscapeJs

func EscapeJs(in string) string

func EscapeUrl

func EscapeUrl(s string) string

func EscapeXml

func EscapeXml(s string, extraEscapings bool) string

func ExecCmd

func ExecCmd(captureStdout string, captureStderr string, additionalEnv string, inputStdin string, theExe string, theArgs ...string) (isSuccess bool, outStd string, errStd string)

execute command and after it finalizes it returns the output

func ExecTimedCmd

func ExecTimedCmd(stopTimeout uint, captureStdout string, captureStderr string, additionalEnv string, inputStdin string, theExe string, theArgs ...string) (isSuccess bool, outStd string, errStd string)

execute a command with timeout and after it finalizes or timeouts it returns the output

func Explode

func Explode(delimiter string, text string) []string

func ExplodeWithLimit

func ExplodeWithLimit(delimiter string, text string, limit int) []string

func FatalError

func FatalError(logMessages ...any)

func FatalError(logMessages ...interface{}) {

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

GenerateRandomString returns a securely generated random string [1..65535]. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GenerateSSHKeyPairEd25519

func GenerateSSHKeyPairEd25519(comment string, password string) (error, string, string)

return: err, pubKeyPEM, privKeyPEM

func GetBaseDomainFromDomain

func GetBaseDomainFromDomain(domain string) (string, error)

func GetCookieDefaultDomain

func GetCookieDefaultDomain() string

func GetCookieDefaultSameSitePolicy

func GetCookieDefaultSameSitePolicy() string

func GetCurrentUserHomeDir

func GetCurrentUserHomeDir() (string, error)

func GetHttpBaseUrlFromRequest

func GetHttpBaseUrlFromRequest(r *http.Request) string

func GetHttpBrowserPathFromRequest

func GetHttpBrowserPathFromRequest(r *http.Request) (path string)

func GetHttpDomainAndPortFromRequest

func GetHttpDomainAndPortFromRequest(r *http.Request) (domain string, portNum string, err error)

domain can be: domain or IPv4 / IPv6

func GetHttpPathFromRequest

func GetHttpPathFromRequest(r *http.Request) (path string)

returns: `/` or `/path/extra` or `/path/extra/`

func GetHttpProtocolFromRequest

func GetHttpProtocolFromRequest(r *http.Request) (proto string)

returns: `http://` or `https://`

func GetHttpProxyBasePath

func GetHttpProxyBasePath() string

func GetHttpProxyRealClientIpHeaderKey

func GetHttpProxyRealClientIpHeaderKey() string

func GetHttpProxyRealServerHostPortHeaderKey

func GetHttpProxyRealServerHostPortHeaderKey() string

func GetHttpProxyRealServerProtoHeaderKey

func GetHttpProxyRealServerProtoHeaderKey() string

func GetHttpQueryStringFromRequest

func GetHttpQueryStringFromRequest(r *http.Request) (query string)

returns: “ or `?` or `?a` or `?a=` or `?a=b` or `?a=b&` or `?a=b&c` or `?a=b&c=` or `?a=b&c=d`

func GetHttpRealClientIpFromRequestHeaders

func GetHttpRealClientIpFromRequestHeaders(r *http.Request) (isOk bool, clientRealIp string, rawVal string, headerKey string)

func GetHttpRemoteAddrIpAndPortFromRequest

func GetHttpRemoteAddrIpAndPortFromRequest(r *http.Request) (ipAddr string, portNum string)

func GetHttpUrlFromRequest

func GetHttpUrlFromRequest(r *http.Request, withUrlQuery bool) string

func GetHttpUserAgentFromRequest

func GetHttpUserAgentFromRequest(r *http.Request) (ua string)

func GetUserAgentBrowserClassOs

func GetUserAgentBrowserClassOs(signature string) (bw string, cls string, os string, mb bool)

func GzDecode

func GzDecode(str string) string

func GzDeflate

func GzDeflate(str string, level int) string

func GzEncode

func GzEncode(str string, level int) string

func GzInflate

func GzInflate(str string) string

func HTMLCodeFixSanitize

func HTMLCodeFixSanitize(htmlCode string) (string, error)

func HTMLCodeFixValidate

func HTMLCodeFixValidate(htmlCode string) (string, error)

func HTMLCodeStripTags

func HTMLCodeStripTags(htmlCode string) string

func HTMLDecodeEntities

func HTMLDecodeEntities(htmlCode string) string

func HandleAbortCtrlC

func HandleAbortCtrlC(delay uint32)

func HashHmac

func HashHmac(algo string, key string, str string, b64 bool) (string, error)

func Hex2Bin

func Hex2Bin(str string) string

func Hex2BytBin

func Hex2BytBin(src []byte) []byte

func HttpSessionUUIDCookieIsEnabled

func HttpSessionUUIDCookieIsEnabled() bool

func HttpSessionUUIDCookieNameGet

func HttpSessionUUIDCookieNameGet() string

func HttpSessionUUIDCookieNameSet

func HttpSessionUUIDCookieNameSet(cookieName string) bool

func Implode

func Implode(glue string, pieces []string) string

func InListArr

func InListArr[C comparable](v C, arr []C) bool

func IniContentParse

func IniContentParse(iniContent string, iniKeys []string) (iniMap map[string]string, errMsg error)

func IsInteger

func IsInteger(s string, allowNegatives bool) bool

func IsNetValidHostName

func IsNetValidHostName(s string) bool

func IsNetValidIpAddr

func IsNetValidIpAddr(s string) bool

func IsNetValidPortNum

func IsNetValidPortNum(p int64) bool

func IsNetValidPortStr

func IsNetValidPortStr(s string) bool

func IsNumeric

func IsNumeric(s string, extended bool) bool

func IsPathAlikeWithSafeFixedPath

func IsPathAlikeWithSafeFixedPath(path string, fixTrailingSlashes bool) bool

func IsValidHttpHeaderKey

func IsValidHttpHeaderKey(hdrKey string) bool

func JsonArrDecode

func JsonArrDecode(data string) ([]interface{}, error)

func JsonEncode

func JsonEncode(data interface{}, prettyprint bool, htmlsafe bool) (string, error)

func JsonGetValueByKeyPath

func JsonGetValueByKeyPath(json string, path string) gjson.Result

func JsonGetValueByKeysPath

func JsonGetValueByKeysPath(json string, keys ...string) (*fastjson.Value, error)

func JsonNoErrChkEncode

func JsonNoErrChkEncode(data interface{}, prettyprint bool, htmlsafe bool) string

func JsonObjDecode

func JsonObjDecode(data string) (map[string]interface{}, error)

func JsonScalarDecodeToStr

func JsonScalarDecodeToStr(data string) (string, error)

func JsonStrDecode

func JsonStrDecode(data string) (string, error)

func KillCmd

func KillCmd(cmd *exec.Cmd) error

kills a command executed with StartCmd() -> WaitCmd()

func LogToConsole

func LogToConsole(level string, withColorsOnConsole bool)

func LogToFile

func LogToFile(level string, pathForLogs string, theFormat string, alsoOnConsole bool, withColorsOnConsole bool)

func LogToStdErr

func LogToStdErr(level string)

func LogUseLocalTime

func LogUseLocalTime()

func LogUseUtcTime

func LogUseUtcTime()

func MarkdownSmartToHTMLRender

func MarkdownSmartToHTMLRender(mkdwDoc string, urlRelativePrefix string, useUnveil bool, unveilDefaultImage string) (string, error)

func MarkdownToHTMLRender

func MarkdownToHTMLRender(mkdwDoc string) (string, error)

func MarkersTplEscapeSyntaxContent

func MarkersTplEscapeSyntaxContent(tpl string, isMainHtml bool) string

func MarkersTplEscapeTpl

func MarkersTplEscapeTpl(tpl string) string

func MarkersTplPrepareNosyntaxContent

func MarkersTplPrepareNosyntaxContent(tpl string) string

func MarkersTplPrepareNosyntaxHtml

func MarkersTplPrepareNosyntaxHtml(tpl string, isMainHtml bool) string

func MarkersTplRender

func MarkersTplRender(template string, arrobj map[string]string, isEncoded bool, revertSyntax bool, escapeRemainingSyntax bool, isMainHtml bool) string

func MarkersTplRevertNosyntaxContent

func MarkersTplRevertNosyntaxContent(tpl string) string

func Md5

func Md5(str string) string

func Md5B64

func Md5B64(str string) string

func MdByt5

func MdByt5(src []byte) []byte

func MdByt5B64

func MdByt5B64(src []byte) []byte

func MemoryStats

func MemoryStats() runtime.MemStats

func NanoTimeRandInt63N

func NanoTimeRandInt63N(min int64, max int64) uint64

func NanoTimeRandIntN

func NanoTimeRandIntN(min int, max int) uint

func NewError

func NewError(err string) error

func Nl2Br

func Nl2Br(s string) string

func NullableStrFromStr

func NullableStrFromStr(s string) *string

func NullableStrToStr

func NullableStrToStr(s *string) string

func Ord

func Ord(c string) int

func PanicHandler

func PanicHandler()

call as: defer PanicHandler()

func ParseBoolStrAsBool

func ParseBoolStrAsBool(s string) bool

func ParseBoolStrAsStdBoolStr

func ParseBoolStrAsStdBoolStr(s string) string

func ParseFloatStrAsDecimalStr

func ParseFloatStrAsDecimalStr(s string, d uint8) string

func ParseStrAsFloat64

func ParseStrAsFloat64(s string) float64

func ParseStrAsFloat64StrFixedPrecision

func ParseStrAsFloat64StrFixedPrecision(s string) string

func ParseStrAsInt64

func ParseStrAsInt64(s string) int64

func ParseStrAsUInt64

func ParseStrAsUInt64(s string) uint64

func PathAddDirLastSlash

func PathAddDirLastSlash(dirPath string) string

func PathBaseExtension

func PathBaseExtension(filePath string) string

func PathBaseName

func PathBaseName(filePath string) string

func PathBaseNoExtName

func PathBaseNoExtName(filePath string) string

func PathDirName

func PathDirName(filePath string) string

func PathExists

func PathExists(thePath string) bool

func PathGetAbsoluteFromRelative

func PathGetAbsoluteFromRelative(thePath string) string

func PathGetCurrentExecutableDir

func PathGetCurrentExecutableDir() string

func PathGetCurrentExecutableName

func PathGetCurrentExecutableName() string

func PathGetCurrentExecutablePathAndName

func PathGetCurrentExecutablePathAndName() string

func PathIsAbsolute

func PathIsAbsolute(filePath string) bool

func PathIsBackwardUnsafe

func PathIsBackwardUnsafe(filePath string) bool

func PathIsDir

func PathIsDir(thePath string) bool

func PathIsEmptyOrRoot

func PathIsEmptyOrRoot(filePath string) bool

func PathIsFile

func PathIsFile(thePath string) bool

func PathIsSafeValidFileName

func PathIsSafeValidFileName(fileName string) bool

func PathIsSafeValidPath

func PathIsSafeValidPath(filePath string) bool

func PathIsSafeValidSafeFileName

func PathIsSafeValidSafeFileName(fileName string) bool

func PathIsSafeValidSafePath

func PathIsSafeValidSafePath(filePath string) bool

func Pbkdf2DerivedKey

func Pbkdf2DerivedKey(algo string, key string, salt string, klen uint16, iterations uint16, b92 bool) (string, error)

func Pbkdf2PreDerivedKey

func Pbkdf2PreDerivedKey(key string) (string, error)

func PlaceholdersTplRender

func PlaceholdersTplRender(template string, arrpobj map[string]string, isEncoded bool, revertSyntax bool) string

func Poly1305

func Poly1305(key string, str string, b64 bool) (string, error)

func PrettyPrintBytes

func PrettyPrintBytes(b uint64) string

func RawUrlDecode

func RawUrlDecode(s string) string

func RawUrlEncode

func RawUrlEncode(s string) string

func RenderMainHtmlMarkersFileTpl

func RenderMainHtmlMarkersFileTpl(mtplFile string, arrobj map[string]string, arrpobj map[string]string) (string, error)

func RenderMainHtmlMarkersTpl

func RenderMainHtmlMarkersTpl(template string, arrobj map[string]string, arrpobj map[string]string) string

func RenderMarkersFileTpl

func RenderMarkersFileTpl(mtplFile string, arrobj map[string]string) (string, error)

func RenderMarkersTpl

func RenderMarkersTpl(template string, arrobj map[string]string) string

func SafeChecksumHashSmart

func SafeChecksumHashSmart(plainTextData string, customSalt string) (string, error)

func SafePassHashBcrypt

func SafePassHashBcrypt(plainPass string, cost uint8) (string, error)

func SafePassHashBcryptVerify

func SafePassHashBcryptVerify(hashedPass string, plainPass string) bool

func SafePassHashSmart

func SafePassHashSmart(plainPass string, theSalt string, useArgon2id bool) (string, error)

func SafePassHashSmartVerify

func SafePassHashSmartVerify(hashedPass string, plainPass string, theSalt string, useArgon2id bool) bool

func SafePathDirCreate

func SafePathDirCreate(dirPath string, allowRecursive bool, allowAbsolutePath bool) (isSuccess bool, errMsg error)

func SafePathDirDelete

func SafePathDirDelete(dirPath string, allowAbsolutePath bool) (isSuccess bool, errMsg error)

func SafePathDirRename

func SafePathDirRename(dirPath string, dirNewPath string, allowAbsolutePath bool) (isSuccess bool, errMsg error)

func SafePathDirScan

func SafePathDirScan(dirPath string, recursive bool, allowAbsolutePath bool) (isSuccess bool, errMsg error, arrDirs []string, arrFiles []string)

func SafePathEmbedDirScan

func SafePathEmbedDirScan(efs *embed.FS, dirPath string, recursive bool) (isSuccess bool, err error, arrDirs []string, arrFiles []string)

ex call (req. go ambed fs assets): SafePathEmbedDirScan(&assets, "assets/", true)

func SafePathFileCopy

func SafePathFileCopy(filePath string, fileNewPath string, allowAbsolutePath bool) (isSuccess bool, errMsg error)

func SafePathFileDelete

func SafePathFileDelete(filePath string, allowAbsolutePath bool) (isSuccess bool, errMsg error)

func SafePathFileGetSize

func SafePathFileGetSize(filePath string, allowAbsolutePath bool) (fileSize int64, errMsg error)

func SafePathFileMd5

func SafePathFileMd5(filePath string, allowAbsolutePath bool) (hashSum string, errMsg error)

func SafePathFileRead

func SafePathFileRead(filePath string, allowAbsolutePath bool) (fileContent string, errMsg error)

func SafePathFileRename

func SafePathFileRename(filePath string, fileNewPath string, allowAbsolutePath bool) (isSuccess bool, errMsg error)

func SafePathFileSha

func SafePathFileSha(mode string, filePath string, allowAbsolutePath bool) (hashSum string, errMsg error)

func SafePathFileWrite

func SafePathFileWrite(filePath string, wrMode string, allowAbsolutePath bool, fileContent string) (isSuccess bool, errMsg error)

func SafePathFixClean

func SafePathFixClean(p string) string

func SafePathFixSeparator

func SafePathFixSeparator(p string) string

this is a safer replacement for filepath.ToSlash(p), because is not OS Context Aware

func SafePathGetMTime

func SafePathGetMTime(thePath string, allowAbsolutePath bool) (mTime int64, errMsg error)

func SafePathIniFileReadAndParse

func SafePathIniFileReadAndParse(iniFilePath string, allowAbsolutePath bool, iniKeys []string) (iniMap map[string]string, errMsg error)

func SafePathMarkdownFileToHTMLRender

func SafePathMarkdownFileToHTMLRender(mdFilePath string, allowAbsolutePath bool) (string, error)

func SafePathMarkdownSmartFileToHTMLRender

func SafePathMarkdownSmartFileToHTMLRender(mdFilePath string, allowAbsolutePath bool, urlRelativePrefix string, useUnveil bool, unveilDefaultImage string) (string, error)

func SafePathYamlFileReadAndParse

func SafePathYamlFileReadAndParse(yamlFilePath string, allowAbsolutePath bool) (yamlMap map[string]interface{}, errMsg error)

func SendSmtpEmail

func SendSmtpEmail(smtpConf SmtpConfig, mailMsgStruct MailMessageStruct) error

func SetCookieDefaultDomain

func SetCookieDefaultDomain(domain string) bool

func SetCookieDefaultSameSitePolicy

func SetCookieDefaultSameSitePolicy(policy string) bool

func SetHttpProxyBasePath

func SetHttpProxyBasePath(pfx string) bool

func SetHttpProxyRealClientIpHeaderKey

func SetHttpProxyRealClientIpHeaderKey(hdrKey string) bool

func SetHttpProxyRealServerHostPortHeaderKey

func SetHttpProxyRealServerHostPortHeaderKey(hdrKey string) bool

func SetHttpProxyRealServerProtoHeaderKey

func SetHttpProxyRealServerProtoHeaderKey(hdrKey string) bool

func Sh3a224

func Sh3a224(str string) string

func Sh3a224B64

func Sh3a224B64(str string) string

func Sh3a256

func Sh3a256(str string) string

func Sh3a256B64

func Sh3a256B64(str string) string

func Sh3a384

func Sh3a384(str string) string

func Sh3a384B64

func Sh3a384B64(str string) string

func Sh3a512

func Sh3a512(str string) string

func Sh3a512B64

func Sh3a512B64(str string) string

func Sh3aByt224

func Sh3aByt224(src []byte) []byte

func Sh3aByt224B64

func Sh3aByt224B64(src []byte) []byte

func Sh3aByt256

func Sh3aByt256(src []byte) []byte

func Sh3aByt256B64

func Sh3aByt256B64(src []byte) []byte

func Sh3aByt384

func Sh3aByt384(src []byte) []byte

func Sh3aByt384B64

func Sh3aByt384B64(src []byte) []byte

func Sh3aByt512

func Sh3aByt512(src []byte) []byte

func Sh3aByt512B64

func Sh3aByt512B64(src []byte) []byte

func Sha1

func Sha1(str string) string

func Sha1B64

func Sha1B64(str string) string

func Sha224

func Sha224(str string) string

func Sha224B64

func Sha224B64(str string) string

func Sha256

func Sha256(str string) string

func Sha256B64

func Sha256B64(str string) string

func Sha384

func Sha384(str string) string

func Sha384B64

func Sha384B64(str string) string

func Sha512

func Sha512(str string) string

func Sha512B64

func Sha512B64(str string) string

func ShaByt1

func ShaByt1(src []byte) []byte

func ShaByt1B64

func ShaByt1B64(src []byte) []byte

func ShaByt224

func ShaByt224(src []byte) []byte

func ShaByt224B64

func ShaByt224B64(src []byte) []byte

func ShaByt256

func ShaByt256(src []byte) []byte

func ShaByt256B64

func ShaByt256B64(src []byte) []byte

func ShaByt384

func ShaByt384(src []byte) []byte

func ShaByt384B64

func ShaByt384B64(src []byte) []byte

func ShaByt512

func ShaByt512(src []byte) []byte

func ShaByt512B64

func ShaByt512B64(src []byte) []byte

func SmartArrToList

func SmartArrToList(arr []string, sepSpaces bool) string

converts arr['one', 'two'] to list `<one>, <two>`

func SmartListToArr

func SmartListToArr(list string, noSpaces bool) []string

converts list `<one>, <two>` to arr['one', 'two']

func SmtpSetDefaultConfig

func SmtpSetDefaultConfig(mxDomain string, host string, port uint16, tlsMode string, authType string, authUser string, authPass string) error

func StartCmd

func StartCmd(additionalEnv string, inputStdin string, theExe string, theArgs ...string) (isSuccess bool, errMsg error, stdoutRdr io.ReadCloser, stderrRdr io.ReadCloser, cmd *exec.Cmd)

starts a command to be used with WaitCmd() -> KillCmd()

func StrChunkSplit

func StrChunkSplit(body string, chunklen uint, end string) string

ChunkSplit chunk_split()

func StrContains

func StrContains(str string, part string) bool

func StrCreateHtmId

func StrCreateHtmId(s string) string

func StrCreateJsVarName

func StrCreateJsVarName(s string) string

func StrCreateSlug

func StrCreateSlug(s string) string

func StrCreateStdVarName

func StrCreateStdVarName(s string) string

func StrDeaccent

func StrDeaccent(s string) string

func StrEndsWith

func StrEndsWith(str string, part string) bool

func StrIContains

func StrIContains(str string, part string) bool

func StrIEndsWith

func StrIEndsWith(str string, part string) bool

func StrIPos

func StrIPos(haystack string, needle string, binary bool) int

case insensitive, find position of first occurrence of string in a string ; PHP compatible return -1 if can not find the substring or the position of needle in haystack

func StrIReplaceAll

func StrIReplaceAll(s string, part string, replacement string) string

case insensitive replacer

func StrIReplaceWithLimit

func StrIReplaceWithLimit(s string, part string, replacement string, limit int) string

case insensitive replacer

func StrIStartsWith

func StrIStartsWith(str string, part string) bool

func StrLen

func StrLen(str string) int

PHP strlen()

func StrMBSubstr

func StrMBSubstr(s string, start int, stop int) string

func StrNormalizeSpaces

func StrNormalizeSpaces(s string) string

func StrPad2LenLeft

func StrPad2LenLeft(s string, padStr string, overallLen int) string

func StrPad2LenRight

func StrPad2LenRight(s string, padStr string, overallLen int) string

func StrPos

func StrPos(haystack string, needle string, binary bool) int

case sensitive, find position of first occurrence of string in a string return -1 if can not find the substring or the position of needle in haystack

func StrRIPos

func StrRIPos(haystack string, needle string, binary bool) int

case insensitive, find position of last occurrence of string in a string ; PHP compatible return -1 if can not find the substring or the position of needle in haystack

func StrRPos

func StrRPos(haystack string, needle string, binary bool) int

case sensitive, find position of last occurrence of string in a string ; PHP compatible return -1 if can not find the substring or the position of needle in haystack

func StrRegex2FindAllMatches

func StrRegex2FindAllMatches(mode string, rexp string, s string, maxRecursion uint32, maxTimeOut uint8) ([][]string, error)

func StrRegex2FindFirstMatch

func StrRegex2FindFirstMatch(mode string, rexp string, s string, maxTimeOut uint8) ([]string, error)

func StrRegexCallbackReplaceAll

func StrRegexCallbackReplaceAll(rexpr string, str string, replFx func(mgroups []string) string) string

func StrRegexCallbackReplaceWithLimit

func StrRegexCallbackReplaceWithLimit(rexpr string, str string, replFx func(mgroups []string) string, limit int) string

func StrRegexFindAllMatches

func StrRegexFindAllMatches(rexp string, s string, maxRecursion uint32) ([][]string, error)

func StrRegexFindFirstMatch

func StrRegexFindFirstMatch(rexp string, s string) ([]string, error)

func StrRegexMatch

func StrRegexMatch(rexpr string, s string) bool

func StrRegexReplaceAll

func StrRegexReplaceAll(rexpr string, s string, repl string) string

func StrRegexReplaceFirst

func StrRegexReplaceFirst(rexpr string, s string, repl string) string

func StrRepeat

func StrRepeat(str string, count int) string

func StrReplaceAll

func StrReplaceAll(s string, part string, replacement string) string

case sensitive replacer

func StrReplaceWithLimit

func StrReplaceWithLimit(s string, part string, replacement string, limit int) string

case sensitive replacer

func StrRev

func StrRev(s string) string

func StrSpnChr

func StrSpnChr(s string, c rune, ofs uint32, length uint32) uint32

func StrStartsWith

func StrStartsWith(str string, part string) bool

func StrSubstr

func StrSubstr(s string, start int, stop int) string

func StrToLower

func StrToLower(str string) string

func StrToUpper

func StrToUpper(str string) string

func StrToValidUTF8Fix

func StrToValidUTF8Fix(s string) string

func StrTr

func StrTr(str string, replace map[string]string) string

func StrTrim

func StrTrim(s string, cutset string) string

func StrTrimLeft

func StrTrimLeft(s string, cutset string) string

func StrTrimLeftWhitespaces

func StrTrimLeftWhitespaces(s string) string

func StrTrimRight

func StrTrimRight(s string, cutset string) string

func StrTrimRightWhitespaces

func StrTrimRightWhitespaces(s string) string

func StrTrimWhitespaces

func StrTrimWhitespaces(s string) string

func StrUcFirst

func StrUcFirst(s string) string

func StrUcWords

func StrUcWords(s string) string

func StrUnicodeLen

func StrUnicodeLen(str string) int

PHP mb_strlen()

func StrWordCount

func StrWordCount(str string) []string

PHP str_word_count()

func TextCutByLimit

func TextCutByLimit(s string, length int) string

func ThreefishDecryptCBC

func ThreefishDecryptCBC(str string, key string, useArgon2id bool) string

func ThreefishDecryptTwofishBlowfishCBC

func ThreefishDecryptTwofishBlowfishCBC(str string, key string, useArgon2id bool) string

func ThreefishEncryptCBC

func ThreefishEncryptCBC(str string, key string, useArgon2id bool, randomize bool) string

func ThreefishEncryptTwofishBlowfishCBC

func ThreefishEncryptTwofishBlowfishCBC(str string, key string, useArgon2id bool, randomize bool) string

func TimeNowLocal

func TimeNowLocal() int64

func TimeNowUtc

func TimeNowUtc() int64

func TimeUnixNanoMathRandHandler

func TimeUnixNanoMathRandHandler() *mrand.Rand

func TwofishDecryptBlowfishCBC

func TwofishDecryptBlowfishCBC(str string, key string) string

func TwofishDecryptCBC

func TwofishDecryptCBC(str string, key string) string

func TwofishEncryptBlowfishCBC

func TwofishEncryptBlowfishCBC(str string, key string, randomize bool) string

func TwofishEncryptCBC

func TwofishEncryptCBC(str string, key string, randomize bool) string

func UInt64ToHex

func UInt64ToHex(num uint64) string

func UnEscapeHtml

func UnEscapeHtml(s string) string

works for HTML and XML too ...

func ValidateCookieName

func ValidateCookieName(cookieName string) bool

func ValidateIPAddrList

func ValidateIPAddrList(ipList string) error

func WaitCmd

func WaitCmd(cmd *exec.Cmd) error

wait for a command started with StartCmd() to finalize ; may be defered or executed async in order to call KillCmd after it

func XmlConvertToJson

func XmlConvertToJson(xmlData string) (string, error)

func XmlEncode

func XmlEncode(data interface{}, prettyprint bool, includeHeader bool) (string, error)

func XmlNoErrChkEncode

func XmlNoErrChkEncode(data interface{}, prettyprint bool, includeHeader bool) string

func YamlDataCompose

func YamlDataCompose(yamlMap map[string]interface{}) (yamlData string, errMsg error)

func YamlDataParse

func YamlDataParse(yamlData string) (yamlMap map[string]interface{}, errMsg error)

Types

type AuthDataProvider

type AuthDataProvider struct {
	// contains filtered or unexported fields
}

func (*AuthDataProvider) Init

func (p *AuthDataProvider) Init(name string) error

func (*AuthDataProvider) IsInitialized

func (p *AuthDataProvider) IsInitialized() (bool, error)

func (*AuthDataProvider) ParseAndValidateAuthTokenRecord

func (p *AuthDataProvider) ParseAndValidateAuthTokenRecord(authUserName string, authUserToken string, arrTokenRecord map[string]interface{}) (AuthUserToken, error)

func (*AuthDataProvider) ParseAndValidateAuthUserRecord

func (p *AuthDataProvider) ParseAndValidateAuthUserRecord(authUserName string, arrUserRecord map[string]interface{}) (AuthUserRecord, error)

func (*AuthDataProvider) SetError

func (p *AuthDataProvider) SetError(err error) bool

type AuthDataStruct

type AuthDataStruct struct {
	OK           bool              `json:"ok"`           // TRUE | FALSE
	ErrMsg       string            `json:"errMsg"`       // error message (if any) or empty string
	Method       uint8             `json:"method"`       // see: HTTP_AUTH_MODE_*
	Area         string            `json:"area"`         // Auth Area
	Realm        string            `json:"realm"`        // Auth Realm
	UserID       string            `json:"userId"`       // User ID (if no specific ID can be the same as User Name) ; it may be different than UserName ; UserID is intended only for internal use in contrast with UserName which is public
	UserName     string            `json:"userName"`     // User Name
	PassHash     string            `json:"-"`            // Password Hash
	PassAlgo     uint8             `json:"-"`            // Password Hash Algo ; 0 for SafePassHashSmart ; 1..255 for the rest
	RawAuthData  string            `json:"-"`            // Auth Raw Data, reserved for special usage, ex: auth cookie pre-auth
	TokenData    string            `json:"-"`            // Auth Token Data (Ex: JWT Token)
	TokenAlgo    string            `json:"-"`            // Token Algo (Ex: `JWT:Ed448`)
	SecurityKey  string            `json:"-"`            // Security Key
	PubKey       string            `json:"pubKey"`       // Public Key
	PrivKey      string            `json:"-"`            // Private Key
	Privileges   string            `json:"privileges"`   // Privileges: <priv1>,<priv2>,...
	Restrictions string            `json:"restrictions"` // Restrictions: <restr1>,<restr2>,...
	EmailAddr    string            `json:"emailAddr"`    // User Email Address
	FullName     string            `json:"fullName"`     // Full Name
	Quota        int64             `json:"quota"`        // Quota: -1 no quota ; 0 unlimited ; > 1 MB
	MetaData     map[string]string `json:"metaData"`     // MetaData ... Associative Array {"key1":"Val1", "key2":"Val2", ...}
}

PRIVATE

func AuthDataInit

func AuthDataInit(ok bool, errMsg string, method uint8, area string, realm string, userID string, userName string, passHash string, passAlgo uint8, tokenData string, tokenAlgo string, emailAddr string, fullName string, privileges string, restrictions string, privKey string, pubKey string, secKey string, quota int64, metaData map[string]string) AuthDataStruct

func AuthUserPassDefaultCheck

func AuthUserPassDefaultCheck(authRealm string, user string, pass string, authMode uint8, requiredUsername string, requiredPassword string, passHashAlgo uint8, emailAddr string, fullName string, privileges string, restrictions string, privKey string, pubKey string, secKey string, quota int64, metaData map[string]string) (bool, AuthDataStruct)

func AuthUserTokenDefaultCheck

func AuthUserTokenDefaultCheck(authRealm string, user string, token string, authMode uint8, requiredUsername string, requiredToken string, emailAddr string, fullName string, privileges string, restrictions string, privKey string, pubKey string, secKey string, quota int64, metaData map[string]string) (bool, AuthDataStruct)

type AuthProvider

type AuthProvider interface {
	IsInitialized() (bool, error)
	SetError(err error) bool
	Init(name string) error
	ParseAndValidateAuthUserRecord(authUserName string, arrUserRecord map[string]interface{}) (AuthUserRecord, error)
	ParseAndValidateAuthTokenRecord(authUserName string, authUserToken string, arrTokenRecord map[string]interface{}) (AuthUserToken, error)
}

type AuthUserRecord

type AuthUserRecord struct {
	Exists        bool
	IsValid       bool
	UserID        string
	UserName      string
	PassHash      string
	PassAlgo      uint8
	Totp2FASecret string
	SecurityKey   string
	PrivKey       string
	PubKey        string
	EmailAddr     string
	FullName      string
	Privileges    string
	Restrictions  string
	Quota         int64
	MetaData      map[string]string
}

type AuthUserToken

type AuthUserToken struct {
	Exists       bool
	IsValid      bool
	TokenHash    string
	UserName     string
	Privileges   string
	Restrictions string
	Expiration   string
	IsExpired    bool
}

type MailMessageStruct

type MailMessageStruct struct {
	FromAddress  string
	FromName     string
	ToAddresses  []string
	CcAddresses  []string
	BccAddresses []string
	Subject      string
	Body         string
	AltBody      string
	IsHtml       bool
	Embedds      map[string]string
	Attachments  map[string]string
	Encoding     string
}

type SMarkdownParser

type SMarkdownParser struct {
	// contains filtered or unexported fields
}

func NewSMarkdown

func NewSMarkdown(sBreakEnabled bool, mediaExtraEnabled bool, sfiExtraEnabled bool, lazyLoadImgUnveil bool, lazyLoadImgDefault string, relativeUrlPrefix string) (*SMarkdownParser, error)

func (*SMarkdownParser) Parse

func (m *SMarkdownParser) Parse(mkdw string) string

type SmtpConfig

type SmtpConfig struct {
	MxDomain string
	Host     string
	Port     uint16
	TlsMode  string
	AuthType string
	AuthUser string
	AuthPass string
}

func SmtpGetDefaultConfig

func SmtpGetDefaultConfig() *SmtpConfig

Directories

Path Synopsis
colorstring module
crypto
bcrypt
Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing algorithm.
Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing algorithm.
blowfish
Package blowfish implements Bruce Schneier's Blowfish encryption algorithm.
Package blowfish implements Bruce Schneier's Blowfish encryption algorithm.
dhkx
REQUIRE: go 1.16 or later
REQUIRE: go 1.16 or later
eddsa/ed448
Package ed448 implements Ed448 signature scheme as described in RFC-8032.
Package ed448 implements Ed448 signature scheme as described in RFC-8032.
eddsa/edx25519
Package edx25519 implements Ed25519 signature scheme as described in RFC-8032.
Package edx25519 implements Ed25519 signature scheme as described in RFC-8032.
eddsa/edx448
Package edx448 implements Ed448 signature scheme as described in RFC-8032.
Package edx448 implements Ed448 signature scheme as described in RFC-8032.
eddsa/internal/ecc/goldilocks
Package goldilocks provides elliptic curve operations over the goldilocks curve.
Package goldilocks provides elliptic curve operations over the goldilocks curve.
eddsa/internal/math
Package math provides some utility functions for big integers.
Package math provides some utility functions for big integers.
eddsa/internal/math/fp25519
Package fp25519 provides prime field arithmetic over GF(2^255-19).
Package fp25519 provides prime field arithmetic over GF(2^255-19).
eddsa/internal/math/fp448
Package fp448 provides prime field arithmetic over GF(2^448-2^224-1).
Package fp448 provides prime field arithmetic over GF(2^448-2^224-1).
eddsa/internal/math/mlsbset
Package mlsbset provides a constant-time exponentiation method with precomputation.
Package mlsbset provides a constant-time exponentiation method with precomputation.
pbkdf2
Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0.
Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0.
sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
threefish
Package threefish implements the Threefish tweakable block cipher.
Package threefish implements the Threefish tweakable block cipher.
twofish
Package twofish implements Bruce Schneier's Twofish encryption algorithm.
Package twofish implements Bruce Schneier's Twofish encryption algorithm.
data-structs
fastjson
Package fastjson provides fast JSON parsing.
Package fastjson provides fast JSON parsing.
tidwall/gjson
Package gjson provides searching for json strings.
Package gjson provides searching for json strings.
tidwall/match
Package match provides a simple pattern matcher with unicode support.
Package match provides a simple pattern matcher with unicode support.
tidwall/secret
Package secret provides simple utilities for encrypting and decrypting data.
Package secret provides simple utilities for encrypting and decrypting data.
tidwall/sjson
Package sjson provides setting json values.
Package sjson provides setting json values.
yaml
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
db
REQUIRE: go 1.19 or later
REQUIRE: go 1.19 or later
lib-pq
Package pq is a pure Go Postgres driver for the database/sql package.
Package pq is a pure Go Postgres driver for the database/sql package.
lib-pq/oid
Package oid contains OID constants as defined by the Postgres server.
Package oid contains OID constants as defined by the Postgres server.
lib-pq/scram
Package scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
Package scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
mysql
Package mysql provides a MySQL driver for Go's database/sql package.
Package mysql provides a MySQL driver for Go's database/sql package.
redcon-srv
Package redcon implements a Redis compatible server framework
Package redcon implements a Redis compatible server framework
redigo/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.
redigo/redisx
Package redisx contains experimental features for Redigo.
Package redisx contains experimental features for Redigo.
sqlite3
Package sqlite3 provides interface to SQLite3 databases.
Package sqlite3 provides interface to SQLite3 databases.
fastjson module
gui
logutils module
markup
markdown
Package markdown implements markdown parser and HTML renderer.
Package markdown implements markdown parser and HTML renderer.
markdown/ast
Package ast defines tree representation of a parsed markdown document.
Package ast defines tree representation of a parsed markdown document.
markdown/html
Package html implements HTML renderer of parsed markdown document.
Package html implements HTML renderer of parsed markdown document.
markdown/parser
Package parser implements parser for markdown text that generates AST (abstract syntax tree).
Package parser implements parser for markdown text that generates AST (abstract syntax tree).
svg-qrcode
Package qrcode implements a QR Code encoder.
Package qrcode implements a QR Code encoder.
svg-qrcode/bitset
Package bitset implements an append only bit array.
Package bitset implements an append only bit array.
svg-qrcode/reedsolomon
Package reedsolomon provides error correction encoding for QR Code 2005.
Package reedsolomon provides error correction encoding for QR Code 2005.
regexp2 module
textproc
difflib
Package difflib is a partial port of Python difflib module.
Package difflib is a partial port of Python difflib module.
natsort
Package natural defines a natural "less" to compare two strings while interpreting natural numbers.
Package natural defines a natural "less" to compare two strings while interpreting natural numbers.
regexp2
Package regexp2 is a regexp package that has an interface similar to Go's framework regexp engine but uses a more feature full regex engine behind the scenes.
Package regexp2 is a regexp package that has an interface similar to Go's framework regexp engine but uses a more feature full regex engine behind the scenes.
threefish module
ui
utils
log-utils
Package logutils augments the standard log package with levels
Package logutils augments the standard log package with levels
mail
Package gomail provides a simple interface to compose emails and to mail them efficiently.
Package gomail provides a simple interface to compose emails and to mail them efficiently.
uuid module
web
assets/srv-assets
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)
assets/web-assets
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower versions)
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower versions)
httputils
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)
jwt
webdav
Package webdav provides a WebDAV server implementation.
Package webdav provides a WebDAV server implementation.
webdav/internal/xml
Package xml implements a simple XML 1.0 parser that understands XML name spaces.
Package xml implements a simple XML 1.0 parser that understands XML name spaces.
websrv
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)
web-socket
websocket
Package websocket implements the WebSocket protocol defined in RFC 6455.
Package websocket implements the WebSocket protocol defined in RFC 6455.
websocket/examples/autobahn
Command server is a test server for the Autobahn WebSockets Test Suite.
Command server is a test server for the Autobahn WebSockets Test Suite.
ws-msgpak-srv-cli
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)
Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)
webview module
webview2 module

Jump to

Keyboard shortcuts

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