util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDir added in v0.2.0

func CacheDir() string

CacheDir return cache dir path string

func Exec added in v0.2.0

func Exec(command string, args []string) (string, error)

func Exists added in v0.2.0

func Exists(path string) (bool, error)

func FetchURL

func FetchURL(url string, apiKey ...string) ([]byte, error)

FetchURL returns HTTP response body

func FileWalk added in v0.2.0

func FileWalk(root string, targetFiles map[string]struct{}, walkFn func(r io.Reader, path string) error) error

FileWalk walks the file tree rooted at root

func FilterTargets added in v0.2.0

func FilterTargets(prefixPath string, targets map[string]struct{}) (map[string]struct{}, error)

FilterTargets filter targets

func GetDefaultLogDir

func GetDefaultLogDir() string

GetDefaultLogDir :

func IsCommandAvailable added in v0.2.0

func IsCommandAvailable(name string) bool

func SetLogger

func SetLogger(logToFile bool, logDir string, debug, logJSON bool) error

SetLogger :

Types

type Errors added in v0.2.0

type Errors []error

Errors has a set of errors that occurred in GORM

func (Errors) Add added in v0.2.0

func (errs Errors) Add(newErrors ...error) Errors

Add adds an error to a given slice of errors

func (Errors) Error added in v0.2.0

func (errs Errors) Error() string

Error takes a slice of all errors that have occurred and returns it as a formatted string

func (Errors) GetErrors added in v0.2.0

func (errs Errors) GetErrors() []error

GetErrors gets all errors that have occurred and returns a slice of errors (Error type)

Jump to

Keyboard shortcuts

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