util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsolutePath

func AbsolutePath(filename string) (string, error)

AbsolutePath will take a path string and convert it to an absolute path. If an absolute path is given, it will return the same path.

func AskForConfirmation

func AskForConfirmation(s string) (bool, error)

AskForConfirmation asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.

func FileExists

func FileExists(filename string) bool

FileExists checks if a file exists and is not a directory before we try using it to prevent further errors.

func GetNestedConfigValueAccessor

func GetNestedConfigValueAccessor(topLevelKey, section, keyName string) string

GetNestedConfigValueAccessor will generate the dot notation string used to access a nested config value

func IsDirectory

func IsDirectory(path string) bool

IsDirectory determines if a given file path is a directory or not.

func RemoveSymlinkAndSourceFile

func RemoveSymlinkAndSourceFile(symlinkPath string) (err error)

RemoveSymlinkAndSourceFile takes a symlink path and will remove both the symlink and the source file.

func RemoveSymlinkIfBroken

func RemoveSymlinkIfBroken(symlinkPath string) (err error)

RemoveSymlinkIfBroken takes a symlink path and will remove the symlink if the source file does not exist

Types

This section is empty.

Jump to

Keyboard shortcuts

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