interceptor

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CrcsKey              = "org.cnai.nydus.crcs"
	DefaultFileChunkSize = 4 * 1024 * 1024
)

Variables

This section is empty.

Functions

func NewNydus

func NewNydus() *nydus

Types

type ApplyDescriptorFn

type ApplyDescriptorFn func(desc *ocispec.Descriptor)

ApplyDescriptorFn is a function that applies changes to the descriptor.

type FileCrcInfo

type FileCrcInfo struct {
	FilePath  string `json:"file_path"`
	ChunkCrcs string `json:"chunk_crcs"`
}

type FileCrcList

type FileCrcList struct {
	Files []FileCrcInfo `json:"files"`
}

type Interceptor

type Interceptor interface {
	// Intercept intercepts the building stream for some customized logic, readerType is the original stream type, such as raw or tar.
	Intercept(ctx context.Context, mediaType string, filepath string, readerType string, reader io.Reader) (ApplyDescriptorFn, error)
}

Interceptor is an interface that defines the interceptor for the building stream.

Jump to

Keyboard shortcuts

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