oci

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OciReferenceTarget            = "org.opencontainers.image.ref.name"
	LocalPrefix                   = "oci://"
	RegistryPrefix                = "docker://"
	OCI                SourceType = "OCI"
	Docker             SourceType = "Docker"
)

Variables

This section is empty.

Functions

func ExtractEnvelopes

func ExtractEnvelopes(manifest *attestation.AttestationManifest, predicateType string) ([]*att.Envelope, error)

func FetchAttestationManifest

func FetchAttestationManifest(ctx context.Context, image string, platform *v1.Platform) (*attestation.AttestationManifest, error)

func HttpTransport

func HttpTransport() http.RoundTripper

func MultiKeychainAll added in v0.1.6

func MultiKeychainAll() authn.Keychain

func MultiKeychainOption added in v0.1.6

func MultiKeychainOption() remote.Option

func ParsePlatform added in v0.1.5

func ParsePlatform(platformStr string) (*v1.Platform, error)

ParsePlatform parses the provided platform string or attempts to obtain the platform of the current host system

func RefToPURL

func RefToPURL(ref string, platform *v1.Platform) (string, bool, error)

func SplitDigest added in v0.1.4

func SplitDigest(digest string) (common.DigestSet, error)

func WithOptions added in v0.1.5

func WithOptions(ctx context.Context, platform *v1.Platform) []remote.Option

func WithReferrersRepo added in v0.1.5

func WithReferrersRepo(repo string) func(*ReferrersResolver) error

func WithoutTag added in v0.1.5

func WithoutTag(image string) (string, error)

Types

type AttestationOptions added in v0.1.5

type AttestationOptions struct {
	NoReferrers   bool
	Attach        bool
	ReferrersRepo string
}

type AttestationResolver

type AttestationResolver interface {
	ImageDetailsResolver
	Attestations(ctx context.Context, mediaType string) ([]*att.Envelope, error)
}

type ImageDetailsResolver added in v0.1.5

type ImageDetailsResolver interface {
	ImageName(ctx context.Context) (string, error)
	ImagePlatform(ctx context.Context) (*v1.Platform, error)
	ImageDescriptor(ctx context.Context) (*v1.Descriptor, error)
}

type ImageSpec added in v0.1.5

type ImageSpec struct {
	// OCI or Docker
	Type SourceType
	// without oci:// or docker:// (name or path)
	Identifier string
	Platform   *v1.Platform
}

func ParseImageSpec added in v0.1.5

func ParseImageSpec(img string, options ...ImageSpecOption) (*ImageSpec, error)

func ParseImageSpecs added in v0.1.5

func ParseImageSpecs(img string) ([]*ImageSpec, error)

func ReplaceTagInSpec added in v0.1.8

func ReplaceTagInSpec(src *ImageSpec, digest v1.Hash) (*ImageSpec, error)

func (*ImageSpec) ForPlatforms added in v0.1.5

func (i *ImageSpec) ForPlatforms(platform string) ([]*ImageSpec, error)

type ImageSpecOption added in v0.1.5

type ImageSpecOption func(*ImageSpec) error

func WithPlatform added in v0.1.5

func WithPlatform(platform string) ImageSpecOption

type NamedIndex added in v0.1.7

type NamedIndex struct {
	Index v1.ImageIndex
	Name  string
}

func IndexFromPath added in v0.1.7

func IndexFromPath(path string) (*NamedIndex, error)

func IndexFromRemote added in v0.1.7

func IndexFromRemote(image string) (*NamedIndex, error)

func LoadIndex added in v0.1.7

func LoadIndex(input *ImageSpec) (*NamedIndex, error)

type OCILayoutResolver

type OCILayoutResolver struct {
	*attestation.AttestationManifest
	*ImageSpec
}

implementation of AttestationResolver that closes over attestations from an oci layout

func NewOCILayoutAttestationResolver added in v0.1.5

func NewOCILayoutAttestationResolver(src *ImageSpec) (*OCILayoutResolver, error)

func (*OCILayoutResolver) Attestations

func (r *OCILayoutResolver) Attestations(ctx context.Context, predicateType string) ([]*att.Envelope, error)

func (*OCILayoutResolver) ImageDescriptor added in v0.1.8

func (r *OCILayoutResolver) ImageDescriptor(ctx context.Context) (*v1.Descriptor, error)

func (*OCILayoutResolver) ImageName

func (r *OCILayoutResolver) ImageName(ctx context.Context) (string, error)

func (*OCILayoutResolver) ImagePlatform added in v0.1.5

func (r *OCILayoutResolver) ImagePlatform(ctx context.Context) (*v1.Platform, error)

type Option

type Option = func(*http.Client)

type ReferrersResolver added in v0.1.5

type ReferrersResolver struct {
	ImageDetailsResolver
	// contains filtered or unexported fields
}

func NewReferrersAttestationResolver added in v0.1.5

func NewReferrersAttestationResolver(src ImageDetailsResolver, options ...func(*ReferrersResolver) error) (*ReferrersResolver, error)

func (*ReferrersResolver) Attestations added in v0.1.5

func (r *ReferrersResolver) Attestations(ctx context.Context, predicateType string) ([]*att.Envelope, error)

type RegistryImageDetailsResolver added in v0.1.5

type RegistryImageDetailsResolver struct {
	*ImageSpec
	// contains filtered or unexported fields
}

func NewRegistryImageDetailsResolver added in v0.1.5

func NewRegistryImageDetailsResolver(src *ImageSpec) (*RegistryImageDetailsResolver, error)

func (*RegistryImageDetailsResolver) ImageDescriptor added in v0.1.8

func (r *RegistryImageDetailsResolver) ImageDescriptor(ctx context.Context) (*v1.Descriptor, error)

func (*RegistryImageDetailsResolver) ImageName added in v0.1.5

func (*RegistryImageDetailsResolver) ImagePlatform added in v0.1.5

func (r *RegistryImageDetailsResolver) ImagePlatform(ctx context.Context) (*v1.Platform, error)

type RegistryResolver

type RegistryResolver struct {
	*RegistryImageDetailsResolver
	*attestation.AttestationManifest
}

func NewRegistryAttestationResolver added in v0.1.5

func NewRegistryAttestationResolver(src *RegistryImageDetailsResolver) (*RegistryResolver, error)

func (*RegistryResolver) Attestations

func (r *RegistryResolver) Attestations(ctx context.Context, predicateType string) ([]*att.Envelope, error)

type SourceType added in v0.1.5

type SourceType string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL