Help us shape the future of Go! Take the 2026 Go Developer Survey

manifest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeSHA256

func ComputeSHA256(filePath string) (string, error)

ComputeSHA256 calculates SHA256 hash of a file

func ManifestPath

func ManifestPath(backupDir, project string) string

Types

type BackupEntry

type BackupEntry struct {
	File      string    `json:"file"`
	SHA256    string    `json:"sha256"`
	SizeBytes int64     `json:"size_bytes"`
	CreatedAt time.Time `json:"created_at"`
	GitHead   string    `json:"git_head,omitempty"`
	FileCount int       `json:"file_count"`
	Excluded  []string  `json:"excluded"`
}

type Manifest

type Manifest struct {
	Project string        `json:"project"`
	Source  string        `json:"source"`
	Backups []BackupEntry `json:"backups"`
}

func Load

func Load(backupDir, project string) (*Manifest, error)

func (*Manifest) AddBackup

func (m *Manifest) AddBackup(entry BackupEntry)

func (*Manifest) LatestBackup

func (m *Manifest) LatestBackup() *BackupEntry

func (*Manifest) Prune

func (m *Manifest) Prune(backupDir string, keepLast int) ([]string, error)

Prune removes old backups exceeding keepLast limit Returns list of deleted files and any error

func (*Manifest) Save

func (m *Manifest) Save(backupDir string) error

Jump to

Keyboard shortcuts

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