Documentation
¶
Index ¶
- func EndSession() error
- func GetLogPath() (string, error)
- func Initialize(enabled bool, retentionDays int)
- func LogCreateDir(dirPath string, success bool, err error)
- func LogDelete(path string, success bool, err error)
- func LogLink(sourcePath, destPath string, success bool, err error)
- func LogOperation(opType OperationType, sourcePath, destPath string, success bool, err error)
- func LogRename(sourcePath, destPath string, success bool, err error)
- func StartSession(command string, args []string) error
- func UndoSession(session *LogSession) (successful int, failed int, errors []error)
- func WriteSession(session *LogSession) error
- type LogSession
- type OperationLog
- type OperationType
- type SessionMetadata
- type SessionSummary
- type UndoResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogPath ¶
func Initialize ¶
Initialize sets up the logging system with the given configuration
func LogCreateDir ¶
LogCreateDir logs a directory creation
func LogOperation ¶
func LogOperation(opType OperationType, sourcePath, destPath string, success bool, err error)
LogOperation logs a generic operation to the current session
func StartSession ¶
StartSession initializes a new logging session
func UndoSession ¶
func UndoSession(session *LogSession) (successful int, failed int, errors []error)
func WriteSession ¶
func WriteSession(session *LogSession) error
Types ¶
type LogSession ¶
type LogSession struct {
Metadata SessionMetadata `json:"metadata"`
Operations []OperationLog `json:"operations"`
}
func FindLatestSession ¶
func FindLatestSession() (*LogSession, string, error)
func ReadSession ¶
func ReadSession(logPath string) (*LogSession, error)
func ReadSessions ¶
func ReadSessions(limit int) ([]*LogSession, error)
type OperationLog ¶
type OperationType ¶
type OperationType string
const ( OpRename OperationType = "rename" OpLink OperationType = "link" OpDelete OperationType = "delete" OpCreateDir OperationType = "create_dir" )
type SessionMetadata ¶
type SessionMetadata struct {
CommandArgs []string `json:"command_args"`
WorkingDir string `json:"working_dir"`
Timestamp time.Time `json:"timestamp"`
SessionID string `json:"session_id"`
TotalOps int `json:"total_operations"`
SuccessfulOps int `json:"successful_operations"`
FailedOps int `json:"failed_operations"`
}
type SessionSummary ¶
type SessionSummary struct {
Session *LogSession
FilePath string
RelativeTime string
Icon string
}
func GetSessionSummaries ¶
func GetSessionSummaries() ([]SessionSummary, error)
type UndoResult ¶
type UndoResult struct {
Operation OperationLog
Success bool
Error error
}
func UndoOperation ¶
func UndoOperation(op OperationLog) UndoResult
Click to show internal directories.
Click to hide internal directories.