iface

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package iface defines injectable operating-system boundaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandRunner

type CommandRunner interface {
	Run(name string, args ...string) error
	RunWithStdin(stdin string, name string, args ...string) error
	RunShell(command string) error
	RunWithEnv(env []string, name string, args ...string) error
}

CommandRunner abstracts shell command execution.

type File

type File interface {
	io.ReadWriteCloser
	Name() string
}

File abstracts read/write/close/name operations on a single file handle.

type FileSystem

type FileSystem interface {
	WriteFile(name string, data []byte, perm os.FileMode) error
	ReadFile(name string) ([]byte, error)
	MkdirAll(path string, perm os.FileMode) error
	Stat(name string) (os.FileInfo, error)
	Open(name string) (File, error)
	Create(name string) (File, error)
	CreateTemp(dir, pattern string) (File, error)
	Chown(name string, uid, gid int) error
	Chmod(name string, mode os.FileMode) error
	Rename(oldpath, newpath string) error
	Remove(name string) error
	Hostname() (string, error)
}

FileSystem abstracts file I/O operations used by appliers.

type HostnameSetter

type HostnameSetter interface {
	SetHostname(name string) error
}

HostnameSetter abstracts the syscall to set the system hostname.

type LoopAttacher added in v1.10.0

type LoopAttacher interface {
	Attach(backingFile string, offset uint64, readOnly bool) (LoopDevice, error)
}

LoopAttacher abstracts loop device attachment operations.

type LoopDevice added in v1.10.0

type LoopDevice interface {
	Path() string
	Detach() error
	SetAutoclear() error
}

LoopDevice abstracts a single attached loop device.

type ModuleLoader

type ModuleLoader interface {
	LoadedModules() (map[string]bool, error)
	LoadModule(name string, params string) error
}

ModuleLoader abstracts kernel module loading.

type Mounter

type Mounter interface {
	Mount(device, target, mType, options string) error
	ForceMount(device, target, mType, options string) error
	Mounted(target string) (bool, error)
}

Mounter abstracts filesystem mount operations.

type SysctlApplier

type SysctlApplier interface {
	Set(key string, value string) error
}

SysctlApplier abstracts sysctl configuration.

Directories

Path Synopsis
Package osimpl provides production operating-system adapters for interfaces.
Package osimpl provides production operating-system adapters for interfaces.

Jump to

Keyboard shortcuts

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