Documentation
¶
Overview ¶
Package snapshot encodes one verified skillsync bundle as a reproducible tar artifact and exposes the same descriptor/content pair for embedding.
Index ¶
- Constants
- func DescriptorJSON(descriptor skillsync.BundleDescriptor, content fs.FS) ([]byte, error)
- func Pack(descriptor skillsync.BundleDescriptor, content fs.FS) ([]byte, error)
- func Unpack(artifact []byte, limits Limits) (skillsync.BundleDescriptor, fs.FS, error)
- func Write(w io.Writer, descriptor skillsync.BundleDescriptor, content fs.FS) error
- func WriteEmbedDirectory(dir string, descriptor skillsync.BundleDescriptor, content fs.FS) error
- type Captured
- func (c Captured) DescriptorJSON(descriptor skillsync.BundleDescriptor) ([]byte, error)
- func (c Captured) Digest(executablePaths []string) (string, error)
- func (c Captured) NormalizeDescriptor(descriptor skillsync.BundleDescriptor) (skillsync.BundleDescriptor, error)
- func (c Captured) Pack(descriptor skillsync.BundleDescriptor) ([]byte, error)
- func (c Captured) Write(w io.Writer, descriptor skillsync.BundleDescriptor) error
- func (c Captured) WriteEmbedDirectory(dir string, descriptor skillsync.BundleDescriptor) error
- type Limits
Constants ¶
const DefaultAssetName = "skillsync-bundle.tar"
DefaultAssetName is the stable GitHub Release asset name for packed bundles.
const DefaultDescriptorAssetName = "skillsync-bundle.json"
const DefaultMaxBytes int64 = 16 << 20
const DefaultMaxFiles = 256
DefaultMaxFiles and DefaultMaxBytes are the consumer bounds applied when a caller passes zero-value Limits to Unpack.
Variables ¶
This section is empty.
Functions ¶
func DescriptorJSON ¶
DescriptorJSON returns canonical descriptor metadata for a companion release asset and normalizes executable modes discovered in local source content.
func Pack ¶
Pack emits byte-for-byte reproducible tar content. HTTPS transport and the descriptor digest provide integrity; this format does not claim signatures.
func Write ¶
Write emits a reproducible archive to w. It is useful to release producers that upload an artifact without first duplicating it on disk.
func WriteEmbedDirectory ¶
WriteEmbedDirectory materializes the exact descriptor/content pair for a caller's go:embed directory. The destination must not already exist. A write failure may leave partial output in this newly created directory; callers must discard that output before retrying or embedding it.
Types ¶
type Captured ¶
type Captured struct {
// contains filtered or unexported fields
}
Captured is an immutable, mode-preserving copy of a source filesystem. A producer captures once, verifies that copy, then uses it for every output so a changing filesystem cannot make the archive and descriptor disagree.
func Capture ¶
Capture reads every regular source file once and retains its bytes and mode. Symlinks, special entries, and unsafe paths are rejected before a caller can publish any output.
func (Captured) DescriptorJSON ¶
func (c Captured) DescriptorJSON(descriptor skillsync.BundleDescriptor) ([]byte, error)
DescriptorJSON returns canonical descriptor metadata for a captured image.
func (Captured) Digest ¶
Digest computes the mode-aware digest from the captured bytes, using the shared skillsync digest implementation.
func (Captured) NormalizeDescriptor ¶
func (c Captured) NormalizeDescriptor(descriptor skillsync.BundleDescriptor) (skillsync.BundleDescriptor, error)
NormalizeDescriptor binds descriptor metadata to the captured bytes. It is intentionally the one validation point shared by archive and embed output.
func (Captured) Pack ¶
func (c Captured) Pack(descriptor skillsync.BundleDescriptor) ([]byte, error)
Pack emits a reproducible archive from one captured source image.
func (Captured) WriteEmbedDirectory ¶
func (c Captured) WriteEmbedDirectory(dir string, descriptor skillsync.BundleDescriptor) error