oci

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 38 Imported by: 5

Documentation

Overview

OCI Repository Adapter

Index

Constants

View Source
const (
	FunctionTypesKey    = ociImagePrefix + "types"
	DescriptionKey      = ociImagePrefix + "description"
	DocumentationURLKey = ociImagePrefix + "documentationurl"

	// experimental: this field is very likely to be changed in the future.
	ConfigMapFnKey = fnConfigMetaPrefix + "configmap.requiredfields"
)

Variables

This section is empty.

Functions

func AnnotationToSlice

func AnnotationToSlice(annotation string) []string

func GetDefaultFunctionConfig

func GetDefaultFunctionConfig(manifest *v1.Manifest) []functionConfig

func GetFunctionMeta

func GetFunctionMeta(reference string, ctx context.Context) (*functionMeta, error)

func GetSingleFromAnnotation

func GetSingleFromAnnotation(key string, manifest *v1.Manifest) string

func GetSliceFromAnnotation

func GetSliceFromAnnotation(key string, manifest *v1.Manifest) []string

func OpenRepository

func OpenRepository(name string, namespace string, content configapi.RepositoryContent, spec *configapi.OciRepository, cacheDir string) (repository.Repository, error)

Types

type ImageDigestName

type ImageDigestName struct {
	Image  string
	Digest string
}

ImageDigestName holds an image we know by digest (which is immutable and more cacheable)

func (ImageDigestName) String

func (i ImageDigestName) String() string

type ImageTagName

type ImageTagName struct {
	Image string
	Tag   string
}

ImageTagName holds an image we know by tag (but tags are mutable, so this often implies lookups)

func ParseImageTagName

func ParseImageTagName(s string) (*ImageTagName, error)

func (ImageTagName) String

func (i ImageTagName) String() string

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage provides helper functions specifically for OCI storage. It abstracts and simplifies the go-containerregistry library, but is agnostic to the contents of the images etc.

func NewStorage

func NewStorage(cacheDir string) (*Storage, error)

NewStorage creates a Storage for managing OCI images.

func (*Storage) LoadResources

func (r *Storage) LoadResources(ctx context.Context, imageName *ImageDigestName) (*repository.PackageResources, error)

func (*Storage) LookupImageTag

func (r *Storage) LookupImageTag(ctx context.Context, imageName ImageTagName) (*ImageDigestName, error)

Jump to

Keyboard shortcuts

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