adapter

package
v0.2.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TagSuffix = "tag_suffix"
	CacheTag  = "cache_tag"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	// Dispatch dispatches a conversion task to worker queue
	// by specifying source image reference, the conversion is
	// asynchronous, and if the sync option is specified,
	// Dispatch will be blocked until the conversion is complete.
	Dispatch(ctx context.Context, ref string, sync bool) error
	// CheckHealth checks the containerd client can successfully
	// connect to the containerd daemon and the healthcheck service
	// returns the SERVING response.
	CheckHealth(ctx context.Context) error
}

type Job

type Job func() error

type LocalAdapter

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

func NewLocalAdapter

func NewLocalAdapter(cfg *config.Config) (*LocalAdapter, error)

func (*LocalAdapter) CheckHealth

func (adp *LocalAdapter) CheckHealth(_ context.Context) error

func (*LocalAdapter) Convert

func (adp *LocalAdapter) Convert(ctx context.Context, source string) (*converter.Metric, error)

func (*LocalAdapter) Dispatch

func (adp *LocalAdapter) Dispatch(ctx context.Context, ref string, sync bool) error

type Rule

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

func (*Rule) Map

func (rule *Rule) Map(ref, opt string) (string, error)

Map maps the source image reference to a new one according to a rule, the new one will be used as the reference of target image.

type Worker

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

func NewWorker

func NewWorker(count int) (*Worker, error)

NewWorker starts a worker queue with a specified maximum worker number for concurrent and limited job execution.

func (*Worker) Dispatch

func (worker *Worker) Dispatch(job func() error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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