stash

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stasher

type Stasher interface {
	Stash(ctx context.Context, mod string, ver string) error
}

Stasher has the job of taking a module from an upstream entity and stashing it to a Storage Backend.

func New

func New(f module.Fetcher, s storage.Backend, wrappers ...Wrapper) Stasher

New returns a plain stasher that takes a module from a download.Protocol and stashes it into a backend.Storage.

func WithSingleflight

func WithSingleflight(s Stasher) Stasher

WithSingleflight returns a singleflight stasher. This two clients make two subsequent requests to stash a module, then it will only do it once and give the first response to both the first and the second client.

type Wrapper

type Wrapper func(Stasher) Stasher

Wrapper helps extend the main stasher's functionality with addons.

func WithPool

func WithPool(numWorkers int) Wrapper

WithPool returns a stasher that runs a stash operation {numWorkers} at a time.

Jump to

Keyboard shortcuts

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