Files
buildkit/source/identifier.go
Alex Suraci 6b27487fec source: make sources pluggable
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>
2023-08-16 09:57:55 +01:00

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
}