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{}) (string, 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 JoinPath(target, path string) string
- func ListFilesWithExtension(rootPath, extension 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 ¶ added in v1.5.0
func ExtractHost ¶
func ExtractURLs ¶
func FindStringInFile ¶ added in v1.2.1
func FindStringSubmatch ¶
func GetCheckRedirectFunc ¶
func GetCheckRedirectFunc(errUseLastResponse bool) func(req *defaultHttp.Request, via []*defaultHttp.Request) error
GetCheckRedirectFunc 辅助函数:获取 CheckRedirect 函数
func GetMainDomain ¶ added in v1.4.0
func GetMatchVersion ¶ added in v1.3.0
func GetPartString ¶ added in v1.4.2
func GetProtocolAndHost ¶ added in v1.4.8
从url中辨别协议,分离 协议 和 域名
func GetProtocolHostAndPort ¶ added in v1.4.8
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 NewProxyDialer ¶ added in v1.3.0
func Nunzip ¶
compareAndWriteTemplates compares and returns the stats of a template update operations.
func ParseProxyAuth ¶
ParseProxyAuth 辅助函数:解析代理授权信息(格式为“username:password”)
func RemoveDuplicateAndEmptyStrings ¶ added in v1.4.6
移除字符串重复的、为空的的字符串
func RemoveDuplicateStrings ¶ added in v1.4.4
RemoveDuplicateStrings 字符串数组去重
func ReplaceStringsInFile ¶
ReplaceStringsInFile 用于读取文件,替换其中的特定字符串,并在原文件上进行修改
Types ¶
This section is empty.