Documentation
¶
Index ¶
- func ConvertHeaders(headers []string) map[string]string
- func ConvertTimeIntToString(timestamp int64) (string, error)
- func ConvertTimeStringToInt(timeStr string) (int64, error)
- func ExtractHost(hostAndPort string) string
- func FilterURLParam(url string, filters []string) string
- func GetAllIPs() (ipList []string, err error)
- func GetIPAndPortFromNode(node string, defaultPort int) (string, int)
- func IsValidIP(ip string) bool
- func IsValidURL(url string) bool
- func NetLimit() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertHeaders ¶
ConvertHeaders converts headers from array type to map type for http request.
func ConvertTimeIntToString ¶
ConvertTimeIntToString converts an int64 timestamp to a string time.
func ConvertTimeStringToInt ¶
ConvertTimeStringToInt converts a string time to an int64 timestamp.
func ExtractHost ¶
ExtractHost extracts host ip from the giving string.
func FilterURLParam ¶
FilterURLParam filters request queries in URL. Eg: If you pass parameters as follows:
url: http://a.b.com/locate?key1=value1&key2=value2&key3=value3 filter: key2
and then you will get the following value as the return:
http://a.b.com/locate?key1=value1&key3=value3
func GetIPAndPortFromNode ¶
GetIPAndPortFromNode return ip and port by parsing the node value. It will return defaultPort as the value of port when the node is a string without port or with an illegal port.
func IsValidURL ¶
IsValidURL returns whether the string url is a valid HTTP URL.
Types ¶
This section is empty.