taskresource

package
v1.19.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceFields

type ResourceFields struct {
	Control cgroup.Control
	*ResourceFieldsCommon
}

ResourceFields is the list of fields required for creation of task resources obtained from engine

type ResourceFieldsCommon

type ResourceFieldsCommon struct {
	IOUtil             ioutilwrapper.IOUtil
	ASMClientCreator   factory.ClientCreator
	CredentialsManager credentials.Manager
}

type ResourceStatus

type ResourceStatus int32

ResourceStatus is an enumeration of valid states of task resource lifecycle

const (
	// ResourceStatusNone is the zero state of a task resource
	ResourceStatusNone ResourceStatus = iota
	// ResourceCreated represents state where task resource has been created
	ResourceCreated
	// ResourceRemoved represents state where task resource has been cleaned up
	ResourceRemoved
)

type TaskResource

type TaskResource interface {
	// SetDesiredStatus sets the desired status of the resource
	SetDesiredStatus(ResourceStatus)
	// GetDesiredStatus gets the desired status of the resource
	GetDesiredStatus() ResourceStatus
	// SetKnownStatus sets the desired status of the resource
	SetKnownStatus(ResourceStatus)
	// GetKnownStatus gets the desired status of the resource
	GetKnownStatus() ResourceStatus
	// SetCreatedAt sets the timestamp for resource's creation time
	SetCreatedAt(time.Time)
	// GetCreatedAt sets the timestamp for resource's creation time
	GetCreatedAt() time.Time
	// Create performs resource creation
	Create() error
	// Cleanup performs resource cleanup
	Cleanup() error
	// GetName returns the unique name of the resource
	GetName() string
	// DesiredTeminal returns true if remove is in terminal state
	DesiredTerminal() bool
	// KnownCreated returns true if resource state is CREATED
	KnownCreated() bool
	// TerminalStatus returns the last transition state of the resource
	TerminalStatus() ResourceStatus
	// NextKnownState returns resource's next state
	NextKnownState() ResourceStatus
	// ApplyTransition calls the function required to move to the specified status
	ApplyTransition(ResourceStatus) error
	// SteadyState returns the transition state of the resource defined as "ready"
	SteadyState() ResourceStatus
	// SetAppliedStatus sets the applied status of resource and returns whether
	// the resource is already in a transition
	SetAppliedStatus(status ResourceStatus) bool
	// StatusString returns the string of the resource status
	StatusString(status ResourceStatus) string
	// GetTerminalReason returns string describing why the resource failed to
	// provision
	GetTerminalReason() string
	// Initialize will initialze the resource fields of the resource
	Initialize(res *ResourceFields,
		taskKnownStatus status.TaskStatus, taskDesiredStatus status.TaskStatus)

	json.Marshaler
	json.Unmarshaler
}

TaskResource is a wrapper for task level resource methods we need

Directories

Path Synopsis
control/factory/mock
Package mock_cgroups is a generated GoMock package.
Package mock_cgroups is a generated GoMock package.
control/factory/mock_factory
Package mock_factory is a generated GoMock package.
Package mock_factory is a generated GoMock package.
control/mock_control
Package mock_control is a generated GoMock package.
Package mock_control is a generated GoMock package.
Package mock_taskresource is a generated GoMock package.
Package mock_taskresource is a generated GoMock package.

Jump to

Keyboard shortcuts

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