fs

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertPathExists

func AssertPathExists(paths ...string) error

AssertPathExists returns nil only if it has been successfully verified that all specified paths exists.

func AssertPathNotExists

func AssertPathNotExists(paths ...string) error

func Base64Decode

func Base64Decode(b []byte) ([]byte, error)

Base64Decode decodes the specified bytes as any of the Base64 dialects: standard encoding (+, /) and URL encoding (-, _), with or without padding.

func Copy

func Copy(src, dest string) error

func CopyDirectory

func CopyDirectory(src, dest string) error

func Empty

func Empty(path string) bool

func EnsureDirectoryExists

func EnsureDirectoryExists(path string) error

func PathExists

func PathExists(path string) (bool, error)

PathExists checks if the specified path exists.

func ReadKey

func ReadKey(key, path string) ([]byte, error)

ReadKey returns either the content of the file specified at path, if it exists, or []byte(key) otherwise. It is an error to specify both or none arguments, or specify an empty or unreadable file. If there is no error then the return []byte is non-empty.

func SaveFile

func SaveFile(fpath string, content []byte) (err error)

Save the filecontents at the specified path atomically: - first save the content in a temp file with a random filename in the same dir - then rename the temp file to the specified filepath, overwriting the old file

Types

This section is empty.

Jump to

Keyboard shortcuts

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