utils

package
v0.74.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsPath

func AbsPath(p string) (string, error)

func AbsPathWithPrefix

func AbsPathWithPrefix(prefix, p string) (string, error)

func BinariesAccessible added in v0.2.0

func BinariesAccessible(binaries ...string) error

Returns and error if given binaries are not accesible trough PATH

func BinaryAbsPath

func BinaryAbsPath(p string) (string, error)

func CapsuleHome

func CapsuleHome() (string, error)

func CopyFile

func CopyFile(srcFile, dstFile string) error

func CpAndChmodxFile added in v0.2.0

func CpAndChmodxFile(source, destination string) error

func CreateFile

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

Create file creates file and it's path if not exists.

func DirEmpty added in v0.2.3

func DirEmpty(path string, ignore ...string) (bool, error)

DirEmpty returns whether given directory is empty or not. Folder is considered empty if only the given ignore files are present.

func ExecuteBinary

func ExecuteBinary(binaryPath string, args []string, v interface{}) ([]byte, error)

func FileExists

func FileExists(name string) (bool, error)

func ToPoint added in v0.2.3

func ToPoint[T any](val T) *T

func Unzip

func Unzip(source, fileName, outDir string) error

func VegaNodeHomePath

func VegaNodeHomePath(networkHomePath string, nodeIdx int) string

Types

type MultiError

type MultiError struct {
	// contains filtered or unexported fields
}

func NewMultiError

func NewMultiError() *MultiError

func (*MultiError) Add

func (e *MultiError) Add(err error)

func (*MultiError) Error

func (e *MultiError) Error() string

func (*MultiError) HasAny

func (e *MultiError) HasAny() bool

Jump to

Keyboard shortcuts

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