mountpoint

package
v999.0.0-...-3a7701e Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// MountPointAPIProperties is the url for plugin properties queries
	MountPointAPIProperties = "MountPointPlugin.MountPointProperties"

	// MountPointAPIAttach is the url for mount point attachment interposition
	MountPointAPIAttach = "MountPointPlugin.MountPointAttach"

	// MountPointAPIDetach is the url for mount point detachment interposition
	MountPointAPIDetach = "MountPointPlugin.MountPointDetach"

	// MountPointAPIImplements is the name of the interface all mount point plugins implement
	MountPointAPIImplements = "mountpoint"
)

Variables

This section is empty.

Functions

func GetPluginGetter

func GetPluginGetter() plugingetter.PluginGetter

GetPluginGetter gets the plugingetter

func PatternMatches

func PatternMatches(pattern Pattern, mount *MountPoint) bool

PatternMatches determines if a pattern matches a mount point description. Patterns are conjunctions and a higher-level routine must implement disjunction.

func PluginNameOfMiddlewareName

func PluginNameOfMiddlewareName(middlewareName string) string

PluginNameOfMiddlewareName returns the name of the plugin implementing a particular mount point middleware name (if any)

func SetPluginGetter

func SetPluginGetter(pg plugingetter.PluginGetter)

SetPluginGetter sets the plugingetter

func StringPatternMatches

func StringPatternMatches(pattern StringPattern, string string) bool

Types

type AppliedMiddlewarePattern

type AppliedMiddlewarePattern struct {
	Name    []StringPattern `json:",omitempty"`
	Changes ChangesPattern  `json:",omitempty"`
}

AppliedMiddlewarePattern is a description of a class of applied middleware

type AppliedMiddlewareStackPattern

type AppliedMiddlewareStackPattern struct {
	Exists            []AppliedMiddlewarePattern `json:",omitempty"`
	NotExists         []AppliedMiddlewarePattern `json:",omitempty"`
	All               []AppliedMiddlewarePattern `json:",omitempty"`
	NotAll            []AppliedMiddlewarePattern `json:",omitempty"`
	AnySequence       []AppliedMiddlewarePattern `json:",omitempty"`
	NotAnySequence    []AppliedMiddlewarePattern `json:",omitempty"`
	TopSequence       []AppliedMiddlewarePattern `json:",omitempty"`
	NotTopSequence    []AppliedMiddlewarePattern `json:",omitempty"`
	BottomSequence    []AppliedMiddlewarePattern `json:",omitempty"`
	NotBottomSequence []AppliedMiddlewarePattern `json:",omitempty"`
	RelativeOrder     []AppliedMiddlewarePattern `json:",omitempty"`
	NotRelativeOrder  []AppliedMiddlewarePattern `json:",omitempty"`
}

AppliedMiddlewareStackPattern is a description of a class of applied middleware stack

type AttachRequest

type AttachRequest struct {
	ID     string
	Mounts []*MountPoint
}

AttachRequest holds data required for mount point middleware attachment interposition

type AttachResponse

type AttachResponse struct {
	// Success indicates whether the mount point was successful
	Success bool

	// Attachments contains information about the middlware's participation with the mount
	Attachments []Attachment `json:",omitempty"`

	// Err stores a message in case there's an error
	Err string `json:",omitempty"`
}

AttachResponse represents mount point middleware response

type Attachment

type Attachment struct {
	Attach          bool
	EmergencyDetach []EmergencyDetachAction `json:",omitempty"`
	Changes         types.MountPointChanges `json:",omitempty"`
}

Attachment describes how the middleware will interact with the mount

type ChangesPattern

type ChangesPattern struct {
	EffectiveSource      []StringPattern    `json:",omitempty"`
	EffectiveConsistency *mount.Consistency `json:",omitempty"`
}

ChangesPattern is a description of a class of mount point changes

type Container

type Container struct {
	// from api/types/container.Config
	Labels map[string]string `json:",omitempty"`
}

