task

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URLType      = Type("URL")
	ManifestType = Type("Manifest")
	RuleType     = Type("Rule")
	BlobType     = Type("Blob")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobTask

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

BlobTask sync a blob which belongs to the primary ManifestTask.

func NewBlobTask

func NewBlobTask(manifestTask Task, info types.BlobInfo) *BlobTask

func (*BlobTask) GetDestination

func (b *BlobTask) GetDestination() *sync.ImageDestination

func (*BlobTask) GetPrimary

func (b *BlobTask) GetPrimary() Task

func (*BlobTask) GetSource

func (b *BlobTask) GetSource() *sync.ImageSource

func (*BlobTask) ReleaseOnce

func (b *BlobTask) ReleaseOnce() bool

func (*BlobTask) Run

func (b *BlobTask) Run() ([]Task, string, error)

func (*BlobTask) Runnable

func (b *BlobTask) Runnable() bool

func (*BlobTask) String

func (b *BlobTask) String() string

func (*BlobTask) Type added in v1.5.3

func (b *BlobTask) Type() Type

type ManifestTask

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

ManifestTask sync a manifest from source to destination.

func NewManifestTask

func NewManifestTask(manifestListTask Task, source *sync.ImageSource, destination *sync.ImageDestination,
	counter *concurrent.Counter, bytes []byte, digest *digest.Digest) *ManifestTask

func (*ManifestTask) GetDestination

func (m *ManifestTask) GetDestination() *sync.ImageDestination

func (*ManifestTask) GetPrimary

func (m *ManifestTask) GetPrimary() Task

func (*ManifestTask) GetSource

func (m *ManifestTask) GetSource() *sync.ImageSource

func (*ManifestTask) ReleaseOnce

func (m *ManifestTask) ReleaseOnce() bool

func (*ManifestTask) Run

func (m *ManifestTask) Run() ([]Task, string, error)

func (*ManifestTask) Runnable

func (m *ManifestTask) Runnable() bool

func (*ManifestTask) String

func (m *ManifestTask) String() string

func (*ManifestTask) Type added in v1.5.3

func (m *ManifestTask) Type() Type

type RuleTask

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

RuleTask analyze an image config rule ("xxx:xxx") and generates URLTask(s).

func NewRuleTask

func NewRuleTask(source, destination string,
	osFilterList, archFilterList []string,
	getAuthFunc func(repository string) types.Auth, forceUpdate bool) (*RuleTask, error)

func (*RuleTask) GetDestination

func (r *RuleTask) GetDestination() *sync.ImageDestination

func (*RuleTask) GetPrimary

func (r *RuleTask) GetPrimary() Task

func (*RuleTask) GetSource

func (r *RuleTask) GetSource() *sync.ImageSource

func (*RuleTask) ReleaseOnce

func (r *RuleTask) ReleaseOnce() bool

func (*RuleTask) Run

func (r *RuleTask) Run() ([]Task, string, error)

func (*RuleTask) Runnable

func (r *RuleTask) Runnable() bool

func (*RuleTask) String

func (r *RuleTask) String() string

func (*RuleTask) Type added in v1.5.3

func (r *RuleTask) Type() Type

type Task

type Task interface {
	// Run returns primary task and result message if success while primary task is not nil and can run immediately.
	Run() ([]Task, string, error)

	// GetPrimary returns primary task, manifest for a blob, or manifest list for a manifest
	GetPrimary() Task

	// Runnable returns if the task can be executed immediately
	Runnable() bool

	// ReleaseOnce try to release once and return if the task is runnable after being released.
	ReleaseOnce() bool

	// GetSource return a source refers to the source images.
	GetSource() *sync.ImageSource

	// GetDestination return a source refers to the destination images
	GetDestination() *sync.ImageDestination

	String() string

	Type() Type
}

func NewURLTask

func NewURLTask(source, destination *utils.RepoURL,
	sourceAuth, destinationAuth types.Auth,
	osFilterList, archFilterList []string,
	forceUpdate bool) Task

type Type added in v1.5.3

type Type string

type URLTask

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

URLTask converts an image RepoURL pair (specific tag) to BlobTask(s) and ManifestTask(s).

func (*URLTask) GetDestination

func (u *URLTask) GetDestination() *sync.ImageDestination

func (*URLTask) GetPrimary

func (u *URLTask) GetPrimary() Task

func (*URLTask) GetSource

func (u *URLTask) GetSource() *sync.ImageSource

func (*URLTask) ReleaseOnce

func (u *URLTask) ReleaseOnce() bool

func (*URLTask) Run

func (u *URLTask) Run() ([]Task, string, error)

func (*URLTask) Runnable

func (u *URLTask) Runnable() bool

func (*URLTask) String

func (u *URLTask) String() string

func (*URLTask) Type added in v1.5.3

func (u *URLTask) Type() Type

Jump to

Keyboard shortcuts

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