volumes

package
v1.61.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VolumeMountPathPrefix is the host path where amazon ECS plugin's volumes are mounted
	VolumeMountPathPrefix = "/var/lib/ecs/volumes/"
	// FilePerm is the file permissions for the host volume mount directory
	FilePerm = 0700
)
View Source
const (
	// MountBinary is the binary name of EFS Mount
	MountBinary = "mount"
	// UnmountBinary is the binary name for EFS Unmount
	UnmountBinary = "umount"
)
View Source
const (
	// PluginStatePath is the directory path to the plugin state information
	// TODO: get this value from an env var
	PluginStatePath = "/var/lib/ecs/data/"
	// PluginStateFile contains the state information of the plugin
	PluginStateFile = "ecs_volume_plugin.json"
	// PluginStateFileAbsPath is the absolute path of the plugin state file
	PluginStateFileAbsPath = "/var/lib/ecs/data/ecs_volume_plugin.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AmazonECSVolumePlugin

type AmazonECSVolumePlugin struct {
	// contains filtered or unexported fields
}

AmazonECSVolumePlugin holds list of volume drivers and volumes information

func NewAmazonECSVolumePlugin

func NewAmazonECSVolumePlugin() *AmazonECSVolumePlugin

NewAmazonECSVolumePlugin initiates the volume drivers

func (*AmazonECSVolumePlugin) Capabilities

Capabilities implements Docker volume plugin's Capabilities Method

func (*AmazonECSVolumePlugin) CleanupMountPath

func (a *AmazonECSVolumePlugin) CleanupMountPath(name string) error

CleanupMountPath cleans up the volume's host path

func (*AmazonECSVolumePlugin) Create

Create implements Docker volume plugin's Create Method

func (*AmazonECSVolumePlugin) Get

Get implements Docker volume plugin's Get Method

func (*AmazonECSVolumePlugin) GetMountPath

func (a *AmazonECSVolumePlugin) GetMountPath(name string) (string, error)

GetMountPath returns the host path where volume will be mounted

func (*AmazonECSVolumePlugin) List

List implements Docker volume plugin's List Method

func (*AmazonECSVolumePlugin) LoadState

func (a *AmazonECSVolumePlugin) LoadState() error

LoadState loads past state information of the plugin

func (*AmazonECSVolumePlugin) Mount

Mount implements Docker volume plugin's Mount Method

func (*AmazonECSVolumePlugin) Path

Path implements Docker volume plugin's Path Method

func (*AmazonECSVolumePlugin) Remove

Remove implements Docker volume plugin's Remove Method

func (*AmazonECSVolumePlugin) Unmount

Unmount implements Docker volume plugin's Unmount Method

type CreateRequest

type CreateRequest struct {
	Name    string
	Path    string
	Options map[string]string
}

CreateRequest holds fields necessary for creating a volume

type ECSVolumeDriver

type ECSVolumeDriver struct {
	// contains filtered or unexported fields
}

ECSVolumeDriver holds mount helper and methods for different Volume Mounts

func NewECSVolumeDriver

func NewECSVolumeDriver() *ECSVolumeDriver

NewECSVolumeDriver initializes fields for volume mounts

func (*ECSVolumeDriver) Create

func (e *ECSVolumeDriver) Create(r *CreateRequest) error

Create implements ECSVolumeDriver's Create volume method

func (*ECSVolumeDriver) Remove

func (e *ECSVolumeDriver) Remove(req *RemoveRequest) error

Remove implements ECSVolumeDriver's Remove volume method

func (*ECSVolumeDriver) Setup

func (e *ECSVolumeDriver) Setup(name string, v *Volume)

Setup creates the mount helper

type MountHelper

type MountHelper struct {
	MountType string
	Device    string
	Target    string
	Options   string
}

MountHelper contains fields and methods for mounting and unmounting EFS volumes

func (*MountHelper) Mount

func (m *MountHelper) Mount() error

Mount helps mount EFS volumes

func (*MountHelper) Unmount

func (m *MountHelper) Unmount() error

Unmount helps unmount EFS volumes

func (*MountHelper) Validate

func (m *MountHelper) Validate() error

Validate validates fields as part of the mount command

type RemoveRequest

type RemoveRequest struct {
	Name string
}

RemoveRequest holds fields necessary for removing a volume

type StateManager

type StateManager struct {
	VolState *VolumeState
	// contains filtered or unexported fields
}

StateManager manages the state of the volumes information

func NewStateManager

func NewStateManager() *StateManager

NewStateManager initializes the state manager of volume plugin

type Volume

type Volume struct {
	Type      string
	Path      string
	Options   map[string]string
	CreatedAt string
}

Volume holds full details about a volume

type VolumeDriver

type VolumeDriver interface {
	Setup(string, *Volume)
	Create(*CreateRequest) error
	Remove(*RemoveRequest) error
}

VolumeDriver contains the methods for volume drivers to implement

type VolumeInfo

type VolumeInfo struct {
	Type      string            `json:"type,omitempty"`
	Path      string            `json:"path,omitempty"`
	Options   map[string]string `json:"options,omitempty"`
	CreatedAt string            `json:"createdAt,omitempty"`
}

VolumeInfo contains the information of managed volumes

type VolumeState

type VolumeState struct {
	Volumes map[string]*VolumeInfo `json:"volumes,omitempty"`
}

VolumeState contains the list of managed volumes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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