Documentation ¶
Index ¶
- func AppendCreate(name string) (*os.File, error)
- 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 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 实现一个协议、host、端口分离的函数
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.
Click to show internal directories.
Click to hide internal directories.