Documentation
¶
Index ¶
- Constants
- Variables
- func EffectiveMaxBatch(flagChanged bool, configured int, dryRun bool) int
- func EffectiveMaxBatchWithDefaults(flagChanged bool, configured int, dryRun bool, realDefault, dryRunDefault int) int
- func IsPreviewNoiseText(v string) bool
- func ParsePreviewLine(line string) (role string, text string)
- type AuditSink
- type DeleteActionInput
- type DeleteActionResult
- type DeleteCandidatesInput
- type DeleteCandidatesResult
- type DeleteExecutor
- type DoctorCheck
- type DoctorHostPathInput
- type DoctorLevel
- type DoctorRiskInput
- type DoctorRiskReport
- type DoctorRiskSample
- type GroupInput
- type GroupStat
- type ListInput
- type ListResult
- type LoadTUISessionsInput
- type LoadTUISessionsResult
- type PreviewMessage
- type RestoreActionInput
- type RestoreActionResult
- type RestoreCandidatesInput
- type RestoreCandidatesResult
- type RestoreExecutor
- type RestoreSummary
- type SessionDeleteExecutor
- type SessionRestoreExecutor
Constants ¶
View Source
const ( DefaultMaxBatchTUIReal = 100 DefaultMaxBatchTUIDryRun = 1000 )
View Source
const ( DefaultMaxBatchReal = 50 DefaultMaxBatchDryRun = 500 )
View Source
const (
DefaultPreviewMaxMessages = 600
)
Variables ¶
View Source
var ErrPreviewEntryTooLong = errors.New("preview entry exceeds max line size")
Functions ¶
func IsPreviewNoiseText ¶
func ParsePreviewLine ¶
Types ¶
type AuditSink ¶
type AuditSink interface {
NewBatchID() (string, error)
WriteActionLog(logFile string, rec audit.ActionRecord) error
}
AuditSink appends action records and can allocate operation batch IDs.
type DeleteActionInput ¶
type DeleteActionInput struct {
Candidates []session.Session
Selector session.Selector
DryRun bool
Confirm bool
Yes bool
Hard bool
SessionsRoot string
TrashRoot string
MaxBatch int
MaxBatchChanged bool
RealDefault int
DryRunDefault int
Executor DeleteExecutor
LogFile string
AuditSink AuditSink
Now time.Time
}
type DeleteActionResult ¶
type DeleteActionResult struct {
Summary session.DeleteSummary
AppliedMaxBatch int
BatchID string
LogError error
}
func RunDeleteAction ¶
func RunDeleteAction(in DeleteActionInput) (DeleteActionResult, error)
type DeleteCandidatesInput ¶
type DeleteCandidatesResult ¶
func SelectDeleteCandidates ¶
func SelectDeleteCandidates(in DeleteCandidatesInput) (DeleteCandidatesResult, error)
type DeleteExecutor ¶
type DeleteExecutor interface {
Execute(candidates []session.Session, sel session.Selector, opts session.DeleteOptions) (session.DeleteSummary, error)
}
DeleteExecutor executes delete workflow over selected sessions.
type DoctorCheck ¶
type DoctorCheck struct {
Name string
Level DoctorLevel
Detail string
}
func CheckSessionHostPaths ¶
func CheckSessionHostPaths(in DoctorHostPathInput) DoctorCheck
type DoctorHostPathInput ¶
type DoctorLevel ¶
type DoctorLevel string
const ( DoctorPass DoctorLevel = "PASS" DoctorWarn DoctorLevel = "WARN" DoctorFail DoctorLevel = "FAIL" )
type DoctorRiskInput ¶
type DoctorRiskInput struct {
SessionsRoot string
SampleLimit int
IntegrityCheck bool
Repository core.SessionRepository
Evaluator core.RiskEvaluator
}
type DoctorRiskReport ¶
type DoctorRiskReport struct {
SessionsTotal int `json:"sessions_total"`
RiskTotal int `json:"risk_total"`
RiskRate float64 `json:"risk_rate"`
High int `json:"high"`
Medium int `json:"medium"`
IntegrityCheck bool `json:"integrity_check"`
SampleLimit int `json:"sample_limit"`
Samples []DoctorRiskSample `json:"samples"`
}
func DoctorRisk ¶
func DoctorRisk(in DoctorRiskInput) (DoctorRiskReport, error)
type DoctorRiskSample ¶
type GroupInput ¶
type GroupStat ¶
type GroupStat struct {
Group string `json:"group"`
Count int `json:"count"`
SizeBytes int64 `json:"size_bytes"`
Latest string `json:"latest"`
}
func BuildGroupStats ¶
func GroupSessions ¶
func GroupSessions(in GroupInput) ([]GroupStat, error)
type ListResult ¶
func ListSessions ¶
func ListSessions(in ListInput) (ListResult, error)
type LoadTUISessionsInput ¶
type LoadTUISessionsInput struct {
SessionsRoot string
ScanLimit int
ViewLimit int
Now time.Time
Repository core.SessionRepository
Evaluator core.RiskEvaluator
}
LoadTUISessionsInput describes TUI session-loading constraints.
type LoadTUISessionsResult ¶
LoadTUISessionsResult is the normalized TUI session set.
func LoadTUISessions ¶
func LoadTUISessions(in LoadTUISessionsInput) (LoadTUISessionsResult, error)
LoadTUISessions loads sessions for TUI and applies risk-first ordering.
type PreviewMessage ¶
func ExtractPreviewMessages ¶
func ExtractPreviewMessages(path string, maxMessages int) ([]PreviewMessage, error)
type RestoreActionInput ¶
type RestoreActionInput struct {
Candidates []session.Session
Selector session.Selector
DryRun bool
Confirm bool
Yes bool
SessionsRoot string
TrashSessionsRoot string
MaxBatch int
MaxBatchChanged bool
RealDefault int
DryRunDefault int
AllowEmptySelector bool
Executor RestoreExecutor
LogFile string
AuditSink AuditSink
Now time.Time
}
type RestoreActionResult ¶
type RestoreActionResult struct {
Summary RestoreSummary
AppliedMaxBatch int
BatchID string
LogError error
}
func RunRestoreAction ¶
func RunRestoreAction(in RestoreActionInput) (RestoreActionResult, error)
type RestoreCandidatesInput ¶
type RestoreCandidatesResult ¶
func SelectRestoreCandidates ¶
func SelectRestoreCandidates(in RestoreCandidatesInput) (RestoreCandidatesResult, error)
type RestoreExecutor ¶
type RestoreExecutor interface {
Execute(candidates []session.Session, sel session.Selector, opts session.RestoreOptions) (session.RestoreSummary, error)
}
RestoreExecutor executes restore workflow over selected sessions.
type RestoreSummary ¶
type RestoreSummary = session.RestoreSummary
RestoreSummary is restore execution summary.
type SessionDeleteExecutor ¶
type SessionDeleteExecutor struct{}
SessionDeleteExecutor is the default delete executor.
func (SessionDeleteExecutor) Execute ¶
func (SessionDeleteExecutor) Execute(candidates []session.Session, sel session.Selector, opts session.DeleteOptions) (session.DeleteSummary, error)
Execute runs the session delete operation.
type SessionRestoreExecutor ¶
type SessionRestoreExecutor struct{}
SessionRestoreExecutor is the default restore executor.
func (SessionRestoreExecutor) Execute ¶
func (SessionRestoreExecutor) Execute(candidates []session.Session, sel session.Selector, opts session.RestoreOptions) (session.RestoreSummary, error)
Execute runs the restore operation.
Click to show internal directories.
Click to hide internal directories.