Documentation
¶
Overview ¶
- Package common @Author: zhizhuo @IDE:GoLand @File: common.go @Date: 2025/2/20 下午3:37*
- Package common @Author: zhizhuo @IDE:GoLand @File: file.go @Date: 2025/2/20 下午3:37*
- Package common @Author: zhizhuo @IDE:GoLand @File: yaml.go @Date: 2025/4/2 下午2:02*
Index ¶
- Constants
- func Base64Encode(braw []byte) []byte
- func DealMultipart(contentType string, ruleBody string) (result string, err error)
- func Exists(path string) bool
- func FromHex(data string) string
- func GetRandomIP() string
- func IsYamlFile(filename string) bool
- func Mmh3Hash32(raw []byte) int32
- func ParseTarget(target, path string) string
- func ParseUrl(u *url.URL) *proto.UrlType
- func RandFromChoices(n int, choices string) string
- func RandLetters(n int) string
- func RandomString(len int) string
- func RandomUA() string
- func RemoveDuplicateURLs(urls []string) []string
- func RemoveTrailingSlash(url string) string
- func ReverseString(s string) string
- func Str2UTF8(str string) string
- func Url2UrlType(u *url.URL) *proto.UrlType
- func UrlTypeToString(u *proto.UrlType) string
- type AddressInfo
Constants ¶
View Source
const ( HttpType = "http" TcpType = "tcp" UdpType = "udp" SslType = "ssl" GoType = "go" )
Variables ¶
This section is empty.
Functions ¶
func DealMultipart ¶
DealMultipart 处理multipart的/n问题
func RandFromChoices ¶
RandFromChoices 从choices里面随机获取
func RandomUA ¶
func RandomUA() string
RandomUA 返回一个高度真实的随机 User-Agent 保证平台-浏览器-版本号的搭配逻辑正确(如 Safari 只出现在 Apple 平台)
func RemoveDuplicateURLs ¶
RemoveDuplicateURLs 去除重复的URL
func RemoveTrailingSlash ¶
RemoveTrailingSlash 删除URL中的最后一个/
func ReverseString ¶
func UrlTypeToString ¶
Types ¶
type AddressInfo ¶
AddressInfo 封装解析结果的结构体
func ParseAddress ¶
func ParseAddress(address string) (AddressInfo, error)
ParseAddress 解析地址并返回 AddressInfo
Click to show internal directories.
Click to hide internal directories.