Container describes a mount point plugin's view of a container object

type ContainerPattern

type ContainerPattern struct {
	Labels []StringMapPattern `json:",omitempty"`
}

ContainerPattern is a description of a class of MountPoint Containers

type DetachRequest

type DetachRequest struct {
	ID string
}

DetachRequest holds data required for mount point middleware detachment interposition

type DetachResponse

type DetachResponse struct {
	// Success indicates whether detaching the mount point was successful
	Success bool

	// Recoverable indicates whether the failure (if any) is fatal to detach unwinding (false, default) or merely a container failure (true)
	Recoverable bool `json:",omitempty"`

	// Err stores a message in case there's an error
	Err string `json:",omitempty"`
}

DetachResponse represents mount point middleware response

type EmergencyDetachAction

type EmergencyDetachAction struct {
	Error   string `josn:",omitempty"`
	Fatal   string `json:",omitempty"`
	Remove  string `json:",omitempty"`
	Unmount string `json:",omitempty"`
	Warning string `json:",omitempty"`
}

EmergencyDetachAction is an action that the daemon will take on the plugin's behalf if the plugin is unreachable at detach time

type Image

type Image struct {
	// from api/types/image_summary
	Labels map[string]string `json:",omitempty"`
}

Image describes a mount point plugin's view of a container image

type ImagePattern

type ImagePattern struct {
	Labels []StringMapPattern `json:",omitempty"`
}

ImagePattern is a description of a class of MountPoint Images

type Middleware

type Middleware interface {
	// Name returns the registered middleware name. Plugin names have
	// a 'plugin:' prefix
	Name() string

	// PluginName returns the name of the plugin implementing this
	// mount point middleware (if any). If the middleware is not
	// plugin-based, PluginName returns the empty string.
	PluginName() string

	// Patterns returns the mount point patterns that this plugin interposes
	Patterns() []Pattern

	// Destroy cleans up any resources the middleware may be using
	Destroy()

	// MountPointProperties returns the properties of the mount point plugin
	MountPointProperties(*PropertiesRequest) (*PropertiesResponse, error)

	// MountPointAttach prepares one or more mount points for a container
	MountPointAttach(*AttachRequest) (*AttachResponse, error)

	// MountPointDetach releases one or more mount points from a container
	MountPointDetach(*DetachRequest) (*DetachResponse, error)
}

Middleware interposes file system mount points

type MountPoint

type MountPoint struct {
	EffectiveSource      string
	EffectiveConsistency mount.Consistency `json:",omitempty"`

	Volume    Volume    `json:",omitempty"`
	Container Container `json:",omitempty"`
	Image     Image     `json:",omitempty"`
	// from volume/volume#MountPoint
	Source                string
	Destination           string
	ReadOnly              bool              `json:",omitempty"`
	Type                  Type              `json:",omitempty"`
	Mode                  string            `json:",omitempty"`
	Propagation           mount.Propagation `json:",omitempty"`
	CreateSourceIfMissing bool              `json:",omitempty"`

	AppliedMiddleware []types.MountPointAppliedMiddleware

	// from api/types/mount
	Consistency mount.Consistency `json:",omitempty"`
}

MountPoint is the representation of a container mount point exposed to mount point middleware. Pattern and Changes should be the same shape as this type.

type Pattern

type Pattern struct {
	EffectiveSource      []StringPattern    `json:",omitempty"`
	EffectiveConsistency *mount.Consistency `json:",omitempty"`

	Volume    VolumePattern    `json:",omitempty"`
	Container ContainerPattern `json:",omitempty"`
	Image     ImagePattern     `json:",omitempty"`
	// from volume/volume#MountPoint
	Source                []StringPattern    `json:",omitempty"`
	Destination           []StringPattern    `json:",omitempty"`
	ReadOnly              *bool              `json:",omitempty"`
	Type                  *Type              `json:",omitempty"`
	Mode                  []StringPattern    `json:",omitempty"`
	Propagation           *mount.Propagation `json:",omitempty"`
	CreateSourceIfMissing *bool              `json:",omitempty"`

	AppliedMiddleware AppliedMiddlewareStackPattern

	// from api/types/mount
	Consistency *mount.Consistency `json:",omitempty"`
}

