Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAlreadyRunning = errors.New("observer is already running")
)
Functions ¶
This section is empty.
Types ¶
type CatalogEntry ¶
type CatalogEntry struct {
Harness registry.Harness `json:"harness"`
SessionID string `json:"session_id,omitempty"`
SessionPath string `json:"session_path,omitempty"`
ResumeCommand []string `json:"resume_command,omitempty"`
CWD string `json:"cwd,omitempty"`
ProjectRoot string `json:"project_root,omitempty"`
ProcessPID int `json:"process_pid,omitempty"`
Current bool `json:"current"`
}
func DefaultCatalogList ¶
func DefaultCatalogList(ctx context.Context) ([]CatalogEntry, error)
DefaultCatalogList reads the optional machine-readable catalog configured by AHT_CATALOG_JSON or AHT_CATALOG_FILE. The payload is either an array of catalog entries or an object with a sessions array.
type CatalogLister ¶
type CatalogLister func(context.Context) ([]CatalogEntry, error)
type Health ¶
type Health struct {
PID int `json:"pid"`
StartIdentity string `json:"start_identity,omitempty"`
Interval time.Duration `json:"interval"`
GracePeriod time.Duration `json:"grace_period"`
StartedAt time.Time `json:"started_at"`
LastAttemptAt time.Time `json:"last_attempt_at"`
LastSuccessAt time.Time `json:"last_success_at"`
LastEnumerationErrorCategory string `json:"last_enumeration_error_category,omitempty"`
LastEnumerationError string `json:"last_enumeration_error,omitempty"`
Cycles int `json:"cycles"`
Observations int `json:"observations"`
Sessions int `json:"sessions"`
Degraded bool `json:"degraded"`
}
type Options ¶
type Options struct {
Store registry.Store
StorePath string
Interval time.Duration
GracePeriod time.Duration
HealthPath string
ProcessList ProcessLister
PaneList muxctx.PaneLister
CatalogList CatalogLister
ScreenCapture muxctx.ScreenCapturer
DetectionConfigDir string
Now func() time.Time
ErrorWriter io.Writer
Quiet bool
}
type ProcessLister ¶
type ProcessLister func(context.Context) ([]processinfo.Process, error)
type Result ¶
type Result struct {
ObservedAt time.Time `json:"observed_at"`
Observations int `json:"observations"`
Sessions int `json:"sessions"`
Processes int `json:"processes"`
Panes int `json:"panes"`
Catalog int `json:"catalog"`
Present int `json:"present"`
Gone int `json:"gone"`
Changed int `json:"changed"`
Degraded bool `json:"degraded"`
Error string `json:"error,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.