opts

package
v27.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithGetResolveStatus

func WithGetResolveStatus(cfg *GetConfig)

WithGetResolveStatus indicates to `Get` to also fetch the volume status. This can cause significant overhead in the volume lookup.

Types

type CreateConfig

type CreateConfig struct {
	Options   map[string]string
	Labels    map[string]string
	Reference string
}

CreateConfig is the set of config options that can be set when creating a volume

type CreateOption

type CreateOption func(*CreateConfig)

CreateOption is used to pass options in when creating a volume

func WithCreateLabel

func WithCreateLabel(key, value string) CreateOption

WithCreateLabel creates a CreateOption which adds a label with the given key/value pair

func WithCreateLabels

func WithCreateLabels(labels map[string]string) CreateOption

WithCreateLabels creates a CreateOption which sets the labels to the passed in value

func WithCreateOptions

func WithCreateOptions(opts map[string]string) CreateOption

WithCreateOptions creates a CreateOption which sets the options passed to the volume driver when creating a volume to the options passed in.

func WithCreateReference

func WithCreateReference(ref string) CreateOption

WithCreateReference creats a CreateOption which sets a reference to use when creating a volume. This ensures that the volume is created with a reference already attached to it to prevent race conditions with Create and volume cleanup.

type GetConfig

type GetConfig struct {
	Driver        string
	Reference     string
	ResolveStatus bool
}

GetConfig is used with `GetOption` to set options for the volumes service's `Get` implementation.

type GetOption

type GetOption func(*GetConfig)

GetOption is passed to the service `Get` add extra details on the get request

func WithGetDriver

func WithGetDriver(name string) GetOption

WithGetDriver provides the driver to get the volume from If no driver is provided to `Get`, first the available metadata is checked to see which driver it belongs to, if that is not available all drivers are probed to find the volume.

func WithGetReference

func WithGetReference(ref string) GetOption

WithGetReference indicates to `Get` to increment the reference count for the retrieved volume with the provided reference ID.

type RemoveConfig

type RemoveConfig struct {
	PurgeOnError bool
}

RemoveConfig is used by `RemoveOption` to store config options for remove

type RemoveOption

type RemoveOption func(*RemoveConfig)

RemoveOption is used to pass options to the volumes service `Remove` implementation

func WithPurgeOnError

func WithPurgeOnError(b bool) RemoveOption

WithPurgeOnError is an option passed to `Remove` which will purge all cached data about a volume even if there was an error while attempting to remove the volume.

Jump to

Keyboard shortcuts

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