undo

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT 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 undo records reversible file edits and applies rollbacks.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoUndo = errors.New("no undo records available")

Functions

This section is empty.

Types

type Record

type Record struct {
	ID      string    `json:"id"`
	Time    time.Time `json:"time"`
	Tool    string    `json:"tool"`
	Path    string    `json:"path"`
	Existed bool      `json:"existed"`
	Content string    `json:"content_base64,omitempty"`
}

func Push

func Push(workspace, tool, targetPath string, existed bool, content []byte) (Record, error)

type RestoreReport

type RestoreReport struct {
	Kind      string `json:"kind"`
	Action    string `json:"action"`
	Status    string `json:"status"`
	ID        string `json:"id"`
	Tool      string `json:"tool"`
	Path      string `json:"path"`
	Restored  bool   `json:"restored"`
	Removed   bool   `json:"removed"`
	Bytes     int    `json:"bytes"`
	Remaining int    `json:"remaining"`
}

func RestoreLast

func RestoreLast(workspace string) (RestoreReport, error)

Jump to

Keyboard shortcuts

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