Documentation
¶
Index ¶
Constants ¶
const ( ActionsProtocol = "actions://" ContainerProtocol = "container://" )
Variables ¶
Functions ¶
func DenormalizeRef ¶
DenormalizeRef removes the reference prefix.
func NormalizeActionsRef ¶
func NormalizeContainerRef ¶
Types ¶
type Actions ¶
type Actions struct {
// contains filtered or unexported fields
}
Actions resolves GitHub references.
func NewActions ¶
NewActions creates a new resolver for GitHub Actions.
func (*Actions) LatestVersion ¶ added in v0.7.0
func (*Actions) ResolvedTimestamp ¶ added in v0.12.0
ResolvedTimestamp reports the most trustworthy known publish or creation time for value, trying sources from most to least trustworthy: a GitHub release's server-set published_at, then an annotated tag's tagger date, then the resolved commit's committer date, then its author date. It returns nil when no time can be determined.
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container resolves Container registry references.
func NewContainer ¶
NewContainer creates a new resolver for Container registries.
func (*Container) ResolvedTimestamp ¶ added in v0.12.0
ResolvedTimestamp reports the image's config "created" time. That value is set by the image builder and is not server-authoritative. Reproducible builds zero it out (or set it to the Unix epoch), which is reported as nil so the caller degrades gracefully.
type DefaultResolver ¶
type DefaultResolver struct {
// contains filtered or unexported fields
}
DefaultResolver is the default resolver.
func (*DefaultResolver) LatestVersion ¶ added in v0.7.0
LatestVersion upgrades the ref.
type GitHubRef ¶
type GitHubRef struct {
// contains filtered or unexported fields
}
func ParseActionRef ¶ added in v0.2.0
type Option ¶ added in v0.12.0
type Option func(*resolverOptions)
Option configures the default resolver.
func WithBakeDelay ¶ added in v0.12.0
WithBakeDelay sets the minimum age an artifact must have before Resolve will pin it. Zero or negative disables the check.
type Resolver ¶
type Resolver interface {
// Resolve resolves the given reference, returning the resolved reference or
// an error. If the provided context is canceled, the resolution is also
// canceled.
Resolve(context.Context, string) (string, error)
// LatestVersion resolves the given reference to the most recent release version,
// returning the resolved reference or an error. If the provided context is
// canceled, the resolution is also canceled.
LatestVersion(context.Context, string) (string, error)
}
Resolver is an interface that resolvers can implement.
type Test ¶
type Test struct {
// contains filtered or unexported fields
}
Test is a test resolver. It accepts a pre-defined list of results and panics if asked to resolve an undefined reference.
func NewTest ¶
func NewTest(data, latest map[string]*TestResult) (*Test, error)
NewTest creates a new test resolver.
func (*Test) LatestVersion ¶ added in v0.7.0
type TestResult ¶
TestResult represents the result of a resolution. If Err is not nil, Resolved is the empty string.
type Timestamp ¶ added in v0.12.0
Timestamp is the most trustworthy known publish or creation time for a resolved artifact, along with the source it was derived from (for example "release", "tag", "commit", or "image").
type TimestampResolver ¶ added in v0.12.0
type TimestampResolver interface {
ResolvedTimestamp(ctx context.Context, ref string) (*Timestamp, error)
}
TimestampResolver is an optional capability that a Resolver may implement to report the age of a resolved artifact. It powers the bake delay. Resolvers that cannot determine a time return a nil Timestamp with a nil error, and the caller treats the artifact as passing the bake delay (graceful degradation).