utils

package
v0.0.0-...-bfa9622 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: AGPL-3.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment interface {
	// Setenv changes the environment variable k to value v.
	Setenv(k, v string) error
	// Unsetenv deletes the environment variable k.
	Unsetenv(k string) error
	// ExpandEnv replaces $VAR and ${VAR} in string s with values from the environment.
	ExpandEnv(s string) string
	// Getenv gets an environment variable from the environment.
	Getenv(k string) string
}

Environment provides methods for reading a file or writing to a file.

func NewEnvironment

func NewEnvironment() Environment

NewEnvironment returns a new Environment.

type FileReaderWriter

type FileReaderWriter interface {
	Stat(filename string) (os.FileInfo, error)
	ReadFile(filename string) ([]byte, error)
	WriteFile(filename string, data []byte, perm os.FileMode) error

	Reader(filename string) (io.ReadCloser, error)
	Writer(filename string, perm os.FileMode) (io.WriteCloser, error)

	MkdirAll(path string, perm os.FileMode) error
	Symlink(oldname, newname string) error
	RemoveAll(path string) error
}

FileReaderWriter provides methods for reading a file or writing to a file.

func NewFileReaderWriter

func NewFileReaderWriter() FileReaderWriter

NewFileReaderWriter returns a new FileReaderWriter.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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