Documentation ¶
Index ¶
- Constants
- Variables
- func AutoConvertTextToUtf8(data []byte) (utf8Data []byte, err error)
- func CanTrigger(ss []string, triggers []string, allowNoSpace bool, removeColor bool) (bool, []string)
- func Compact(cmd string) []string
- func Copy(srcFile, dstFile string) error
- func CopyDirectory(scrDir, dest string) error
- func CopySymLink(source, dest string) error
- func CreateIfNotExists(dir string, perm os.FileMode) error
- func DownloadMicroContent(sourceUrl string) ([]byte, error)
- func DownloadSmallContent(sourceUrl string) ([]byte, error)
- func Exists(filePath string) bool
- func FormatByReplacingOccurrences(tmp string, replacements map[string]interface{}) string
- func GBKTextToUTF8Text(gbkText []byte) (utf8Text []byte, err error)
- func GZIPDecompress(src io.Reader, dst string) error
- func GenerateMCColorReplacerRule() []string
- func GenerateMCColorReplacerWriter(writer io.Writer) io.Writer
- func GetAvailablePort() (int, error)
- func GetBinaryHash(fileData []byte) string
- func GetFileData(fname string) ([]byte, error)
- func GetFileHash(filePath string) (string, error)
- func GetFileNotFindStack(path string) (find bool, isDir bool, errStr []string)
- func GetJsonData(fname string, ptr interface{}) error
- func GetJsonDataWithAttachment(fname string, ptr interface{}) (remapping map[string]map[string]string, err error)
- func GetStringContents(s string) []string
- func GetUnZipSize(zipFile string) (int64, error)
- func InsertHead[T any](elem0 T, l []T) []T
- func IsDir(path string) bool
- func IsDirEmpty(dir string) bool
- func IsFile(path string) bool
- func IsGBK(data []byte) (isGBK bool, failAtPos int)
- func IsPortAvailable(port int) bool
- func IsUtf8(data []byte) (isUtf8 bool, failAtPos int)
- func MakeDirP(path string) error
- func MoveDir(oldPath, newPath string) (err error)
- func PostWriteJsonFile(w io.Writer, mapping map[string]map[string]string)
- func PreScanJsonFile(data []byte, mapping map[string]map[string]string) (reducedJson []byte, err error)
- func RemoveFormat(in string) string
- func SimplePrase(cmds *[]string, argNames []string, data interface{}, firstVal bool) bool
- func StringToTime(timeStr string) (time.Time, error)
- func StringToTimeWithLocal(timeStr string) (time.Time, error)
- func TimeToString(t time.Time) string
- func ToPlainName(raw_name string) string
- func UnZip(zipFile io.ReaderAt, size int64, dstDir string) error
- func WriteJsonData(fname string, data interface{}) error
- func WriteJsonDataWithAttachment(fname string, data interface{}, remapping map[string]map[string]string) error
- func Zip(srcDir string, zipFile *os.File, ...) error
- type Encoding
- type MCColorReplacerWriter
- type PREPARED_PLATFORM_MARK
- type SimpleDeployer
- type WriteCounter
Constants ¶
View Source
const ( // for some specific platform, it could be useful if we provide some specific data/information, so let's us mark them first PLATFORM_ALL = PREPARED_PLATFORM_MARK(-1) PLATFORM_NOT_PROVIDED = PREPARED_PLATFORM_MARK(iota) PLATFORM_LINUX_AMD64 PLATFORM_LINUX_ARM64 PLATFORM_MACOS_AMD64 PLATFORM_MACOS_ARM64 PLATFORM_ANDROID_ARM64 PLATFORM_WINDOWS_AMD64 PLATFORM_WINDOWS_X86 )
View Source
const ( UNKNOWN = Encoding(iota) UTF8 GBK )
Variables ¶
View Source
var PLATFORM_MARK_FOR_PREPARED = PLATFORM_NOT_PROVIDED
View Source
var PLATFORM_NAME_STR = runtime.GOOS + "_" + runtime.GOARCH
View Source
var PktIDInvMapping map[int]string
View Source
var PktIDMapping map[string]int
View Source
var PktIDNames []string
Functions ¶
func AutoConvertTextToUtf8 ¶
func CanTrigger ¶
func CopyDirectory ¶
func CopySymLink ¶
func DownloadMicroContent ¶
func DownloadSmallContent ¶
func GBKTextToUTF8Text ¶
func GenerateMCColorReplacerRule ¶
func GenerateMCColorReplacerRule() []string
func GetAvailablePort ¶
func GetBinaryHash ¶
func GetFileData ¶
func GetFileHash ¶
func GetFileNotFindStack ¶
func GetJsonData ¶
func GetStringContents ¶
func GetUnZipSize ¶
func InsertHead ¶
func InsertHead[T any](elem0 T, l []T) []T
func IsDirEmpty ¶
func PreScanJsonFile ¶
func RemoveFormat ¶
func SimplePrase ¶
func TimeToString ¶
func ToPlainName ¶
func WriteJsonData ¶
Types ¶
type MCColorReplacerWriter ¶
type MCColorReplacerWriter struct {
// contains filtered or unexported fields
}
type PREPARED_PLATFORM_MARK ¶
type PREPARED_PLATFORM_MARK int
type SimpleDeployer ¶
type SimpleDeployer struct { CacheFilePath string TargetDeployDir string SourceFileURL string SourceFileMD5 string SourceFileMD5ByURL string }
func (*SimpleDeployer) Deploy ¶
func (o *SimpleDeployer) Deploy() (err error)
type WriteCounter ¶
type WriteCounter struct { Total uint64 DownloadSize uint64 ProgressBar *pb.ProgressBar }
func (WriteCounter) PrintProgress ¶
func (wc WriteCounter) PrintProgress()
Click to show internal directories.
Click to hide internal directories.