Pattern is a description of a class of MountPoints

type Plugin

type Plugin interface {
	Middleware
}

Plugin is a type of Middleware that interposes file system mount points with operation occurring out of process

func NewMountPointPlugin

func NewMountPointPlugin(name string) (Plugin, error)

NewMountPointPlugin of a name will return a plugin object or an error. The plugin may be created new and involve a plugin properties query or it may come from a cache of already initialized mount point plugin objects.

func NewPlugins

func NewPlugins(names []string) ([]Plugin, error)

NewPlugins constructs and initializes the mount point plugins based on plugin names

type PropertiesRequest

type PropertiesRequest struct {
}

PropertiesRequest holds a mount point middleware properties query

type PropertiesResponse

type PropertiesResponse struct {
	// Success indicates whether the properties query was successful
	Success bool

	// Patterns is the DNF pattern set for which this middleware receives
	// interposition requests
	Patterns []Pattern

	// Err stores a message in case there's an error
	Err string `json:",omitempty"`
}

PropertiesResponse holds some static properties of the middleware

type Scope

type Scope string

Scope describes the accessibility of a volume

const (
	LocalScope  Scope = "local"
	GlobalScope Scope = "global"
)

Scopes define if a volume has is cluster-wide (global) or local only. Scopes are returned by the volume driver when it is queried for capabilities and then set on a volume

type StringMapKeyValuePattern

type StringMapKeyValuePattern struct {
	Key   StringPattern `json:",omitempty"`
	Value StringPattern `json:",omitempty"`
}

StringMapKeyValuePattern is a description of a class of string -> string map key-value pairs

type StringMapPattern

type StringMapPattern struct {
	Not bool `json:",omitempty"`

	Exists []StringMapKeyValuePattern `json:",omitempty"`
	All    []StringMapKeyValuePattern `json:",omitempty"`
}

StringMapPattern is a description of a class of string -> string maps

type StringPattern

type StringPattern struct {
	Not bool `json:",omitempty"`

	Empty        bool   `json:",omitempty"`
	Prefix       string `json:",omitempty"`
	PathPrefix   string `json:",omitempty"`
	Suffix       string `json:",omitempty"`
	PathContains string `json:",omitempty"`
	Exactly      string `json:",omitempty"`
	Contains     string `json:",omitempty"`
}

StringPattern is a description of a class of strings

type Type

type Type string

Type represents the type of a mount.

const (
	// TypeBind is the type for mounting host dir
	TypeBind Type = "bind"
	// TypeVolume is the type for remote storage volumes
	TypeVolume Type = "volume"
)

Type constants

type Volume

type Volume struct {
	Name          string            `json:",omitempty"`
	Driver        string            `json:",omitempty"`
	ID            string            `json:",omitempty"`
	Labels        map[string]string `json:",omitempty"`
	DriverOptions map[string]string `json:",omitempty"`
	Scope         Scope             `json:",omitempty"`

	// from DetailedVolume cast
	Options map[string]string `json:",omitempty"`
}

Volume describes a mounted volume

type VolumePattern

type VolumePattern struct {
	Name          []StringPattern    `json:",omitempty"`
	Driver        []StringPattern    `json:",omitempty"`
	ID            []StringPattern    `json:",omitempty"`
	Labels        []StringMapPattern `json:",omitempty"`
	DriverOptions []StringMapPattern `json:",omitempty"`
	Scope         *Scope             `json:",omitempty"`

	Options []StringMapPattern `json:",omitempty"`
}

VolumePattern is a description of a class of volumes

Jump to

Keyboard shortcuts

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