file

package
v0.0.0-...-947b840 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(srcPath, dstPath string) error

Copy gracefully copies a file from source to destination path. Files that already exist on the destination path will be left untouched.

func Exists

func Exists(path string) bool

Exists returns true if file metadata is obtained without errors. Otherwise, false is returned.

func ForceCopy

func ForceCopy(srcPath, dstPath string) error

ForceCopy copies a file from source to destination path. Files that already exist on the destination path will be replaced (overwritten).

func MakeDir

func MakeDir(path string) error

MakeDir creates a directory named path, along with any necessary parents.

func Move

func Move(srcPath string, dstPath string) error

Move moves a file or directory to a specified location. First the destination file or directory is removed, and then the source content is moved.

func Read

func Read(path string) (string, error)

Read reads file on a given path and returns its content as a string.

func ReadYaml

func ReadYaml[T interface{}](path string, typ T) (*T, error)

ReadYaml reads yaml file on the given path and unmarshals it into the given type.

func Remove

func Remove(path string) error

Remove removes directory and any children it contains.

func WriteYaml

func WriteYaml(obj interface{}, path string, perm fs.FileMode) error

WriteYaml writes a given object as a yaml file to the given path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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