utils

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadAdditionalFiles added in v0.1.6

func DownloadAdditionalFiles() error

Update updates the resource, if supported uses cache.

func DownloadToFile

func DownloadToFile(url string, path string) error

DownloadToFile downloads a file and saves it to a given path.

func FileExists

func FileExists(path string) bool

FileExists returns wether a file exists or not

func GetEnvBool

func GetEnvBool(key string, defaultValue bool) bool

GetEnvBool get key environment variable if exist otherwise return defalutValue

func GetEnvInt

func GetEnvInt(key string, defaultValue int) int

GetEnvInt get key environment variable if exist otherwise return defalutValue

func GetEnvString

func GetEnvString(key string, defaultValue string) string

GetEnvString get key environment variable if exist otherwise return defalutValue

func GetEnvStringList

func GetEnvStringList(key string, defaultValue string) []string

GetEnvStringList get key environment variable as string list if exist otherwise return defalutValue

func WriteFile

func WriteFile(path string, content []byte) error

WriteFile writes bytes to a file.

func WriteFileAsJSON

func WriteFileAsJSON(path string, content interface{}) error

WriteFileAsJSON writes JSON to a file.

func WriteFileAsString

func WriteFileAsString(path string, content string) error

WriteFileAsString writes a string to a file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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