Documentation ¶
Overview ¶
Package dir implements a directory-based CAS engine.
Index ¶
- func NewDigestListerEngine(ctx context.Context, path string, uri string, getDigest GetDigest) (engine casengine.DigestListerEngine, err error)
- func NewEngine(ctx context.Context, path string, uri string) (engine casengine.Engine, err error)
- type DigestListerEngine
- type Engine
- func (engine *Engine) Algorithms(ctx context.Context, prefix string, size int, from int, ...) (err error)
- func (engine *Engine) Close(ctx context.Context) (err error)
- func (engine *Engine) Delete(ctx context.Context, digest digest.Digest) (err error)
- func (engine *Engine) Get(ctx context.Context, digest digest.Digest) (reader io.ReadCloser, err error)
- func (engine *Engine) Put(ctx context.Context, algorithm digest.Algorithm, reader io.Reader) (dig digest.Digest, err error)
- type GetDigest
- type RegexpGetDigest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDigestListerEngine ¶
func NewDigestListerEngine(ctx context.Context, path string, uri string, getDigest GetDigest) (engine casengine.DigestListerEngine, err error)
NewDigestListerEngine creates a new CAS-engine instance that can list the digests it contains. Arguments are the same as for NewEngine, with an additional getDigest used to translate paths to digests.
func NewEngine ¶
NewEngine creates a new CAS-engine instance. The path argument is used as a base for expanding relative URIs and as a base for creating a temporary directory for storing partially-Put blobs. Moving the completed blob to its final location is more likely to be atomic if that temporary directory is on the same filesystem as the final location.
Types ¶
type DigestListerEngine ¶
type DigestListerEngine struct { *Engine // contains filtered or unexported fields }
DigestListerEngine is a CAS engine based on the local filesystem.
type Engine ¶
type Engine struct { // Algorithm selects the Algorithm used for Put. Algorithm digest.Algorithm // contains filtered or unexported fields }
Engine is a CAS engine based on the local filesystem.
func (*Engine) Algorithms ¶
func (engine *Engine) Algorithms(ctx context.Context, prefix string, size int, from int, callback casengine.AlgorithmCallback) (err error)
Algorithms implements AlgorithmLister.Algorithms.
type GetDigest ¶
GetDigest calculates the digest corresponding to a given relative path. This is effectively the inverse of URI Template expansion, and is required to support Digests.
type RegexpGetDigest ¶
RegexpGetDigest is a helper structure for regular-expression based GetDigest implementations.
func (*RegexpGetDigest) GetDigest ¶
func (r *RegexpGetDigest) GetDigest(path string) (dig digest.Digest, err error)
GetDigest implements GetDigest for RegexpGetDigest.