Documentation
¶
Overview ¶
Package client provides an HTTP client for communicating with the AgentsAegis dashboard API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client communicates with the AgentsAegis dashboard API.
func (*Client) FetchConfig ¶
FetchConfig fetches the org trap configuration from the dashboard API. This also validates the token (same endpoint).
func (*Client) FetchPersonalStats ¶
func (c *Client) FetchPersonalStats(ctx context.Context) (*PersonalStats, error)
FetchPersonalStats retrieves the developer's personal trap statistics.
func (*Client) ReportEvent ¶
ReportEvent sends a trap event to the dashboard API.
type OrgConfig ¶
type OrgConfig struct {
TrapFrequency int `json:"trap_frequency"`
MaxTrapsPerDay int `json:"max_traps_per_day"`
TrapCategories []string `json:"trap_categories"`
Difficulty string `json:"difficulty"`
}
OrgConfig holds the trap configuration fetched from the dashboard.
type PersonalStats ¶
type PersonalStats struct {
CatchRate string `json:"catch_rate"`
TotalTraps int `json:"total_traps"`
Caught int `json:"caught"`
Missed int `json:"missed"`
RecentTraps []RecentTrapInfo `json:"recent_traps"`
}
PersonalStats holds a developer's personal trap statistics.
type RecentTrapInfo ¶
type RecentTrapInfo struct {
Category string `json:"category"`
Result string `json:"result"`
Date string `json:"date"`
}
RecentTrapInfo holds summary info about a single trap event.
type TrapEvent ¶
type TrapEvent struct {
TrapTemplateID string `json:"trap_template_id"`
TrapCategory string `json:"trap_category"`
TrapSeverity string `json:"trap_severity"`
TrapCommand string `json:"trap_command"`
OriginalCommand string `json:"original_command"`
Result string `json:"result"`
ResponseTimeMs int `json:"response_time_ms"`
SessionID string `json:"session_id"`
}
TrapEvent represents a trap result to report to the dashboard.