Documentation
¶
Index ¶
- func New(opts ...Option) (discover.Discover, error)
- type MountSpecPathsByType
- type MountSpecPathsByTyper
- type Option
- func WithDevRoot(devRoot string) Option
- func WithDriverRoot(driverRoot string) Option
- func WithHookCreator(hookCreator discover.HookCreator) Option
- func WithLdconfigPath(ldconfigPath string) Option
- func WithLibrarySearchPaths(librarySearchPaths ...string) Option
- func WithLogger(logger logger.Interface) Option
- func WithMountSpecs(mountSpecs ...MountSpecPathsByTyper) Option
- type Transformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MountSpecPathsByType ¶
type MountSpecPathsByType map[csv.MountSpecType][]string
MountSpecPathsByType define the per-type paths that define the entities (e.g. device nodes, directories, libraries, symlinks) that are required for gpu use on Tegra-based systems. These are typically populated from CSV files defined by the platform owner.
func MountSpecsFromCSVFiles ¶
func MountSpecsFromCSVFiles(logger logger.Interface, csvFilePaths ...string) MountSpecPathsByType
MountSpecsFromCSVFiles returns a MountSpecPathsByTyper for the specified list of CSV files.
func (MountSpecPathsByType) MountSpecPathsByType ¶
func (m MountSpecPathsByType) MountSpecPathsByType() MountSpecPathsByType
MountSpecPathsByType for a variable of type MountSpecPathsByType returns the underlying data structure. This allows for using this type in functions such as Merge and Filter.
type MountSpecPathsByTyper ¶
type MountSpecPathsByTyper interface {
MountSpecPathsByType() MountSpecPathsByType
}
func DeviceNodes ¶
func DeviceNodes(dn ...string) MountSpecPathsByTyper
DeviceNodes creates a set of MountSpecPaths for the specified device nodes. These have the MoutSpecDev type.
func Merge ¶
func Merge(sources ...MountSpecPathsByTyper) MountSpecPathsByTyper
Merge combines the MountSpecPathsByType for the specified sources.
func Symlinks ¶
func Symlinks(s ...string) MountSpecPathsByTyper
DeviceNodes creates a set of MountSpecPaths for the specified symlinks. These have the MountSpecSym type.
func Transform ¶
func Transform(input MountSpecPathsByTyper, t Transformer) MountSpecPathsByTyper
Transform applies the specified transforms to a set of mount specs by type. The result is itself a set of mount specs by type.
type Option ¶
type Option func(*options)
Option defines a functional option for configuring a Tegra discoverer.
func WithDevRoot ¶ added in v1.15.0
WithDevRoot sets the /dev root. If this is unset, the driver root is assumed.
func WithDriverRoot ¶
WithDriverRoot sets the driver root for the discoverer.
func WithHookCreator ¶ added in v1.18.0
func WithHookCreator(hookCreator discover.HookCreator) Option
WithHookCreator sets the hook creator for the discoverer.
func WithLdconfigPath ¶ added in v1.15.0
WithLdconfigPath sets the path to the ldconfig program
func WithLibrarySearchPaths ¶
WithLibrarySearchPaths sets the library search paths for the discoverer.
func WithLogger ¶
WithLogger sets the logger for the discoverer.
func WithMountSpecs ¶
func WithMountSpecs(mountSpecs ...MountSpecPathsByTyper) Option
type Transformer ¶
type Transformer interface {
Apply(MountSpecPathsByTyper) MountSpecPathsByTyper
}
A Transformer modifies a specified set of mount specs by type. The output of a transformer is itself a set of mount specs by type.
func IgnoreSymlinkMountSpecsByPattern ¶
func IgnoreSymlinkMountSpecsByPattern(ignorePatterns ...string) Transformer
func OnlyDeviceNodes ¶
func OnlyDeviceNodes() Transformer
OnlyDeviceNodes creates a transformer that will remove any input mounts specs that are not of the `MountSpecDev` type.
func WithoutDeviceNodes ¶
func WithoutDeviceNodes() Transformer
WithoutDeviceNodes creates a transformer that will remove entries with type MountSpecDevice from the input.
func WithoutRegularDeviceNodes ¶
func WithoutRegularDeviceNodes() Transformer
WithoutRegularDeviceNodes creates a transfomer which removes regular `/dev/nvidia[0-9]+` device nodes from the source.