network

package
v2.0.0-alpha.37 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheNotFound = errors.New("no cache archive found for the provided keys")

ErrCacheNotFound ...

Functions

This section is empty.

Types

type DefaultDownloader

type DefaultDownloader struct{}

DefaultDownloader ...

func (DefaultDownloader) Download

func (d DefaultDownloader) Download(ctx context.Context, params DownloadParams, logger log.Logger) (string, error)

Download archive from the cache API based on the provided keys in params. If there is no match for any of the keys, the error is ErrCacheNotFound.

type DefaultUploader

type DefaultUploader struct{}

DefaultUploader ...

func (DefaultUploader) Upload

func (u DefaultUploader) Upload(ctx context.Context, params UploadParams, logger log.Logger) error

Upload a cache archive and associate it with the provided cache key

type DownloadParams

type DownloadParams struct {
	APIBaseURL     string
	Token          string
	CacheKeys      []string
	DownloadPath   string
	NumFullRetries int
	MaxConcurrency uint
}

DownloadParams ...

type Downloader

type Downloader interface {
	Download(context.Context, DownloadParams, log.Logger) (string, error)
}

Downloader ...

type UploadParams

type UploadParams struct {
	APIBaseURL      string
	Token           string
	ArchivePath     string
	ArchiveChecksum string
	ArchiveSize     int64
	CacheKey        string
}

UploadParams ...

type Uploader

type Uploader interface {
	Upload(context.Context, UploadParams, log.Logger) error
}

Uploader ...

Jump to

Keyboard shortcuts

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