Documentation
¶
Index ¶
- func CompactHomePath(path, home string) string
- func FormatBytesIEC(size int64) string
- func FormatDisplayTime(t time.Time) string
- func ShortID(id string) string
- func SortSessionsByRisk(items []session.Session, evaluator RiskEvaluator, ...)
- type QueryResult
- type QuerySpec
- type RiskEvaluator
- type SessionRepository
- type SortField
- type SortOrder
- type SortSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompactHomePath ¶
CompactHomePath replaces home prefix with "~" when possible.
func FormatBytesIEC ¶
FormatBytesIEC formats byte counts using IEC units.
func FormatDisplayTime ¶
FormatDisplayTime formats timestamps for human-readable table output.
func SortSessionsByRisk ¶
func SortSessionsByRisk(items []session.Session, evaluator RiskEvaluator, checker session.IntegrityChecker)
SortSessionsByRisk applies risk-priority ordering: risk desc, updated_at desc, session_id asc.
Types ¶
type QueryResult ¶
func QuerySessions ¶
func QuerySessions(repo SessionRepository, root string, spec QuerySpec) (QueryResult, error)
QuerySessions scans root via repo, applies selector, then performs normalized sorting and pagination.
type QuerySpec ¶
type QuerySpec struct {
Selector session.Selector
Offset int
Limit int
Sort SortSpec
// Legacy string fields are accepted for CLI-facing compatibility and
// normalized into Sort when Sort is not provided.
SortBy string
Order string
Now time.Time
}
QuerySpec describes shared session-query constraints used by usecases.
type RiskEvaluator ¶
RiskEvaluator evaluates one session and returns the highest-priority risk.
type SessionRepository ¶
SessionRepository provides access to raw session rows.
Click to show internal directories.
Click to hide internal directories.