Merge pull request #143 from AkihiroSuda/refactor-ref
cache, solver: refactor Reference interfacedocker-18.09
commit
dfb786a292
|
@ -12,24 +12,25 @@ import (
|
|||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type ImmutableRef interface {
|
||||
// Ref is a reference to cacheable objects.
|
||||
type Ref interface {
|
||||
Mountable
|
||||
ID() string
|
||||
Release(context.Context) error
|
||||
Size(ctx context.Context) (int64, error)
|
||||
Metadata() *metadata.StorageItem
|
||||
}
|
||||
|
||||
type ImmutableRef interface {
|
||||
Ref
|
||||
Parent() ImmutableRef
|
||||
Finalize(ctx context.Context) error // Make sure reference is flushed to driver
|
||||
Metadata() *metadata.StorageItem
|
||||
// Prepare() / ChainID() / Meta()
|
||||
}
|
||||
|
||||
type MutableRef interface {
|
||||
Mountable
|
||||
ID() string
|
||||
Ref
|
||||
Commit(context.Context) (ImmutableRef, error)
|
||||
Release(context.Context) error
|
||||
Size(ctx context.Context) (int64, error)
|
||||
Metadata() *metadata.StorageItem
|
||||
}
|
||||
|
||||
type Mountable interface {
|
||||
|
|
|
@ -57,6 +57,8 @@ func NewLLBSolver(opt LLBOpt) *Solver {
|
|||
type ResolveOpFunc func(Vertex) (Op, error)
|
||||
|
||||
// Reference is a reference to the object passed through the build steps.
|
||||
// This interface is a subset of the cache.Ref interface.
|
||||
// For ease of unit testing, this interface only has Release().
|
||||
type Reference interface {
|
||||
Release(context.Context) error
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue