csv

package
v1.12.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MountSpecDev is used for character devices
	MountSpecDev = MountSpecType("dev")
	// MountSpecDir is used for directories
	MountSpecDir = MountSpecType("dir")
	// MountSpecLib is used for libraries or regular files
	MountSpecLib = MountSpecType("lib")
	// MountSpecSym is used for symlinks.
	MountSpecSym = MountSpecType("sym")
)
View Source
const (
	// DefaultMountSpecPath is default location of CSV files that define the modifications required to the OCI spec
	DefaultMountSpecPath = "/etc/nvidia-container-runtime/host-files-for-container.d"
)

Variables

This section is empty.

Functions

func BaseFilesOnly

func BaseFilesOnly(filenames []string) []string

BaseFilesOnly filters out non-base CSV files from the list of CSV files.

func GetFileList

func GetFileList(root string) ([]string, error)

GetFileList returns the (non-recursive) list of CSV files in the specified folder

Types

type MountSpec

type MountSpec struct {
	Type MountSpecType
	Path string
}

MountSpec represents a Jetson mount consisting of a type and a path.

func NewMountSpec

func NewMountSpec(mountType string, path string) (*MountSpec, error)

NewMountSpec creates a MountSpec with the specified type and path. An error is returned if the type is invalid.

func NewMountSpecFromLine

func NewMountSpecFromLine(line string) (*MountSpec, error)

NewMountSpecFromLine parses the specified line and returns the MountSpec or an error if the line is malformed

type MountSpecType

type MountSpecType string

MountSpecType defines the mount types allowed in a CSV file

type Parser

type Parser interface {
	Parse() ([]*MountSpec, error)
}

Parser specifies an interface for parsing MountSpecs

func NewCSVFileParser

func NewCSVFileParser(logger *logrus.Logger, filename string) Parser

NewCSVFileParser creates a new parser for reading MountSpecs from the specified CSV file

Jump to

Keyboard shortcuts

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