io

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const PathSeparator = string(os.PathSeparator)

Variables

This section is empty.

Functions

func CloseFileIgnore

func CloseFileIgnore(file *os.File)

CloseFileIgnore closes file ignoring errors, mainly for deferred cleanup.

func ExcludeTestFilter

func ExcludeTestFilter() filter.LoaderFilter

func FindInput added in v0.26.0

func FindInput(file string, workspacePath string) (string, io.Reader)

FindInput finds input.json file in workspace closest to the file, and returns both the location and the reader.

func FindManifestLocations added in v0.26.0

func FindManifestLocations(root string) ([]string, error)

FindManifestLocations walks the file system rooted at root, and returns the *relative* paths of directories containing a .manifest file.

func IsSkipWalkDirectory added in v0.26.0

func IsSkipWalkDirectory(info files.DirEntry) bool

func JSONRoundTrip

func JSONRoundTrip(from any, to any) error

JSONRoundTrip convert any value to JSON and back again.

func LoadRegalBundleFS

func LoadRegalBundleFS(fs files.FS) (bundle.Bundle, error)

LoadRegalBundleFS loads bundle embedded from policy and data directory.

func LoadRegalBundlePath

func LoadRegalBundlePath(path string) (bundle.Bundle, error)

LoadRegalBundlePath loads bundle from path.

func MustJSONRoundTrip added in v0.8.0

func MustJSONRoundTrip(from any, to any)

MustJSONRoundTrip convert any value to JSON and back again, exit on failure.

func MustLoadRegalBundleFS

func MustLoadRegalBundleFS(fs files.FS) bundle.Bundle

MustLoadRegalBundleFS loads bundle embedded from policy and data directory, exit on failure.

func ToMap added in v0.12.0

func ToMap(a any) map[string]any

ToMap convert any value to map[string]any, or panics on failure.

func WalkFiles added in v0.26.0

func WalkFiles(root string, f func(path string) error) error

WalkFiles walks the file system rooted at root, calling f for each file. This is a less ceremonious version of filepath.WalkDir where only file paths (not dirs) are passed to the callback, and where directories that should commonly be ignored (.git, node_modules, etc.) are skipped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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