proxy

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageArchitecture    = "amd64"
	ImageOS              = "linux"
	MediaTypeImage       = "application/vnd.oci.image.index.v1+json"
	MediaTypeDockerImage = "application/vnd.docker.distribution.manifest.v2+json"
)

Variables

This section is empty.

Functions

func CacheToc

func CacheToc(ctx context.Context, db *bolt.DB, imageName, imageTag, registry string) error

func NewStarlightLayer

func NewStarlightLayer(f *os.File, stargzWriter *util.Writer) (goreg.Layer, error)

NewStarlightLayer mainly populate the hash values for the StarlightLayer object

func SaveLayer

func SaveLayer(bucket *bolt.Bucket, entryMap map[string]*util.TOCEntry, chunks map[string][]*util.TOCEntry) error

InitField save the TOC to the bucket

Types

type Collection

type Collection struct {
	Images []*util.ImageRef `json:"i"`

	Table []*util.OptimizedTraceableEntry `json:"t"`

	// DigestList starting from 0
	DigestList []*util.TraceableBlobDigest `json:"dl"`

	// ImageDigestReference maps Collection.Images 's layers to the
	// position in the Collection.DigestList.
	ImageDigestReference [][]int `json:"idr"`

	Configs []string `json:"cfg"`
	// contains filtered or unexported fields
}

Collection defines the operations between set of files This data structure only use for data storage in the database

func LoadCollection

func LoadCollection(ctx context.Context, db *bolt.DB, imageList []*util.ImageRef) (*Collection, error)

LoadCollection creates a new operator that combine imageList should be sorted inorder

func (*Collection) AddOptimizeTrace

func (c *Collection) AddOptimizeTrace(opt *fs.OptimizedGroup)

func (*Collection) ComposeDeltaBundle

func (c *Collection) ComposeDeltaBundle() (out *util.ProtocolTemplate)

func (*Collection) Minus

func (c *Collection) Minus(old *Collection)

func (*Collection) RemoveMergedApp

func (c *Collection) RemoveMergedApp() error

func (*Collection) SaveMergedApp

func (c *Collection) SaveMergedApp() error

type Convertor

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

func NewConvertor

func NewConvertor(src, dst string, optsSrc, dstSrc []name.Option) (c *Convertor, err error)

func (*Convertor) GetDst

func (c *Convertor) GetDst() string

func (*Convertor) GetSrc

func (c *Convertor) GetSrc() string

func (*Convertor) ToStarlightImage

func (c *Convertor) ToStarlightImage() (err error)

type DeltaBundleBuilder

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

func NewBuilder

func NewBuilder(ctx context.Context, registry string) *DeltaBundleBuilder

func (*DeltaBundleBuilder) WriteBody

func (ib *DeltaBundleBuilder) WriteBody(w io.Writer, c *util.ProtocolTemplate, wg *sync.WaitGroup) (err error)

func (*DeltaBundleBuilder) WriteHeader

func (ib *DeltaBundleBuilder) WriteHeader(w io.Writer, c *util.ProtocolTemplate, wg *sync.WaitGroup, beautified bool) (headerSize int64, contentLength int64, err error)

type StarlightLayer

type StarlightLayer struct {
	R io.Reader

	// Diff is the hash of the uncompressed layer
	Diff goreg.Hash
	// Hash is the hash of the compressed layer
	Hash goreg.Hash

	SizeVal int64
}

func (StarlightLayer) Compressed

func (l StarlightLayer) Compressed() (io.ReadCloser, error)

func (StarlightLayer) DiffID

func (l StarlightLayer) DiffID() (goreg.Hash, error)

func (StarlightLayer) Digest

func (l StarlightLayer) Digest() (goreg.Hash, error)

func (StarlightLayer) MediaType

func (l StarlightLayer) MediaType() (types.MediaType, error)

func (StarlightLayer) Size

func (l StarlightLayer) Size() (int64, error)

func (StarlightLayer) Uncompressed

func (l StarlightLayer) Uncompressed() (io.ReadCloser, error)

type StarlightProxyServer

type StarlightProxyServer struct {
	http.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(registry, logLevel string, wg *sync.WaitGroup) *StarlightProxyServer

Jump to

Keyboard shortcuts

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