FlowX

package module
v0.0.0-...-c49d3f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRequestHeader

func AddRequestHeader(request *http.Request, key, value string)

func AddRequestHeaders

func AddRequestHeaders(request *http.Request, headers map[string]string)

func Base64Decode

func Base64Decode(str string) (string, error)

func Base64Encode

func Base64Encode(str string) string

func CloseWebSocketConnection

func CloseWebSocketConnection(conn *websocket.Conn, closeCode int, closeMessage string) error

func CountStringOccurrences

func CountStringOccurrences(input, substr string) (int, error)

func CreateDirectory

func CreateDirectory(dirName string) error

func CreateGetRequest

func CreateGetRequest(url string) (*http.Request, error)

func CreateHTTPClient

func CreateHTTPClient(autoRedirect bool, proxyConfig *ProxyConfig) (*http.Client, error)

func CreatePostRequest

func CreatePostRequest(url string, contentType string, body io.Reader) (*http.Request, error)

func CreateWebSocketConnection

func CreateWebSocketConnection(url string) (*websocket.Conn, error)

func CurrentUnixTime

func CurrentUnixTime() int64

func DecryptAES

func DecryptAES(ciphertext []byte, key []byte) ([]byte, error)

func DeleteFile

func DeleteFile(filename string) error

func DeserializeJSON

func DeserializeJSON(jsonData []byte, target interface{}) error

func DownloadFile

func DownloadFile(url string, outputPath string) error

func EncryptAES

func EncryptAES(data []byte, key []byte) ([]byte, error)

func ExecuteRequest

func ExecuteRequest(client *http.Client, request *http.Request) (*http.Response, error)

func FileExists

func FileExists(filename string) bool

func GetCookiesByNames

func GetCookiesByNames(resp *http.Response, cookieNames []string) ([]*http.Cookie, error)

func GetResponseBody

func GetResponseBody(response *http.Response) (string, error)

func HashSHA256

func HashSHA256(data []byte) ([]byte, error)

func IsEmailValid

func IsEmailValid(email string) bool

func IsPhoneNumberValid

func IsPhoneNumberValid(phoneNumber string) bool

func IsURLValid

func IsURLValid(urlString string) bool

func MapKeys

func MapKeys(m map[string]interface{}) []string

func MultiThread

func MultiThread(fn func(), numThreads int)

func MultiThreadForEachLine

func MultiThreadForEachLine(lines []string, fn func(line string), numThreads int)

func ParseLR

func ParseLR(str, before, after string) (string, error)

func RandomString

func RandomString(length int) (string, error)

func RandomUserAgent

func RandomUserAgent(request *http.Request)

func ReadFile

func ReadFile(filename string) ([]byte, error)

func ReadWebSocketMessage

func ReadWebSocketMessage(conn *websocket.Conn) (messageType int, p []byte, err error)

func ReplaceString

func ReplaceString(input, old, new string) string

func ReverseString

func ReverseString(str string) string

func SerializeJSON

func SerializeJSON(data interface{}) ([]byte, error)

func SetUserAgent

func SetUserAgent(request *http.Request, agent string)

func SingleThread

func SingleThread(fn func())

func StringSliceContains

func StringSliceContains(slice []string, value string) bool

func URLDecodeString

func URLDecodeString(input string) (string, error)

func URLEncodeString

func URLEncodeString(input string) string

func UploadFile

func UploadFile(filePath string, uploadURL string, headers http.Header) error

func UseProxy

func UseProxy(proxyConfig *ProxyConfig, request *http.Request) error

func WebSocketHandler

func WebSocketHandler(w http.ResponseWriter, r *http.Request)

func WriteFile

func WriteFile(filename string, data []byte) error

func WriteWebSocketMessage

func WriteWebSocketMessage(conn *websocket.Conn, messageType int, data []byte) error

Types

type ProgressReader

type ProgressReader struct {
	Reader   io.Reader
	Progress int64
}

func (*ProgressReader) Read

func (pr *ProgressReader) Read(p []byte) (n int, err error)

type ProxyConfig

type ProxyConfig struct {
	Type     ProxyType
	Address  string
	Username string
	Password string
}

type ProxyType

type ProxyType int
const (
	SOCKS5 ProxyType = iota
	SOCKS4
	HTTP
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL