downloader

package
v0.0.0-...-6248b73 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

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

func New

func New(dataNs, dataName, podName, downloadRootDir, localRootDir string, taskCh, noticeCh chan *v1alpha1.Task, registry Registry) (*Downloader, error)

func (*Downloader) Run

func (d *Downloader) Run(ctx context.Context)

type Interface

type Interface interface {
	Download(ctx context.Context, subTask *v1alpha1.SubTask) error
}

type PluginFactory

type PluginFactory = func(downloadRootDir string) Interface

type Registry

type Registry map[string]PluginFactory

func (Registry) Get

func (r Registry) Get(name string) (PluginFactory, error)

func (Registry) Register

func (r Registry) Register(name string, factory PluginFactory)

func (Registry) Unregister

func (r Registry) Unregister(name string) error

Unregister removes an existing plugins from the registry. If no plugins with the provided name exists, it returns an error.

Jump to

Keyboard shortcuts

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