Documentation
¶
Index ¶
- Variables
- func Error(format string, args ...any)
- func GenerateECHKeyPair(domain string) (echKey, echConfig string, err error)
- func GeneratePort() int
- func GenerateRealityKeyPair() (privateKey, publicKey string, err error)
- func GenerateRealityTarget() string
- func GenerateShortID(bytes int) (string, error)
- func GenerateShortIDs() ([]string, error)
- func GenerateString(n int) string
- func GenerateUUID() (string, error)
- func GenerateWireguardKeyPair() (privateKey, publicKey string, err error)
- func GetPublicIPs() (ipv4, ipv6 string)
- func GetPublicIPv4() string
- func GetPublicIPv6() string
- func Info(format string, args ...any)
- func InitLog(path, level string, enable bool)
- func SanitizeFileName(name string) string
- func ValidateDomain(domain string) bool
- func ValidateIPv4CIDR(addr string) bool
- func ValidateIPv6CIDR(addr string) bool
- func ValidatePort(port int, usedPorts []int) string
- func ValidateTag(tag string) string
- func Warn(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GenerateECHKeyPair ¶ added in v0.0.6
func GeneratePort ¶
func GeneratePort() int
func GenerateRealityKeyPair ¶
生成 Reality 密钥对
func GenerateRealityTarget ¶
func GenerateRealityTarget() string
func GenerateShortID ¶
生成单个 ShortID,指定长度(字节数,输出为 2*n 位 hex)
func GenerateShortIDs ¶
生成8个 ShortID,第一个长度随机但不短于4字节(8位hex),其余完全随机
func GenerateString ¶
func GenerateWireguardKeyPair ¶ added in v0.0.3
生成 WireGuard 密钥对
func GetPublicIPs ¶
func GetPublicIPs() (ipv4, ipv6 string)
func GetPublicIPv4 ¶
func GetPublicIPv4() string
func GetPublicIPv6 ¶
func GetPublicIPv6() string
func SanitizeFileName ¶ added in v0.0.2
SanitizeFileName 清除文件名中的非法字符
func ValidateDomain ¶
func ValidateIPv4CIDR ¶ added in v0.0.3
func ValidateIPv6CIDR ¶ added in v0.0.3
func ValidatePort ¶
func ValidateTag ¶ added in v0.0.3
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.