utils

package
v0.0.0-...-e88ebdc Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDirExists

func CheckDirExists(dirPath string)

func GetEnv

func GetEnv(key, fallback string) (value string)

func GetRandomHostAddress

func GetRandomHostAddress(hostsArray []string, seed int64) (string, int)

func PathIs

func PathIs(name []byte, r *http.Request) bool

func SendHTTPRequest

func SendHTTPRequest(reqhosts []string, seed int64, url string, payloadBytes []byte, headers map[string]string, formData map[string]string, method string, httpClient *http.Client, retry int, ssl bool, maxRetry int) ([]byte, map[string][]string, int, error)

func SendJSONResponse

func SendJSONResponse(w http.ResponseWriter, data interface{}, message string, errMessage string, statusCode int, errorCode int)

func SetCorsHeaders

func SetCorsHeaders(w *http.ResponseWriter, r *http.Request, allowCredentials bool)

func SplitDirAndFilename

func SplitDirAndFilename(path string) (string, string)

SplitDirAndFilename :

Types

This section is empty.

Jump to

Keyboard shortcuts

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