Documentation ¶
Index ¶
- func AddExtensionIfNotExist(filePath string, extension string) string
- func Clamp[T constraints.Ordered](v, low, high T) T
- func ClampCycle[T constraints.Ordered](v, low, high T) T
- func DownloadFile(filePath string, url string) error
- func EnsureFolderExistForFile(filePath string) error
- func ErrorHandler(f func(w http.ResponseWriter, r *http.Request) error) http.HandlerFunc
- func FileExists(filename string) bool
- func GetEnv(key, fallback string) string
- func GetRandomSample(s []string, n int) []string
- func GetUrlAsText(url string) (string, error)
- func InsertAt[T any](a []T, index int, value T) []T
- func LoadGob(filename string, data any) error
- func MakeMultipartPostRequest(url string, formData map[string]string, fileParamName, filePath string) (*http.Response, error)
- func Max[T constraints.Ordered](a, b T) T
- func MemUsageReport() string
- func Min[T constraints.Ordered](a, b T) T
- func MultiMax[T constraints.Ordered](args ...T) T
- func ReadFileFromTarGz(tarGzFile, extension string) (string, error)
- func ReadFileInZip(zipPath string, targetFileName string) (string, error)
- func ReadJSON(filename string, data any) error
- func Remove[T interface{}](s []T, i int) []T
- func RemoveExtension(filePath string) string
- func RemoveKeepOrder[T interface{}](slice []T, i int) []T
- func SaveGob(data any, filename string) error
- func SaveResponseBodyToFile(response *http.Response, filePath string) error
- func SetupConfigPath(rootPath string) error
- func SetupLogger(debug bool, log_file_name string) error
- func SetupTestConfig() error
- func TimeTrack(start time.Time, name string)
- func WriteJSON(filePath string, data any, prettyPrint bool, compress bool) error
- func WriteStringArrayToFile(strArray []string, filename string) error
- type GenericWebClient
- type Point
- type Rect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddExtensionIfNotExist ¶ added in v1.0.1
func Clamp ¶
func Clamp[T constraints.Ordered](v, low, high T) T
func ClampCycle ¶
func ClampCycle[T constraints.Ordered](v, low, high T) T
func DownloadFile ¶
func EnsureFolderExistForFile ¶ added in v1.0.1
func ErrorHandler ¶
func ErrorHandler(f func(w http.ResponseWriter, r *http.Request) error) http.HandlerFunc
func FileExists ¶
func GetRandomSample ¶
func GetUrlAsText ¶ added in v1.0.2
func MakeMultipartPostRequest ¶ added in v1.0.1
func Max ¶
func Max[T constraints.Ordered](a, b T) T
func MemUsageReport ¶
func MemUsageReport() string
MemUsageReport outputs the current, total and OS memory being used. As well as the number of garage collection cycles completed.
func Min ¶
func Min[T constraints.Ordered](a, b T) T
func MultiMax ¶ added in v1.0.1
func MultiMax[T constraints.Ordered](args ...T) T
https://stackoverflow.com/questions/73243943/how-to-write-a-generic-max-function
func ReadFileFromTarGz ¶
Returns first found
func RemoveExtension ¶ added in v1.0.1
func SaveResponseBodyToFile ¶ added in v1.0.1
func SetupConfigPath ¶ added in v1.0.1
func SetupLogger ¶
func SetupTestConfig ¶ added in v1.0.1
func SetupTestConfig() error
func WriteStringArrayToFile ¶ added in v1.0.1
Types ¶
type GenericWebClient ¶ added in v1.0.2
func (*GenericWebClient) GetUrl ¶ added in v1.0.2
func (c *GenericWebClient) GetUrl(endpoint string) string
type Point ¶ added in v1.0.1
type Point struct {
X, Y int
}
func (*Point) SquaredDistanceFrom ¶ added in v1.0.1
type Rect ¶ added in v1.0.1
type Rect struct {
X, Y, W, H int
}
func (*Rect) Intersects ¶ added in v1.0.1
Click to show internal directories.
Click to hide internal directories.