loader

package
v0.0.0-...-f5040f8 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LOAD_TYPE

type LOAD_TYPE int64
const (
	LOAD_GIT LOAD_TYPE = iota
	LOAD_HTTP
	LOAD_FILE
)

type Loader

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

Loader is used to download different assets in parallel while avoiding downloading artifacts twice.

func NewLoader

func NewLoader(ctx context.Context, opts ...LoaderOption) *Loader

func (*Loader) Load

func (l *Loader) Load(typ LOAD_TYPE, url string, clean bool) (string, error)

Load() checks whether the requested asset is currently being downloaded. If this is the case, Load() waits until the download is complete. If not, Load() starts the download itself and waits until it is complete. The asset is extracted to $rootPath/$typ-$sha256(url)/...

type LoaderOption

type LoaderOption func(*Loader)

func WithRootPath

func WithRootPath(path string) LoaderOption

WithRootPath defines a custom root path where the loader will output downloaded data.

Jump to

Keyboard shortcuts

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