bundle

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateZip

func CreateZip(path string, files []ZipFile) error

CreateZip creates a ZIP archive at the given path with the given files.

func GenerateAll

func GenerateAll(p *project.Project, cfg Config) error

GenerateAll creates bundles for all friends in the project.

func GenerateBundle

func GenerateBundle(params BundleParams) error

GenerateBundle creates a single bundle ZIP file for one friend.

func GenerateReadme

func GenerateReadme(data ReadmeData) string

GenerateReadme creates the README.txt content with all embedded information.

func VerifyBundle

func VerifyBundle(bundlePath string) error

VerifyBundle verifies the integrity of a bundle ZIP file. Returns nil if valid, or an error describing the problem.

Types

type BundleParams

type BundleParams struct {
	OutputPath       string
	ProjectName      string
	Friend           project.Friend
	Share            *core.Share
	OtherFriends     []project.Friend
	Threshold        int
	Total            int
	ManifestData     []byte
	ManifestChecksum string
	ManifestEmbedded bool // true when manifest is base64-embedded in recover.html
	RecoverHTML      string
	RecoverChecksum  string
	Version          string
	GitHubReleaseURL string
	SealedAt         time.Time
	Anonymous        bool
	RecoveryURL      string
	Language         string // Bundle language for this friend
}

BundleParams contains all parameters for generating a single bundle.

type Config

type Config struct {
	Version          string // Tool version (e.g., "v1.0.0")
	GitHubReleaseURL string // URL to GitHub release for CLI download
	WASMBytes        []byte // Compiled recover.wasm binary
	RecoveryURL      string // Optional: base URL for QR code (e.g. "https://example.com/recover.html")
	NoEmbedManifest  bool   // If true, do not embed MANIFEST.age in recover.html even when small enough
}

Config holds configuration for bundle generation.

type ReadmeData

type ReadmeData struct {
	ProjectName      string
	Holder           string
	Share            *core.Share
	OtherFriends     []project.Friend
	Threshold        int
	Total            int
	Version          string
	GitHubReleaseURL string
	ManifestChecksum string
	RecoverChecksum  string
	Created          time.Time
	Anonymous        bool
	Language         string // Bundle language (e.g. "en", "es"); defaults to "en"
	ManifestEmbedded bool   // true when manifest is embedded in recover.html
}

ReadmeData contains all data needed to generate README.txt

type ZipFile

type ZipFile struct {
	Name    string
	Content []byte
	ModTime time.Time
}

ZipFile represents a file to be added to a ZIP archive.

Jump to

Keyboard shortcuts

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