ddsync

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package ddsync implements deterministic snapshot compilation and verification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveLatestStableTag

func ResolveLatestStableTag(upstreamRepo string) (string, error)

ResolveLatestStableTag returns the highest stable semver tag from upstream.

func SyncSnapshotFromUpstream

func SyncSnapshotFromUpstream(cfg Config) error

SyncSnapshotFromUpstream refreshes snapshot inputs from the resolved upstream version.

func Verify

func Verify(cfg Config) error

Verify validates snapshot sources and output against the manifest.

Types

type CompiledFile

type CompiledFile struct {
	Path    string `json:"path"`
	SHA256  string `json:"sha256"`
	Content string `json:"content"`
}

CompiledFile is the deterministic artifact entry for a source file.

type CompiledSnapshot

type CompiledSnapshot struct {
	Files []CompiledFile `json:"files"`
}

CompiledSnapshot is the generated artifact consumed by parsers.

type Config

type Config struct {
	UpstreamRepo    string
	UpstreamVersion string
	SnapshotDir     string
	OutputPath      string
	ManifestPath    string
}

Config controls input/output locations for the sync pipeline.

type Manifest

type Manifest struct {
	UpstreamRepo    string       `json:"upstream_repo"`
	UpstreamVersion string       `json:"upstream_version"`
	SourceDir       string       `json:"source_dir"`
	SourceFiles     []SourceFile `json:"source_files"`
	OutputPath      string       `json:"output_path"`
	OutputSHA256    string       `json:"output_sha256"`
}

Manifest tracks source metadata and the expected output hash.

func Update

func Update(cfg Config) (Manifest, error)

Update compiles snapshot inputs into deterministic output + manifest.

type SourceFile

type SourceFile struct {
	Path   string `json:"path"`
	SHA256 string `json:"sha256"`
	Size   int64  `json:"size"`
}

SourceFile describes metadata about one input snapshot file.

type StatusReport

type StatusReport struct {
	Clean  bool
	Issues []string
}

StatusReport describes snapshot/artifact consistency.

func Status

func Status(cfg Config) (StatusReport, error)

Status checks whether current files match manifest expectations.

Jump to

Keyboard shortcuts

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