bundle

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package bundle builds a sanitized .zip of a local bitwave workspace for sharing. It is fail-closed: any file matching a sensitive-name pattern, or any unknown binary file, aborts the bundle. Operators must remove or rename the file before retrying. Silently dropping such files would risk leaking a misnamed secret into a recipient's inbox.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrJournalNotFound   = errors.New("target journal file not found in workspace")
	ErrUnknownBinaryFile = errors.New("unknown binary file in workspace (remove or rename)")
	ErrFileTooLarge      = errors.New("file exceeds bundle size cap")
	ErrBundleTooLarge    = errors.New("bundle would exceed total size cap")
)

Functions

This section is empty.

Types

type Result

type Result struct {
	IncludedFiles int
	ExcludedFiles []string
	SkippedDirs   []string
	Bytes         int64
}

Result reports what was included or skipped. ExcludedFiles is empty when Build succeeds — Build refuses to ship if any file would have been excluded for sensitivity. SkippedDirs lists dot-directories that were never walked.

func Build

func Build(dir, journalId string, w io.Writer) (*Result, error)

Build writes a sanitized zip of the workspace at dir into w. The target journal file (<journalId>.journal) must exist. Other .journal files are excluded — the caller's intent is to share one journal, not all of them.

type SensitiveFileError

type SensitiveFileError struct {
	Path   string
	Reason string
}

SensitiveFileError wraps a denylist hit with the offending path.

func (*SensitiveFileError) Error

func (e *SensitiveFileError) Error() string

Jump to

Keyboard shortcuts

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