mirror of
https://github.com/moby/buildkit.git
synced 2026-08-10 17:14:08 +00:00
Sources are a pretty neat extension point, except there are a few code paths that hard-code against each type. This moves code around and adjusts interfaces so that Source implementations are self-contained and merely need to be registered with the source.Manager. Signed-off-by: Alex Suraci <suraci.alex@gmail.com>
21 lines
457 B
Go
21 lines
457 B
Go
package source
|
|
|
|
import (
|
|
"github.com/moby/buildkit/solver/llbsolver/provenance"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
var (
|
|
errInvalid = errors.New("invalid")
|
|
errNotFound = errors.New("not found")
|
|
)
|
|
|
|
type Identifier interface {
|
|
// Scheme returns the scheme of the identifier so that it can be routed back
|
|
// to an appropriate Source.
|
|
Scheme() string
|
|
|
|
// Capture records the provenance of the identifier.
|
|
Capture(dest *provenance.Capture, pin string) error
|
|
}
|