files

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileEmpty

func FileEmpty(path string) (bool, error)

func FileExists

func FileExists(path string) bool

func IsDirWriteable added in v1.8.1

func IsDirWriteable(dir string) error

IsDirWriteable checks if dir is writable by writing and removing a file to dir. It returns nil if dir is writable.

func LookupBinaryPath added in v1.8.1

func LookupBinaryPath(pathFns ...LookupPathFn) (string, error)

LookupBinaryPath looks for a binary in order of passed lookup functions. It fails only if all lookup function does not contain a binary.

Types

type LookupPathFn added in v1.8.1

type LookupPathFn = func() (string, error)

func LookupInCurrentDirectory added in v1.8.1

func LookupInCurrentDirectory(binary string) LookupPathFn

LookupInCurrentDirectory looks for the binary in the current directory Example: if this function is executed by /usr/bin/kuma-dp that was run in /home/kuma-dp, this function will lookup for binary 'x' in /home/kuma-dp/x

func LookupInPath added in v1.8.1

func LookupInPath(path string) LookupPathFn

func LookupNextToCurrentExecutable added in v1.8.1

func LookupNextToCurrentExecutable(binary string) LookupPathFn

LookupNextToCurrentExecutable looks for the binary next to the current binary Example: if this function is executed by /usr/bin/kuma-dp, this function will lookup for binary 'x' in /usr/bin/x

Jump to

Keyboard shortcuts

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