utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpperChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

	NumChar  = "1234567890"
	WordChar = UpperChar + lowerChar
	FullChar = WordChar + NumChar
)

Variables

This section is empty.

Functions

func DownloadAndExtractLatestRelease added in v0.1.5

func DownloadAndExtractLatestRelease(repoURL, targetDir string, forceDownload bool) error

func GetFileExt added in v0.0.3

func GetFileExt(url string) string

func IsValidIP added in v0.0.6

func IsValidIP(ip string) (ipv4 bool, err error)

func ParseNetworkInput

func ParseNetworkInput(input string) []string

func ParsePortRange added in v0.0.6

func ParsePortRange(portStr string) (ports []int)

1,2,80-100,...

func RandStringBytes added in v0.0.3

func RandStringBytes(n int) string

func RemoveAnyDuplicate added in v0.0.6

func RemoveAnyDuplicate[T comparable](list []T) []T

func RemoveStrSliceDuplicate added in v0.0.9

func RemoveStrSliceDuplicate(slice []string) (result []string)

Types

type GitHubRelease added in v0.1.5

type GitHubRelease struct {
	TagName    string `json:"tag_name"`
	ZipballURL string `json:"zipball_url"`
}

func CheckUpdate added in v0.1.5

func CheckUpdate(repoURL, targetDir string, forceDownload bool) (needUpdate bool, repo string, release *GitHubRelease, err error)

返回 (needDownload bool, err error)

Jump to

Keyboard shortcuts

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