Documentation ¶
Overview ¶
Package repository provides common ways to dial reflow.Repository implementations; it also provides some common utilities for working with repositories.
Index ¶
- func Dial(rawurl string) (reflow.Repository, error)
- func Marshal(ctx context.Context, repo reflow.Repository, v interface{}) (digest.Digest, error)
- func Missing(ctx context.Context, r reflow.Repository, files ...reflow.File) ([]reflow.File, error)
- func RegisterScheme(scheme string, dial func(*url.URL) (reflow.Repository, error))
- func Transfer(ctx context.Context, dst, src reflow.Repository, id digest.Digest) (err error)
- func Unmarshal(ctx context.Context, repo reflow.Repository, k digest.Digest, v interface{}, ...) error
- func UnregisterScheme(scheme string)
- type Limits
- type Manager
- Bugs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
func Dial(rawurl string) (reflow.Repository, error)
Dial attempts to connect to the repository named by the given URL. The URL's scheme must be registered with RegisterScheme.
func Marshal ¶
Marshal marshals the value v and stores it in the provided repository. The digest of the contents of the marshaled content is returned.
func Missing ¶
Missing returns the files in files that are missing from repository r. Missing returns an error if any underlying call fails.
func RegisterScheme ¶
RegisterScheme associates a dialler with a URL scheme.
func Transfer ¶
Transfer attempts to transfer an object from src to dst repository with retries on errors.
Types ¶
type Limits ¶
type Limits struct {
// contains filtered or unexported fields
}
Limits stores a default limits and maintains a set of overrides by key.
type Manager ¶
type Manager struct { // Log is used to report manager status. Log *log.Logger // PendingTransfers defines limits for the number of outstanding // transfers a repository (keyed by URL) may have in flight. // The limit is used separately for transmit and receive traffic. // It is not possible currently to set different limits for the two // directions. PendingTransfers *Limits // Stat defines limits for the number of stat operations that // may be issued concurrently to any given repository. Stat *Limits // Status is used to report active transfers to. Status *status.Group // contains filtered or unexported fields }
A Manager is used to transfer objects between repositories while enforcing transfer policies.
BUG(marius): Manager does not release references to repositories; in long-term processes, this could cause space leaks.
func (*Manager) NeedTransfer ¶
func (m *Manager) NeedTransfer(ctx context.Context, dst reflow.Repository, files ...reflow.File) ([]reflow.File, error)
NeedTransfer determines which of the provided files are missing from the destination repository and must therefore be transfered.
func (*Manager) Transfer ¶
func (m *Manager) Transfer(ctx context.Context, dst, src reflow.Repository, files ...reflow.File) error
Transfer transmits a set of files between two repositories, subject to policies. Files that already exist in the destination repository are skipped.
TODO(marius): we may want to consider single-flighting download requests by sha. At least for large objects.
Notes ¶
Bugs ¶
Manager does not release references to repositories; in long-term processes, this could cause space leaks.
Transfer (or the underyling repositories) should ensure that progress is made.
Directories ¶
Path | Synopsis |
---|---|
Package blobrepo implements a generic reflow.Repository on top of a blob.Bucket.
|
Package blobrepo implements a generic reflow.Repository on top of a blob.Bucket. |
Package client implements repository REST client.
|
Package client implements repository REST client. |
Package filerepo implements a filesystem-backed repository.
|
Package filerepo implements a filesystem-backed repository. |
Package server implements a Repository REST server.
|
Package server implements a Repository REST server. |