Documentation
¶
Overview ¶
Package fs provides filesystem utility functions.
Index ¶
- func Copy(src, dst string) error
- func CreateDirIfNotExist(path string) error
- func Exists(path string) bool
- func GetExecutablePath() string
- func IsEmpty(path string) (bool, error)
- func ReadJSON(path string, data interface{}) error
- func ReadLines(path string) ([]string, error)
- func ReadYAML(path string, data interface{}) error
- func WriteJSON(path string, data interface{}) error
- func WriteSecretString(path string, content string) error
- func WriteSecretYAML(path string, data interface{}) error
- func WriteString(path string, content string) error
- func WriteYAML(path string, data interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirIfNotExist ¶
CreateDirIfNotExist creates a directory and all parent directories if they don't exist.
func GetExecutablePath ¶
func GetExecutablePath() string
GetExecutablePath returns the directory path of the current executable.
func ReadYAML ¶
ReadYAML reads a YAML file and unmarshals it into the provided data structure. The data parameter must be a non-nil pointer.
func WriteSecretString ¶
WriteString writes a string to a file, creating or truncating it. WriteSecretString writes a file that holds credential material: 0600, and re-applied on every write so a file created before this existed does not keep its old world-readable mode.
func WriteSecretYAML ¶
WriteYAML marshals the data and writes it to a YAML file. WriteSecretYAML is WriteYAML for files that hold credential material (agent keys, installation uuids): the file is written 0600.
func WriteString ¶
Types ¶
This section is empty.