common

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRequestTimeout = 120 // Default request timeout in seconds
)

Variables

This section is empty.

Functions

func BuildDirectoryStructureIfNotExists

func BuildDirectoryStructureIfNotExists(path string) error

func CloseGenericResponseWithLog added in v0.7.7

func CloseGenericResponseWithLog(resp *http.Response, respErr error)

func FileExists

func FileExists(filePath string) bool

func FileExistsAndNotEmpty

func FileExistsAndNotEmpty(filePath string) bool

func GetCleanMapFromStruct

func GetCleanMapFromStruct(st interface{}) map[string]interface{}

GetCleanMapFromStruct returns a map with only the non-nil fields warning: this function will cause problems if trying to use default values in the struct

func IsNilValueInterface added in v0.7.13

func IsNilValueInterface(i interface{}) bool

func ReadBytesFromFile

func ReadBytesFromFile(path string) ([]byte, error)

func ReadJSONFromFile

func ReadJSONFromFile(path string, data interface{}) error

func WriteBytesToFile

func WriteBytesToFile(b []byte, path string) error

func WriteIndentedJSONToFile

func WriteIndentedJSONToFile(data interface{}, path string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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