spec

package
v1.17.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DetectMinimumVersion is a constant that triggers a spec to detect the minimum required version.
	//
	// Deprecated: DetectMinimumVersion is deprecated and will be removed.
	DetectMinimumVersion = "DETECT_MINIMUM_VERSION"

	// FormatJSON indicates a JSON output format
	FormatJSON = "json"
	// FormatYAML indicates a YAML output format
	FormatYAML = "yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	io.WriterTo
	Save(string) error
	Raw() *specs.Spec
}

Interface is the interface for the spec API

func New

func New(opts ...Option) (Interface, error)

New creates a new spec with the specified options.

type Option

type Option func(*builder)

Option defines a function that can be used to configure the spec builder.

func WithClass

func WithClass(class string) Option

WithClass sets the class for the spec builder

func WithDeviceSpecs

func WithDeviceSpecs(deviceSpecs []specs.Device) Option

WithDeviceSpecs sets the device specs for the spec builder

func WithEdits

func WithEdits(edits specs.ContainerEdits) Option

WithEdits sets the container edits for the spec builder

func WithFormat

func WithFormat(format string) Option

WithFormat sets the output file format

func WithMergedDeviceOptions added in v1.14.0

func WithMergedDeviceOptions(opts ...transform.MergedDeviceOption) Option

WithMergedDeviceOptions sets the options for generating a merged device.

func WithNoSimplify

func WithNoSimplify(noSimplify bool) Option

WithNoSimplify sets whether the spec must be simplified

func WithPermissions added in v1.13.3

func WithPermissions(permissions os.FileMode) Option

WithPermissions sets the permissions for the generated spec file

func WithRawSpec

func WithRawSpec(raw *specs.Spec) Option

WithRawSpec sets the raw spec for the spec builder

func WithVendor

func WithVendor(vendor string) Option

WithVendor sets the vendor for the spec builder

func WithVersion

func WithVersion(version string) Option

WithVersion sets the version for the spec builder

Jump to

Keyboard shortcuts

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