option

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvOrDefaultChroot

func EnvOrDefaultChroot() string

EnvOrDefaultChroot returns the value of the GHW_CHROOT environs variable or the default value of "/" if not set

Types

type Option

type Option struct {
	// To facilitate querying of sysfs filesystems that are bind-mounted to a
	// non-default root mountpoint, we allow users to set the GHW_CHROOT environ
	// vairable to an alternate mountpoint. For instance, assume that the user of
	// ghw is a Golang binary being executed from an application container that has
	// certain host filesystems bind-mounted into the container at /host. The user
	// would ensure the GHW_CHROOT environ variable is set to "/host" and ghw will
	// build its paths from that location instead of /
	Chroot *string
}

Option is used to represent optionally-configured settings. Each field is a pointer to some concrete value so that we can tell when something has been set or left unset.

func Merge

func Merge(opts ...*Option) *Option

func WithChroot

func WithChroot(dir string) *Option

Jump to

Keyboard shortcuts

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