Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultReference() *registry.Reference
- func FormatRepositoryForDisplay(repo string) string
- func GetConfig(ctx context.Context, store oras.ReadOnlyTarget, configDesc ocispec.Descriptor) (*artifact.KitFile, error)
- func GetManifest(ctx context.Context, store oras.ReadOnlyTarget, ...) (*ocispec.Manifest, error)
- func GetManifestAndConfig(ctx context.Context, store oras.ReadOnlyTarget, ...) (*ocispec.Manifest, *artifact.KitFile, error)
- func IsModelKitReference(ref string) bool
- func LayerPathsFromKitfile(kitfile *artifact.KitFile) []string
- func ParseReference(refString string) (reference *registry.Reference, extraTags []string, err error)
- func ReferenceIsDigest(ref string) bool
- func RepoPath(storagePath string, ref *registry.Reference) string
- func ResolveManifest(ctx context.Context, store oras.Target, reference string) (ocispec.Descriptor, *ocispec.Manifest, error)
- func ResolveManifestAndConfig(ctx context.Context, store oras.Target, reference string) (ocispec.Descriptor, *ocispec.Manifest, *artifact.KitFile, error)
Constants ¶
const ( DefaultRegistry = "localhost" DefaultRepository = "_" )
Variables ¶
var ErrNotAModelKit = errors.New("reference exists but is not a modelkit")
Functions ¶
func DefaultReference ¶
DefaultReference returns a reference that can be used when no reference is supplied. It uses the default registry and repository
func FormatRepositoryForDisplay ¶
FormatRepositoryForDisplay removes default values from a repository string to avoid surfacing defaulted fields when displaying references, which may be confusing.
func GetConfig ¶
func GetConfig(ctx context.Context, store oras.ReadOnlyTarget, configDesc ocispec.Descriptor) (*artifact.KitFile, error)
GetConfig returns the config (Kitfile) described by a descriptor. Returns an error if the config blob cannot be resolved or if the descriptor does not describe a Kitfile.
func GetManifest ¶
func GetManifest(ctx context.Context, store oras.ReadOnlyTarget, manifestDesc ocispec.Descriptor) (*ocispec.Manifest, error)
GetManifest returns the Manifest described by a Descriptor. Returns an error if the manifest blob cannot be resolved or does not represent a modelkit manifest.
func GetManifestAndConfig ¶
func GetManifestAndConfig(ctx context.Context, store oras.ReadOnlyTarget, manifestDesc ocispec.Descriptor) (*ocispec.Manifest, *artifact.KitFile, error)
GetManifestAndConfig returns the manifest and config (Kitfile) for a manifest Descriptor. Calls GetManifest and GetConfig.
func IsModelKitReference ¶
IsModelKitReference returns true if the ref string "looks" like a modelkit reference
func LayerPathsFromKitfile ¶
func ParseReference ¶
func ParseReference(refString string) (reference *registry.Reference, extraTags []string, err error)
ParseReference parses a reference string into a Reference struct. It attempts to make references conform to an expected structure, with a defined registry and repository by filling default values for registry and repository where appropriate. Where the first part of a reference doesn't look like a registry URL, the default registry is used, turning e.g. testorg/testrepo into localhost/testorg/testrepo. If refString does not contain a registry or a repository (i.e. is a base SHA256 hash), the returned reference uses placeholder values for registry and repository.
See FormatRepositoryForDisplay for removing default values from a registry for displaying to the user.
func ReferenceIsDigest ¶
ReferenceIsDigest returns if the reference is a digest. If false, reference should be treated as a tag
func RepoPath ¶
RepoPath returns the path that should be used for creating a local OCI index given a specific *registry.Reference.
func ResolveManifest ¶
func ResolveManifest(ctx context.Context, store oras.Target, reference string) (ocispec.Descriptor, *ocispec.Manifest, error)
ResolveManifest returns the manifest for a reference (tag), if present in the target store
func ResolveManifestAndConfig ¶
func ResolveManifestAndConfig(ctx context.Context, store oras.Target, reference string) (ocispec.Descriptor, *ocispec.Manifest, *artifact.KitFile, error)
ResolveManifestAndConfig returns the manifest and config (Kitfile) for a given reference (tag), if present in the store. Calls ResolveManifest and GetConfig.
Types ¶
This section is empty.