utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastToArray

func CastToArray(value interface{}) []interface{}

func CreateFile

func CreateFile(filePath string) (*os.File, error)

func DeleteDirectory

func DeleteDirectory(dirPath string) error

func DeleteFile

func DeleteFile(filePath string) error

func GetFileNameWithoutExtension

func GetFileNameWithoutExtension(filePath string) string

func GetNewFilename

func GetNewFilename() (string, string)

func PruneMongoDBURI

func PruneMongoDBURI(uri string) string

func ReadFileToBuffer

func ReadFileToBuffer(filePath string) ([]byte, error)

func Tar

func Tar(root string, destPath string) error

func UnTar

func UnTar(filePath string, destPath string) error

Types

type Env added in v0.6.0

type Env struct {
	Prefixes []string
}

Env represents an environment variable manager with prefixes.

func NewEnv added in v0.6.0

func NewEnv(prefixes ...string) *Env

NewEnv creates a new Env instance with the specified prefixes.

func (*Env) GetValue added in v0.6.0

func (e *Env) GetValue(key string, defaultValues ...string) string

GetValue retrieves the value of an environment variable with fallback prefixes and an optional default value.

Jump to

Keyboard shortcuts

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