Documentation
¶
Index ¶
- func CloseDB(db *gorm.DB)
- func CompareAppVersion(version1, version2 string) bool
- func ComparePanelVersion(version1, version2 string) bool
- func CompareVersion(version1, version2 string) bool
- func ContainsChinese(text string) bool
- func FormatBytes(bytes uint64) string
- func FormatPercent(percent float64) string
- func GetDBWithPath(dbPath string) (*gorm.DB, error)
- func GetDockerComposeCommand() string
- func GetLang(c *gin.Context) string
- func GetSortedVersions(versions []string) []string
- func GetSystemVersion(versionString string) string
- func GetUuid() string
- func HandleIPList(content string) ([]string, error)
- func IsCrossVersion(version1, version2 string) bool
- func IsNum(s string) bool
- func IsValidDomain(domain string) bool
- func IsValidIP(ip string) bool
- func IsValidNginxServerName(serverName string) bool
- func LoadDBConnByPath(fullPath, dbName string) *gorm.DB
- func LoadDBConnByPathWithErr(fullPath, dbName string) (*gorm.DB, error)
- func LoadParams(param string) string
- func LoadParamsWithoutPanic(param string) string
- func LoadSizeUnit(value float64) string
- func LoadSizeUnit2F(value float64) string
- func LoadTimeZoneByCmd() string
- func ParseIPLoose(s string) net.IP
- func PunycodeEncode(text string) (string, error)
- func RandStr(n int) string
- func RandStrAndNum(n int) string
- func RemoveRepeatElement(a interface{}) (ret []interface{})
- func RemoveRepeatStr(list []string) (ret []string)
- func ScanPort(port int) bool
- func ScanPortWithIP(ip string, port int) bool
- func ScanPortWithProto(port int, proto string) bool
- func ScanUDPPort(port int) bool
- func SplitStr(str string, spi ...string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAppVersion ¶
func ComparePanelVersion ¶
func CompareVersion ¶
func ContainsChinese ¶
func FormatBytes ¶
func FormatPercent ¶
func GetDockerComposeCommand ¶
func GetDockerComposeCommand() string
func GetSortedVersions ¶
func GetSystemVersion ¶
func HandleIPList ¶
func IsCrossVersion ¶
func IsValidDomain ¶
func IsValidNginxServerName ¶
func LoadDBConnByPath ¶
func LoadDBConnByPathWithErr ¶
func LoadParams ¶
func LoadParamsWithoutPanic ¶
func LoadSizeUnit ¶
func LoadSizeUnit2F ¶
func LoadTimeZoneByCmd ¶
func LoadTimeZoneByCmd() string
func ParseIPLoose ¶
ParseIPLoose parses an IP address, accepting bracketed IPv6 forms such as "[::1]" or "[fe80::1%eth0]" in addition to the bare forms that net.ParseIP supports natively. It also trims surrounding whitespace. Returns nil for non-IP input, matching net.ParseIP.
This is required because some flows pass the host portion of a URL (e.g. "[::1]") rather than a bare IP address. Rejecting that form caused 1Panel-dev/1Panel#12646 — the panel SSL self-sign workflow reported “domain format invalid” for IPv6 hosts.
func PunycodeEncode ¶
func RandStrAndNum ¶
func RemoveRepeatElement ¶
func RemoveRepeatElement(a interface{}) (ret []interface{})
func RemoveRepeatStr ¶
func ScanPortWithIP ¶
func ScanPortWithProto ¶
func ScanUDPPort ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.