Documentation ¶
Index ¶
- func AppendCreate(name string) (*os.File, error)
- func CheckVersion(old, version string) bool
- func DataRoot(elem ...string) string
- func ExtractHost(rawURL string) string
- func ExtractURLs(text string) []string
- func FindOffset(file *os.File, target string) (int64, error)
- func FindStringInFile(filepath string, target string) bool
- func FindStringSubmatch(reg, str string) []string
- func GetCheckRedirectFunc(errUseLastResponse bool) func(req *defaultHttp.Request, via []*defaultHttp.Request) error
- func GetHash(body []byte, method string) ([]byte, error)
- func GetMainDomain(domain string) string
- func GetMatchVersion(defaultMatchDir string) (string, error)
- func GetPartString(part string, data map[string]interface{}) (interface{}, bool)
- func GetProtocolAndHost(url string) (string, string)
- func GetProtocolHostAndPort(path string) (string, string, int)
- func GetProxyFunc(proxy, auth string) func(*defaultHttp.Request) (*url.URL, error)
- func GetProxyURL(proxy, auth string) (*url.URL, error)
- func GetRequestPackage(request *http.Request) string
- func GetResponsePackage(response *defaultHttp.Response, body []byte, getBody bool) string
- func GetTrueUrl(text *url.URL) string
- func IsSubdomainOrSameDomain(orl string, link string) bool
- func IsValidDomain(domain string) bool
- func JoinPath(target, path string) string
- func ListFilesWithExtension(rootPath string, extensions ...string) ([]string, error)
- func MatchString(reg, str string) bool
- func NewProxyDialer(proxyUrl, proxyAuth string) (proxy.Dialer, error)
- func Nunzip(p string, zipReader *zip.Reader) error
- func ParseProxyAuth(auth string) (string, string, bool)
- func RandStr(length int) string
- func ReadFile(filename string) (string, error)
- func RemoveDuplicateAndEmptyStrings(arr []string) []string
- func RemoveDuplicateStrings(arr []string) []string
- func ReplaceStringsInFile(templateFile, oldString, newString string) error
- func ToString(data interface{}) string
- func Unzip(p string, reader *bytes.Reader) error
- func WriteFile(filename string, string2 string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶
func ExtractHost ¶
func ExtractURLs ¶
func FindStringInFile ¶
func FindStringSubmatch ¶
func GetCheckRedirectFunc ¶
func GetCheckRedirectFunc(errUseLastResponse bool) func(req *defaultHttp.Request, via []*defaultHttp.Request) error
GetCheckRedirectFunc 辅助函数:获取 CheckRedirect 函数
func GetMainDomain ¶
func GetMatchVersion ¶
func GetPartString ¶
func GetProtocolHostAndPort ¶
GetProtocolHostAndPort 返回 三个值 以下是案例 http://[A01F::0]:8000/ -> http, [A01F::0], 8000 http://[A01F::0]/a -> http, [A01F::0], 80 https://[A01F::0]/ -> https, [A01F::0], 443 [A01F::0]:8000 -> http, [A01F::0], 8000 [A01F::0] -> http, [A01F::0], 80 127.0.0.1:8000 -> http, 127.0.0.1, 8000 http://127.0.0.1:8000/?a=1 -> http, 127.0.0.1 8000 https://127.0.0.1 -> https, 127.0.0.1 443
func GetProxyFunc ¶
GetProxyFunc 辅助函数:获取代理设置函数
func GetRequestPackage ¶
func GetResponsePackage ¶
func GetResponsePackage(response *defaultHttp.Response, body []byte, getBody bool) string
func GetTrueUrl ¶
func IsSubdomainOrSameDomain ¶
func ListFilesWithExtension ¶
func MatchString ¶
func ParseProxyAuth ¶
ParseProxyAuth 辅助函数:解析代理授权信息(格式为“username:password”)
func RemoveDuplicateAndEmptyStrings ¶
移除字符串重复的、为空的的字符串
func RemoveDuplicateStrings ¶
RemoveDuplicateStrings 字符串数组去重
func ReplaceStringsInFile ¶
ReplaceStringsInFile 用于读取文件,替换其中的特定字符串,并在原文件上进行修改
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.