snapshot

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package snapshot stores recovery snapshots. The Bootstrap defines what a snapshot contains; this package only keeps the document, outside the project, so that it survives `gtt clean`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(projectRoot string) string

Key identifies a project by its absolute path.

Types

type Info

type Info struct {
	Dir      string `json:"dir"`
	Snapshot string `json:"snapshot"` // path of the Bootstrap snapshot document
	Meta     Meta   `json:"meta"`
	// Summary fields read from the Bootstrap document for display only.
	BootstrapVersion string   `json:"bootstrap_version"`
	Primary          string   `json:"primary_ade"`
	Participating    []string `json:"participating"`
	Profile          string   `json:"methodology_profile"`
	Language         string   `json:"language"`
}

Info describes one stored snapshot.

func Read

func Read(dir string) (Info, error)

Read loads one snapshot directory.

func ReadFile

func ReadFile(path string) (Info, error)

ReadFile loads a snapshot given directly as a file (portable recovery).

type Meta

type Meta struct {
	Schema            int    `json:"schema"`
	ProjectRoot       string `json:"project_root"`
	CreatedAt         string `json:"created_at"`
	CLIVersion        string `json:"cli_version"`
	BootstrapOrigin   string `json:"bootstrap_origin,omitempty"`
	BootstrapChecksum string `json:"bootstrap_checksum,omitempty"`
	Reason            string `json:"reason"`
}

Meta is the CLI's own record around a Bootstrap snapshot.

type Store

type Store struct{ Home string }

Store keeps snapshots under the user-level GTT home.

func (Store) List

func (s Store) List(projectRoot string) []Info

List returns the snapshots of a project, newest first.

func (Store) Save

func (s Store) Save(projectRoot string, document []byte, meta Meta) (Info, error)

Save stores a Bootstrap snapshot document verbatim plus the CLI metadata.

Jump to

Keyboard shortcuts

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