parser

package
v0.0.0-...-2440f66 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindNydusBootstrapDesc

func FindNydusBootstrapDesc(manifest *ocispec.Manifest) *ocispec.Descriptor

Try to find the topmost layer in Nydus manifest, it should be a Nydus bootstrap layer, see examples/manifest/manifest.json

Types

type Image

type Image struct {
	Desc     ocispec.Descriptor
	Manifest ocispec.Manifest
	Config   ocispec.Image
}

Image presents image contents.

type Parsed

type Parsed struct {
	Index *ocispec.Index
	// The base image from which to generate nydus image.
	NydusImage *Image
}

Parsed presents OCI and Nydus image manifest. Nydus image conversion only works on top of an existed oci image whose platform is linux/amd64

type Parser

type Parser struct {
	Remote *remote.Remote
	// contains filtered or unexported fields
}

Parser parses OCI & Nydus image manifest, manifest index and image config into Parsed object, see the Nydus image example: examples/manifest/index.json, examples/manifest/manifest.json.

func New

func New(remote *remote.Remote, interestedArch string) (*Parser, error)

New creates Nydus image parser instance.

func (*Parser) Parse

func (parser *Parser) Parse(ctx context.Context) (*Parsed, error)

Parse parses Nydus image reference into Parsed object.

func (*Parser) PullNydusBootstrap

func (parser *Parser) PullNydusBootstrap(ctx context.Context, image *Image) (io.ReadCloser, error)

PullNydusBootstrap pulls Nydus bootstrap layer from Nydus image.

Jump to

Keyboard shortcuts

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