FlowX

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

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

Go to latest
Published: Nov 2, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

README

FlowX

FlowX is a powerful Golang Libary designed to simplify various tasks, including utilities, request handling, websockets, and file management. It is released under the GNU General Public License v3.0.

License

FlowX is licensed under the GNU General Public License v3.0 (GPL-3.0). This means that you are free to use, modify, and distribute the library under the terms of this license. However, it is important to note the following:

  • Skidding (repackaging and claiming as one's own) is strictly prohibited.
  • Selling or monetizing FlowX as proprietary software is not allowed.
  • Any modifications or derivative works based on FlowX must also be released under the GPL-3.0 license.

Please read the LICENSE file for the full text of the GNU General Public License v3.0.

Installation

To install FlowX, you can use the following command:

go get github.com/9dl/FlowX

Current Features

FlowX offers the following features:

  • Simplified handling of HTTP requests
  • Advanced string manipulation and replacement operations
  • URL encoding and decoding
  • Base64 encoding and decoding
  • Parsing and extraction of JSON data
  • Operations with Unix timestamps
  • Threading capabilities (MultiThread, SingleThread)
  • Websocket functionality for real-time communication
  • File downloading and uploading with progress tracking
  • Convenient cookie handling for seamless session management
  • Proxy support for SOCKS4, SOCKS5, and HTTP protocols
  • Customizable HTTP request headers for enhanced control
  • Automatic user agent rotation for anonymity (RandomUserAgent)
  • Flexible file handling, including reading, writing, and file system operations
  • Secure AES encryption and decryption for data protection (EncryptAES, DecryptAES)
  • Hashing data using the SHA256 algorithm for data integrity (HashSHA256)

FlowX is not in Development anymore, it will probaly contain unfixed bugs.

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 GetCookieFromResponse

func GetCookieFromResponse(resp *http.Response, cookieName string) (*http.Cookie, error)

func GetCookiesFromResponse

func GetCookiesFromResponse(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 SetCookieForRequest

func SetCookieForRequest(req *http.Request, cookie *http.Cookie)

func SetCookiesForRequest

func SetCookiesForRequest(req *http.Request, cookies []*http.Cookie)

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