undo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 9 Imported by: 0

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