volume

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerVolumeConfig

type DockerVolumeConfig struct {
	// Scope represents lifetime of the volume: "task" or "shared"
	Scope string `json:"scope"`
	// Autoprovision is true if agent needs to create the volume,
	// false if it is pre-provisioned outside of ECS
	Autoprovision bool `json:"autoprovision"`
	// Mountpoint is a read-only field returned from docker
	Mountpoint string            `json:"mountPoint"`
	Driver     string            `json:"driver"`
	DriverOpts map[string]string `json:"driverOpts"`
	Labels     map[string]string `json:"labels"`
}

DockerVolumeConfig represents docker volume configuration See https://tinyurl.com/zmexdw2

type VolumeResource

type VolumeResource struct {
	// Name is the name of docker volume
	Name string
	// VolumeConfig contains docker specific volume fields
	VolumeConfig DockerVolumeConfig
	// contains filtered or unexported fields
}

VolumeResource represents volume resource

func NewVolumeResource

func NewVolumeResource(name string,
	scope string,
	autoprovision bool,
	driver string,
	driverOptions map[string]string,
	labels map[string]string,
	client dockerapi.DockerClient,
	ctx context.Context) *VolumeResource

NewVolumeResource returns a docker volume wrapper object

func (*VolumeResource) Cleanup

func (vol *VolumeResource) Cleanup() error

Cleanup performs resource cleanup

func (*VolumeResource) Create

func (vol *VolumeResource) Create() error

Create performs resource creation

func (*VolumeResource) GetCreatedAt

func (vol *VolumeResource) GetCreatedAt() time.Time

GetCreatedAt sets the timestamp for resource's creation time

func (*VolumeResource) GetDesiredStatus

func (vol *VolumeResource) GetDesiredStatus() VolumeStatus

GetDesiredStatus safely returns the desired status of the task

func (*VolumeResource) GetKnownStatus

func (vol *VolumeResource) GetKnownStatus() VolumeStatus

GetKnownStatus safely returns the currently known status of the task

func (*VolumeResource) GetMountPoint

func (vol *VolumeResource) GetMountPoint() string

GetMountPoint gets the mountpoint of the created volume.

func (*VolumeResource) GetTerminalReason

func (vol *VolumeResource) GetTerminalReason() string

GetTerminalReason returns an error string to propagate up through to task state change messages

func (*VolumeResource) MarshalJSON

func (vol *VolumeResource) MarshalJSON() ([]byte, error)

MarshalJSON marshals VolumeResource object using duplicate struct VolumeResourceJSON

func (*VolumeResource) SetCreatedAt

func (vol *VolumeResource) SetCreatedAt(createdAt time.Time)

SetCreatedAt sets the timestamp for resource's creation time

func (*VolumeResource) SetDesiredStatus

func (vol *VolumeResource) SetDesiredStatus(status VolumeStatus)

SetDesiredStatus safely sets the desired status of the resource

func (*VolumeResource) SetKnownStatus

func (vol *VolumeResource) SetKnownStatus(status VolumeStatus)

SetKnownStatus safely sets the currently known status of the resource

func (*VolumeResource) UnmarshalJSON

func (vol *VolumeResource) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals VolumeResource object using duplicate struct VolumeResourceJSON

type VolumeStatus

type VolumeStatus taskresource.ResourceStatus

VolumeStatus defines resource statuses for docker volume

const (
	// VolumeStatusNone is the zero state of a task resource
	VolumeStatusNone VolumeStatus = iota
	// VolumeCreated represents a task resource which has been created
	VolumeCreated
	// VolumeCleaned represents a task resource which has been cleaned up
	VolumeCleaned
)

func (*VolumeStatus) MarshalJSON

func (vs *VolumeStatus) MarshalJSON() ([]byte, error)

MarshalJSON overrides the logic for JSON-encoding the ResourceStatus type

func (VolumeStatus) String

func (vs VolumeStatus) String() string

StatusString returns a human readable string representation of this object

func (*VolumeStatus) UnmarshalJSON

func (vs *VolumeStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON overrides the logic for parsing the JSON-encoded ResourceStatus data

Jump to

Keyboard shortcuts

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