traverse

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flag

func Flag(f *pflag.Flag) func(tc Context) (string, error)

Flag returns the value of given flag.

func GitDir

func GitDir(tc Context) (string, error)

GitDir returns the location of the .git folder.

func GitWorkTree

func GitWorkTree(tc Context) (string, error)

GitWorkTree returns the location of the root of the working directory for a non-bare repository.

func Parent

func Parent(names ...string) func(tc Context) (string, error)

Parent returns the first parent directory containing any of the given names/directories.

func TempDir

func TempDir(tc Context) (string, error)

TempDir returns the default directory to use for temporary files.

func UserCacheDir

func UserCacheDir(tc Context) (string, error)

UserCacheDir returns the default root directory to use for user-specific cached data.

func UserConfigDir

func UserConfigDir(tc Context) (string, error)

UserConfigDir returns the default root directory to use for user-specific configuration data.

func UserHomeDir

func UserHomeDir(tc Context) (string, error)

UserHomeDir returns the current user's home directory.

func XdgCacheHome

func XdgCacheHome(tc Context) (dir string, err error)

XdgCacheHome returns the cache directory (fallback to UserCacheDir).

func XdgConfigHome

func XdgConfigHome(tc Context) (dir string, err error)

XdgConfigHome returns the home directory (fallback to UserConfigDir).

Types

type Context

type Context interface {
	Abs(s string) (string, error)
	Getenv(key string) string
	LookupEnv(key string) (string, bool)
}

Jump to

Keyboard shortcuts

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