Documentation
¶
Index ¶
- func Append(path string, content []byte) error
- func Copy(srcPath, dstPath string, mode fs.FileMode) error
- func Exists(path string) bool
- func ForceCopy(srcPath, dstPath string, mode fs.FileMode) error
- func Read(path string) (string, error)
- func ReadYaml[T any](path string, typ T) (*T, error)
- func ReadYamlStrict[T any](path string, typ T) (*T, error)
- func WriteYaml(obj any, path string, perm fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
Copy reads file from the source path and writes it to the destination path with the specified permissions. All required subdirectories are also created. An error is thrown if destination file exists.
func Exists ¶
Exists returns true if file metadata is obtained without errors. Otherwise, false is returned.
func ForceCopy ¶
ForceCopy reads the file located at the source path and writes it to the destination path with the specified permissions. All required subdirectories are also created.
func ReadYamlStrict ¶
ReadYaml reads yaml file on the given path and unmarshals it into the given type. File is not allowed to contain any unused/extra keys.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.