constants

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const FILENAME_MAX_LENGTH = 240
View Source
const LOCAL_CLIENT = "local"
View Source
const NAME = "erodownloader"
View Source
const NONE = "none"
View Source
const ORIG_DIR = ".orig"
View Source
const TMP_DIR = ".edtmp"

Variables

View Source
var ArchiveExts = []string{".rar", ".zip", ".7z"}

common archive exts: ".rar", ".zip", ".7z"...

View Source
var CjkCharsets = []string{
	"UTF-8",
	"Shift_JIS",
	"GB-18030",
	"EUC-KR",
	"EUC-JP",
	"Big5",
}

In priority order.

View Source
var CommonExts = []string{}

common exts. exts for same type file are sorted by popularity order.

View Source
var FilenameRestrictedCharacterReplacement = map[rune]rune{
	'/':  '/',
	'\\': '\',
}
View Source
var FilenameRestrictedCharacterReplacer *strings.Replacer

Replace invalid Windows filename chars to alternatives. E.g. '/' => '/', '?' => '?'

View Source
var FilepathRestrictedCharacterReplacement = map[rune]rune{
	'*': '*',
	':': ':',
	'<': '<',
	'>': '>',
	'|': '|',
	'?': '?',
	'"': '"',
}

It's a subset of https://rclone.org/overview/#restricted-filenames-caveats . Only include invalid filename characters in Windows (NTFS).

View Source
var FilepathRestrictedCharacterReplacer *strings.Replacer

Replace invalid Windows file path chars to alternatives. Similar to FilenameRestrictedCharacterReplacer, but do not replace '/' or '\'.

View Source
var ImgExts = []string{".webp", ".png", ".jpg", ".jpeg"}

common img exts: .webp, .png, .jpg...

View Source
var IncompleteFileExts = []string{".aria2", ".!qB"}

tmp files that are created or renamed to by download manager when downloading. E.g. ".aria2", ".!qB".

View Source
var PrivateIpRegexp = regexp.MustCompile(`(^127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^172\.1[6-9]{1}[0-9]{0,1}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^172\.2[0-9]{1}[0-9]{0,1}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^172\.3[0-1]{1}[0-9]{0,1}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^192\.168\.[0-9]{1,3}\.[0-9]{1,3}$)`)

Private ip, e.g. 192.168.0.0/16, 127.0.0.0/8, etc. from https://stackoverflow.com/questions/2814002/private-ip-address-identifier-in-regular-expression .

View Source
var Utf8bom = []byte{0xEF, 0xBB, 0xBF}

0xEF, 0xBB, 0xBF

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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