misc

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceKey     = "rid"
	RegionHeaderKey = "X-Region"
)
View Source
const (
	ResourcePrefix = "res"

	ZipSuffix = ".zip"

	DefaultResourceName = "resource.zip"

	DispensePrefix = "dispense"
)
View Source
const (
	GenerateTagKey         = "generate"
	LoadStoreNewVersionKey = "LoadStoreNewVersionTx"
)
View Source
const SniffLen = 4

Variables

View Source
var (
	StorageInfoNotFound = errors.New("storage info not found")

	NotAllowedFileType = errors.New("not allowed file type")

	ResourceLimitError = errors.New("your cdkey has reached the most downloads today")

	ResourceNotFound = errors.New("resource not found")
)
View Source
var (
	OsMap = map[string]string{

		"": "",

		"windows": "windows",
		"win":     "windows",
		"win32":   "windows",

		"linux": "linux",

		"darwin": "darwin",
		"macos":  "darwin",
		"mac":    "darwin",
		"osx":    "darwin",

		"android": "android",
	}

	ArchMap = map[string]string{

		"": "",

		"386":    "386",
		"x86":    "386",
		"x86_32": "386",
		"i386":   "386",

		"amd64":   "amd64",
		"x64":     "amd64",
		"x86_64":  "amd64",
		"intel64": "amd64",

		"arm": "arm",

		"arm64":   "arm64",
		"aarch64": "arm64",
	}

	ChannelMap = map[string]string{

		"":       "stable",
		"stable": "stable",

		"beta": "beta",

		"alpha": "alpha",
	}

	TotalChannel = []string{"stable", "beta", "alpha"}
	TotalOs      = []string{"", "windows", "linux", "darwin", "android"}
	TotalArch    = []string{"", "386", "arm64", "amd64", "arm"}
)
View Source
var LIT = &sync.Map{}
View Source
var ValidID = sync.Pool{
	New: func() interface{} {
		return regexp.MustCompile("^[a-zA-Z0-9_-]+$")
	},
}

Functions

func CompareIfAbsent

func CompareIfAbsent(m *sync.Map, key string) *atomic.Int32

Types

type RemoteError

type RemoteError string

func (RemoteError) Error

func (r RemoteError) Error() string

Jump to

Keyboard shortcuts

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