fileutil

package
v2.23.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadToMemory

func DownloadToMemory(url string) ([]byte, error)

DownloadToMemory downloads a file from a url to memory

func EnsureDir

func EnsureDir(path string, mode os.FileMode) (os.FileInfo, error)

EnsureDir at the specified path with the specified mode.

func FileExists

func FileExists(path string) bool

FileExists exists and is accessible and the specified path.

func ReadLines

func ReadLines(filepath string) ([]string, error)

ReadLines from a file and return them including any errors.

func ReadYamlFromFile

func ReadYamlFromFile(filename string, target interface{}) error

ReadYamlFromFile at path filename into the target interface.

func RemoveFileMatches

func RemoveFileMatches(pattern string, logger log.Logger) error

RemoveFileMatches for the given filepath pattern.

func TempFile

func TempFile(contents string) (string, error)

TempFile with the passed contents.

func WriteYamlToFile

func WriteYamlToFile(filename string, target interface{}) error

WriteYamlToFile at path filename sourcing the data from the passed target.

func WriteYamlToWriter

func WriteYamlToWriter(writer io.Writer, target interface{}) error

WriteYamlToWriter returning any errors that occur.

Types

This section is empty.

Jump to

Keyboard shortcuts

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