shims

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MPL-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shims

type Shims struct {
	ReadFile      func(name string) ([]byte, error)
	WriteFile     func(name string, data []byte, perm os.FileMode) error
	Stat          func(name string) (os.FileInfo, error)
	MkdirAll      func(path string, perm os.FileMode) error
	Remove        func(name string) error
	RemoveAll     func(path string) error
	Rename        func(oldpath, newpath string) error
	ReadDir       func(name string) ([]os.DirEntry, error)
	Glob          func(pattern string) ([]string, error)
	Getwd         func() (string, error)
	UserHomeDir   func() (string, error)
	Getenv        func(key string) string
	Setenv        func(key, value string) error
	LookupEnv     func(key string) (string, bool)
	Goos          func() string
	YamlMarshal   func(v any) ([]byte, error)
	YamlUnmarshal func(data []byte, v any) error
	JsonMarshal   func(v any) ([]byte, error)
	JsonUnmarshal func(data []byte, v any) error
}

Shims holds the system call primitives that many packages need.

func NewShims

func NewShims() *Shims

NewShims returns a Shims with every field set to its standard library or go-yaml implementation.

Jump to

Keyboard shortcuts

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