Documentation
¶
Overview ¶
Package sessionprocess tracks session-owned OS processes independently of agent lifetime.
Index ¶
- Constants
- type Identity
- type Observation
- type Owner
- type Process
- type Result
- type Service
- func (s *Service) Acquire() func()
- func (s *Service) AfterStop(sessionID string, await func(context.Context) error)
- func (s *Service) Refresh(ctx context.Context) (Snapshot, error)
- func (s *Service) Shutdown()
- func (s *Service) Summary(sessionID string) Summary
- func (s *Service) Terminate(ctx context.Context, sessionID string, targets []Identity, all bool, ...) ([]Result, error)
- type Snapshot
- type Source
- type Store
- type Summary
- type Terminal
Constants ¶
View Source
const CaptureTimeout = 2 * time.Second
CaptureTimeout bounds best-effort ownership capture before keeping descendants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observation ¶
type Observation struct {
Identity
Owner Owner
PGID int
FirstSeen time.Time
GroupObservedAt time.Time
Attribution string
KernelToken string
}
Observation deliberately has no session foreign key: deleting a session keeps its processes discoverable.
type Process ¶
type Process struct {
procutil.ScannedProcess
Owner Owner
Attribution, Kind, TerminalID string
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AfterStop ¶
AfterStop owns and joins cleanup after an accepted stop outlives its caller.
func (*Service) Terminate ¶
func (s *Service) Terminate( ctx context.Context, sessionID string, targets []Identity, all bool, allowed func(Owner) bool, ) ([]Result, error)
Terminate resolves targets only inside the caller's authorized ownership set. An empty session ID is reserved for the operator aggregate boundary.
type Source ¶
type Source interface {
Owners(context.Context) ([]Owner, error)
Owner(context.Context, string) (Owner, bool, error)
OrphanOwner(context.Context, procutil.ScannedProcess) (Owner, bool, error)
Terminals(context.Context) ([]Terminal, error)
CloseTerminal(context.Context, Process) error
ProcessesChanged(context.Context, string)
RecordTermination(context.Context, Process, Result) error
}
Click to show internal directories.
Click to hide internal directories.