Documentation
¶
Index ¶
- Variables
- func AppendStringToFile(filePath, content string) error
- func BindJSON[T any](r *http.Request) (*T, error)
- func ByteCountIEC(b uint64) string
- func BytesToHexString(bytes []byte) string
- func BytesToString(b []byte, r ...int) string
- func CheckBinaryPack(data []byte) (byte, byte, bool)
- func CheckDir(dirPath string) bool
- func CheckVersionFromGithub() []string
- func CleanExt(name string) string
- func ClearDir(tmpPath string) error
- func ClearTmpDir() error
- func CompareVersions(v1, v2 string) int
- func CopyFile(src, dst string) error
- func DecAES(data []byte, key []byte) ([]byte, error)
- func Delete(filePath string, args ...string)
- func DirCheck(path string) error
- func Divide(a, b int) int
- func DivideAndCeil(a, b int) int
- func DownLoadBAK(url string, args ...string) (string, error)
- func DynamicSelect[T any](t []T, fun func(int, T) T) T
- func EncAES(data []byte, key []byte) ([]byte, error)
- func EnsureDir(path string) error
- func ExtractCodeBlocks(markdown string) []string
- func FormatSize(size int64) string
- func GenRandByte(n int) []byte
- func GetAppSpace() (string, string, string)
- func GetDataByJson[T any](r *http.Request) (*T, error)
- func GetFileNameByTime() string
- func GetFileNameFromUrl(rawURL string) string
- func GetFilenameFromHeader(header http.Header) string
- func GetFirstPathSegment(path string) string
- func GetFuncInstance[T any](name string, obj interface{}) *T
- func GetListeningPorts()
- func GetMD5(data []byte) ([]byte, string)
- func GetPointerInstance[T any](name string, obj interface{}) *T
- func GetSelfSize() uint64
- func GetSliceChunk[T any](data *[]T, start, end int) *[]T
- func GetSlicePrefix[T any](data *[]T, n int) *[]T
- func GetSliceSuffix[T any](data *[]T, n int) *[]T
- func GetStrUUID() string
- func GetStructInstance[T any](name string, obj interface{}) *T
- func GetTime() string
- func GetUUID() []byte
- func GetVersionByFileName(filename string) string
- func GithubApiReqest() ([]byte, error)
- func HasDiskSpace() bool
- func If[T any](b bool, t, f T) T
- func IsDirectoryExist(dirPath string) bool
- func IsExist(filePath string) bool
- func IsLinux() bool
- func IsMacOs() bool
- func IsPortOpen(host string, port int, timeout time.Duration) bool
- func IsURLValidAndAccessible(rawURL string) bool
- func IsWindows() bool
- func IsZipOrJson(filename string) (isZip, isJSON bool)
- func MakeDir(path string) error
- func Max[T int | int32 | int64 | uint | uint32 | uint64 | float32 | float64](a, b T) T
- func Min[T int | int32 | int64 | uint | uint32 | uint64 | float32 | float64](a, b T) T
- func MoveFileToDir(src string, dstDir string) error
- func ObjectToTomlText(obj interface{}) []byte
- func ParseMarkdownCodeToStringArray(body string) []string
- func PingRaw(ip string) bool
- func Read(filePath string) ([]byte, error)
- func ReadToml(filePath string) ([]byte, error)
- func RemoveSlice[T comparable](slice []T, value T) []T
- func ReplaceExecutable(currentPath, newPath string) error
- func ReplaceNewVersionBinName(filename, v string) string
- func RestartProgram() error
- func SaveFile(file multipart.File, fileSize int64, saveFilePath string) error
- func ScanIP() []string
- func ScanPort(host string, duration time.Duration, start, end int) []int
- func ScanPorts(host string, start, end int) []int
- func SetFieldValue(obj interface{}, fieldName string, value interface{}) error
- func ShowUpDirSize()
- func Shutdown() error
- func SignAndInstall(newBufferBytes, oldBufferBytes []byte, newFilePath string) (string, error)
- func SplitLastTwoByUnderscore(s string) []string
- func SplitVersion(v string) []string
- func StringContains(element string, data []string) bool
- func StringToBytes(s string, r ...int) []byte
- func TestToml()
- func ToUpperFirst(s string) string
- func TomlTextToObject(tomlBytes []byte, obj interface{}) error
- func Unzip(src, dest string) error
- func UnzipToRoot(zipFile, destDir string, strich bool) error
- func Write(filePath string, content []byte) error
- func WriteAppend(filePath string, content []byte) error
- func WriteFile(filePath string, data []byte) error
- func WriteToml(filePath string, data []byte) error
- func XOR(data []byte, key []byte) []byte
- func Zip(dir, dst string) error
- type GeneralResponse
- type Node
- type Option
- type ProgressWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEntityInvalid = errors.New(`common.ENTITY_INVALID`) ErrFailedVerification = errors.New(`common.ENTITY_CHECK_FAILED`) )
View Source
var GithuApi = "https://api.github.com/repos/xxl6097/go-frp-panel/releases/latest"
Functions ¶
func AppendStringToFile ¶
func ByteCountIEC ¶ added in v0.1.91
func BytesToHexString ¶
func BytesToString ¶
func CheckVersionFromGithub ¶
func CheckVersionFromGithub() []string
func ClearTmpDir ¶ added in v0.2.0
func ClearTmpDir() error
func CompareVersions ¶
CompareVersions 0:相等;1:v1>v2;-1:v1<v2
func DynamicSelect ¶
func ExtractCodeBlocks ¶ added in v0.1.55
func FormatSize ¶
func GenRandByte ¶
func GetAppSpace ¶ added in v0.2.15
func GetFileNameByTime ¶
func GetFileNameByTime() string
func GetFileNameFromUrl ¶
func GetFilenameFromHeader ¶
func GetFirstPathSegment ¶ added in v0.2.6
GetFirstPathSegment 获取路径第一个有效段(优化实现)
func GetFuncInstance ¶
func GetListeningPorts ¶
func GetListeningPorts()
func GetPointerInstance ¶
func GetSelfSize ¶ added in v0.1.68
func GetSelfSize() uint64
func GetSliceChunk ¶
func GetSlicePrefix ¶
func GetSliceSuffix ¶
func GetStrUUID ¶
func GetStrUUID() string
func GetStructInstance ¶
func GetVersionByFileName ¶ added in v0.1.82
func GithubApiReqest ¶ added in v0.2.10
func HasDiskSpace ¶ added in v0.1.83
func HasDiskSpace() bool
func IsDirectoryExist ¶
func IsURLValidAndAccessible ¶
IsURLValidAndAccessible 检查 URL 是否有效并且可访问
func IsZipOrJson ¶
IsZipOrJson 根据后缀判断文件类型(仅后缀匹配)
func MoveFileToDir ¶ added in v0.1.82
func ObjectToTomlText ¶
func ObjectToTomlText(obj interface{}) []byte
func ParseMarkdownCodeToStringArray ¶ added in v0.1.82
func ReplaceExecutable ¶
ReplaceExecutable 替换当前可执行文件
func SetFieldValue ¶
SetFieldValue 使用反射给结构体的字段赋值
func ShowUpDirSize ¶ added in v0.1.83
func ShowUpDirSize()
func SignAndInstall ¶
func SplitLastTwoByUnderscore ¶ added in v0.1.92
func SplitVersion ¶
func StringContains ¶
func StringToBytes ¶
func TomlTextToObject ¶
func UnzipToRoot ¶
func WriteAppend ¶
Types ¶
type GeneralResponse ¶
Click to show internal directories.
Click to hide internal directories.