package convertor

import "github.com/containerd/accelerated-container-image/pkg/convertor"

Index

Variables

var (
	ConvContentNameFormat = convSnapshotNameFormat
)

Functions

func IndexConvertFunc

func IndexConvertFunc(opts ...Option) converter.ConvertFunc

func NewContentLoaderWithFsType

func NewContentLoaderWithFsType(isAccelLayer bool, fsType string, files ...ContentFile) *contentLoader

contentLoader can load multiple files into content.Store service, and return an oci.v1.tar layer.

func UniquePart

func UniquePart() string

NOTE: based on https://github.com/containerd/containerd/blob/v1.4.3/rootfs/apply.go#L181-L187

Types

type ContentFile

type ContentFile struct {
	SrcFilePath string // .../{ID}/fs/overlaybd.sealed
	DstFileName string // overlaybd.commit
}

type ImageConvertor

type ImageConvertor interface {
	Convert(ctx context.Context, srcManifest ocispec.Manifest, fsType string) (ocispec.Descriptor, error)
}

func NewOverlaybdConvertor

func NewOverlaybdConvertor(ctx context.Context, cs content.Store, sn snapshots.Snapshotter, resolver remotes.Resolver, ref string, dbstr string, zfileCfg ZFileConfig, vsize int) (ImageConvertor, error)

type Layer

type Layer struct {
	Desc   ocispec.Descriptor
	DiffID digest.Digest
}

func (*Layer) GetInfo

func (l *Layer) GetInfo() (ocispec.Descriptor, digest.Digest)

type Option

type Option func(o *options) error

func WithAlgorithm

func WithAlgorithm(algorithm string) Option

func WithBlockSize

func WithBlockSize(blockSize int) Option

func WithClient

func WithClient(client *containerd.Client) Option

func WithDbstr

func WithDbstr(dbstr string) Option

func WithFsType

func WithFsType(fsType string) Option

func WithImageRef

func WithImageRef(imgRef string) Option

func WithResolver

func WithResolver(resolver remotes.Resolver) Option

func WithVsize

func WithVsize(vsize int) Option

type OverlaybdLayer

type OverlaybdLayer struct {
	Host       string
	Repo       string
	ChainID    string
	DataDigest string
	DataSize   int64
}

type ZFileConfig

type ZFileConfig struct {
	Algorithm string `json:"algorithm"`
	BlockSize int    `json:"blockSize"`
}

Source Files

convertor.go

Version
v1.3.0 (latest)
Published
Feb 13, 2025
Platform
js/wasm
Imports
35 packages
Last checked
2 hours ago

Tools for package owners.