bundle

package
v0.0.0-...-1087858 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplyModeFull    = "full"
	ApplyModePartial = "partial"
)

Variables

This section is empty.

Functions

func CanonicalHash

func CanonicalHash(hash string) (string, error)

func HashHex

func HashHex(hash string) (string, error)

Types

type BuildOptions

type BuildOptions struct {
	Source *Source
}

type Bundle

type Bundle struct {
	Manifest   Manifest
	Files      map[string][]byte
	ExtraFiles []string
}

func ReadTar

func ReadTar(r io.Reader) (Bundle, error)

type FileRef

type FileRef struct {
	File string `json:"file"`
	Hash string `json:"hash"`
}

type Manifest

type Manifest struct {
	APIVersion string     `json:"apiVersion"`
	Kind       string     `json:"kind"`
	Mode       string     `json:"mode"`
	Website    string     `json:"website"`
	Source     *Source    `json:"source,omitempty"`
	Resources  []Resource `json:"resources"`
}

func BuildTarFromDir

func BuildTarFromDir(dir string, website string) ([]byte, Manifest, error)

BuildTarFromDir validates a site directory and produces a full-apply tar bundle.

func BuildTarFromDirWithOptions

func BuildTarFromDirWithOptions(dir string, website string, opts BuildOptions) ([]byte, Manifest, error)

BuildTarFromDirWithOptions validates a site directory and produces a full-apply tar bundle.

func BuildTarFromFileWithOptions

func BuildTarFromFileWithOptions(filePath string, website string, opts BuildOptions) ([]byte, Manifest, error)

BuildTarFromFileWithOptions validates a supported site file path and produces a partial-apply tar bundle.

func BuildTarFromPath

func BuildTarFromPath(sourcePath string, website string) ([]byte, Manifest, error)

BuildTarFromPath validates a site directory or supported site file path and produces a bundle.

func BuildTarFromPathWithOptions

func BuildTarFromPathWithOptions(sourcePath string, website string, opts BuildOptions) ([]byte, Manifest, error)

BuildTarFromPathWithOptions validates a site directory or supported site file path and produces a bundle.

func ParseManifest

func ParseManifest(b []byte) (Manifest, error)

func (Manifest) Validate

func (m Manifest) Validate() error

type Resource

type Resource struct {
	Kind        string    `json:"kind"`
	Name        string    `json:"name"`
	File        string    `json:"file,omitempty"`
	Hash        string    `json:"hash,omitempty"`
	Files       []FileRef `json:"files,omitempty"`
	ContentType string    `json:"contentType,omitempty"`
	Size        int64     `json:"size,omitempty"`
	Deleted     bool      `json:"deleted,omitempty"`
}

func (Resource) FileEntries

func (r Resource) FileEntries() []FileRef

type Source

type Source struct {
	Type   string `json:"type"`
	Repo   string `json:"repo"`
	Ref    string `json:"ref"`
	Subdir string `json:"subdir,omitempty"`
}

func (Source) Validate

func (s Source) Validate() error

type ValidationError

type ValidationError struct {
	MissingFiles   []string
	HashMismatches []string
}

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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