Documentation ¶
Index ¶
- type Stasher
- type Wrapper
- func WithAzureBlobLock(conf *config.AzureBlobConfig, timeout time.Duration, checker storage.Checker) (Wrapper, error)
- func WithEtcd(endpoints []string, checker storage.Checker) (Wrapper, error)
- func WithPool(numWorkers int) Wrapper
- func WithRedisLock(endpoint string, checker storage.Checker) (Wrapper, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stasher ¶
Stasher has the job of taking a module from an upstream entity and stashing it to a Storage Backend. It also returns a string that represents a semver version of what was requested, this is helpful if what was requested was a descriptive version such as a branch name or a full commit sha.
func New ¶
New returns a plain stasher that takes a module from a download.Protocol and stashes it into a backend.Storage.
func WithGCSLock ¶ added in v0.4.0
WithGCSLock returns a distributed singleflight using a GCS backend. See the config.toml documentation for details.
func WithSingleflight ¶
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 ¶
Wrapper helps extend the main stasher's functionality with addons.
func WithAzureBlobLock ¶ added in v0.4.0
func WithAzureBlobLock(conf *config.AzureBlobConfig, timeout time.Duration, checker storage.Checker) (Wrapper, error)
WithAzureBlobLock returns a distributed singleflight using a Azure Blob Storage backend. See the config.toml documentation for details.
func WithEtcd ¶ added in v0.3.0
WithEtcd returns a distributed singleflight using an etcd cluster. If it cannot connect, to any of the endpoints, it will return an error.