bundle

package
v0.31.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ARCHIVE   base.SourceType = "archive"
	DIRECTORY base.SourceType = "directory"
)

Variables

View Source
var ErrManifestNotRegular = errors.New("manifest.json not a regular file")
View Source
var ErrMissingManifest = errors.New("missing manifest.json")
View Source
var ErrUnableToReadManifest = errors.New("unable to read manifest.json")
View Source
var ErrUnrecognizedBundleFormatVersion = errors.New("unrecognized bundle format version")

Functions

func BuildBundle

func BuildBundle(reader base.Reader, opt ...v1.ManifestOption) (base.Bundle, error)

func Checksum

func Checksum(raw []byte) string

func NewDirReader

func NewDirReader(path string) base.Reader

func NewFSReader

func NewFSReader(path string, fsys fs.FS) base.Reader

func NewTarGzReader

func NewTarGzReader(path string, r io.Reader) (base.Reader, error)

func NewTarGzWriter

func NewTarGzWriter(w io.Writer) base.Writer

func ReadBundle

func ReadBundle(reader base.Reader) (base.Bundle, error)

Types

type Bundle

type Bundle = base.Bundle

type DirReader

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

func (*DirReader) Info

func (r *DirReader) Info() base.SourceInfo

func (*DirReader) Manifest

func (r *DirReader) Manifest() (*Manifest, error)

func (*DirReader) WalkFiles

func (r *DirReader) WalkFiles(handler base.WalkFilesFunc) error

type FSReader

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

func (*FSReader) Info

func (r *FSReader) Info() base.SourceInfo

func (*FSReader) Manifest

func (r *FSReader) Manifest() (*Manifest, error)

func (*FSReader) WalkFiles

func (r *FSReader) WalkFiles(handler base.WalkFilesFunc) error

type FileProducer

type FileProducer struct {
	Reader base.Reader
	Filter func(path string) bool
}

func (*FileProducer) Info

func (p *FileProducer) Info() base.SourceInfo

func (*FileProducer) Produce

func (p *FileProducer) Produce(consumer base.FileConsumer) error

type Manifest

type Manifest = base.Manifest

type Reader

type Reader = base.Reader

type TarGzReader

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

func (*TarGzReader) Info

func (r *TarGzReader) Info() base.SourceInfo

func (*TarGzReader) Manifest

func (r *TarGzReader) Manifest() (*base.Manifest, error)

func (*TarGzReader) WalkFiles

func (r *TarGzReader) WalkFiles(handler base.WalkFilesFunc) error

type TarGzWriter

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

func (*TarGzWriter) Write

func (w *TarGzWriter) Write(b Bundle) error

type Writer

type Writer = base.Writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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