Documentation
¶
Index ¶
- type BeginOptions
- type FileChange
- type FileTarget
- type OpType
- type Operation
- type Status
- type Store
- func (s *Store) Abort(ctx context.Context, op *Operation, reason string) error
- func (s *Store) AbortAndRestore(ctx context.Context, op *Operation, reason string, writableRoots ...string) error
- func (s *Store) Begin(ctx context.Context, opts BeginOptions, targets []FileTarget) (*Operation, error)
- func (s *Store) Commit(ctx context.Context, op *Operation) error
- func (s *Store) ListRecent(ctx context.Context, workspace string, limit int) ([]Operation, error)
- func (s *Store) Rollback(ctx context.Context, workspace, operationID string, writableRoots ...string) (*Operation, error)
- func (s *Store) RollbackLast(ctx context.Context, workspace string, writableRoots ...string) (*Operation, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeginOptions ¶
type FileChange ¶
type FileChange struct {
Path string `json:"path"`
AbsPath string `json:"abs_path,omitempty"`
NewPath string `json:"new_path,omitempty"`
NewAbsPath string `json:"new_abs_path,omitempty"`
OpType OpType `json:"op_type"`
FileAbsentBefore bool `json:"file_absent_before,omitempty"`
FileAbsentAfter bool `json:"file_absent_after,omitempty"`
BeforeHash string `json:"before_hash,omitempty"`
AfterHash string `json:"after_hash,omitempty"`
BeforeSnapshot string `json:"before_snapshot,omitempty"`
SizeBytes int64 `json:"size_bytes,omitempty"`
}
type FileTarget ¶
type Operation ¶
type Operation struct {
OperationID string `json:"operation_id"`
SessionID string `json:"session_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
TraceID string `json:"trace_id,omitempty"`
Workspace string `json:"workspace"`
ToolName string `json:"tool_name"`
Actor string `json:"actor,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Status Status `json:"status"`
AffectedFiles []FileChange `json:"affected_files"`
RollbackAttempts int `json:"rollback_attempts"`
LastError string `json:"last_error,omitempty"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewDefaultStore ¶
func (*Store) AbortAndRestore ¶
func (*Store) Begin ¶
func (s *Store) Begin(ctx context.Context, opts BeginOptions, targets []FileTarget) (*Operation, error)
func (*Store) ListRecent ¶
Click to show internal directories.
Click to hide internal directories.