ioz

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ioz contains supplemental io functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.36.0

func Close(ctx context.Context, c io.Closer)

Close is a convenience function to close c, logging a warning if c.Close returns an error. This is useful in defer, e.g.

defer ioz.Close(ctx, c)

func FPrintFile

func FPrintFile(w io.Writer, name string) error

FPrintFile reads file from name and writes it to w.

func IsPathToRegularFile added in v0.37.0

func IsPathToRegularFile(path string) bool

IsPathToRegularFile return true if path is a regular file or a symlink that resolves to a regular file. False is returned on any error.

func MarshalYAML

func MarshalYAML(v any) ([]byte, error)

MarshalYAML is our standard mechanism for encoding YAML.

func PrintFile

func PrintFile(name string) error

PrintFile reads file from name and writes it to stdout.

func ReadDir added in v0.37.0

func ReadDir(dir string, includeDirPath, markDirs, includeDot bool) (paths []string, err error)

ReadDir lists the contents of dir, returning the relative paths of the files. If markDirs is true, directories are listed with a "/" suffix (including symlinked dirs). If includeDirPath is true, the listing is of the form "dir/name". If includeDot is true, files beginning with period (dot files) are included. The function attempts to continue in the present of errors: the returned paths may contain values even in the presence of a returned error (which may be a multierr).

func UnmarshallYAML

func UnmarshallYAML(data []byte, v any) error

UnmarshallYAML is our standard mechanism for decoding YAML.

Types

This section is empty.

Jump to

Keyboard shortcuts

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