network

package
v2.0.0-alpha.29 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

ErrCacheNotFound ...

Functions

func Download

func 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.

func Upload

func Upload(params UploadParams, logger log.Logger) error

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

Types

type DownloadParams

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

DownloadParams ...

type UploadParams

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

UploadParams ...

Jump to

Keyboard shortcuts

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