workspacebundle

package
v2.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxCompressedSize   int64 = 64 << 20
	DefaultMaxUncompressedSize int64 = 256 << 20
	DefaultMaxFiles                  = 8192
)

Variables

This section is empty.

Functions

func Digest

func Digest(data []byte) string

func Extract

func Extract(data []byte, dest string, desc Descriptor, limits Limits) error

func IsPathWithin

func IsPathWithin(root, candidate string) bool

func NormalizeRelativePath

func NormalizeRelativePath(relPath string) (string, error)

func StoreDir

func StoreDir(dataDir string) string

func ValidDigest

func ValidDigest(digest string) bool

func Verify

func Verify(data []byte, digest string) error

Types

type Client

type Client interface {
	PutWorkspaceBundle(ctx context.Context, desc Descriptor, data []byte) error
	GetWorkspaceBundle(ctx context.Context, digest string) ([]byte, error)
}

type Descriptor

type Descriptor struct {
	Digest      string
	Size        int64
	DAGPath     string
	OriginalRef string
	ResolvedRef string
}

func PackDirectory

func PackDirectory(root string, opts PackOptions) (*Descriptor, []byte, error)

type Limits

type Limits struct {
	MaxCompressedSize   int64
	MaxUncompressedSize int64
	MaxFiles            int
}

func DefaultLimits

func DefaultLimits() Limits

type PackOptions

type PackOptions struct {
	DAGPath     string
	OriginalRef string
	ResolvedRef string
	Limits      Limits
}

type Store

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

func NewStore

func NewStore(dir string, limits Limits) *Store

func (*Store) Get

func (s *Store) Get(_ context.Context, digest string) ([]byte, error)

func (*Store) Has

func (s *Store) Has(digest string) bool

func (*Store) Put

func (s *Store) Put(_ context.Context, desc Descriptor, data []byte) error

Jump to

Keyboard shortcuts

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