Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateCategory ¶
ValidateCategory checks if the feedback category is valid.
func ValidateMessage ¶
ValidateMessage checks if the feedback message meets length requirements.
Types ¶
type FeedbackContext ¶
type FeedbackContext struct {
Version string `json:"version"`
Edition string `json:"edition"`
OS string `json:"os"`
Arch string `json:"arch"`
ServerCount int `json:"server_count"`
ConnectedServerCount int `json:"connected_server_count"`
RoutingMode string `json:"routing_mode"`
}
FeedbackContext provides automatic system context alongside feedback.
type FeedbackRequest ¶
type FeedbackRequest struct {
Category string `json:"category"` // bug, feature, other
Message string `json:"message"`
Email string `json:"email,omitempty"`
Context FeedbackContext `json:"context"`
}
FeedbackRequest is the user-submitted feedback payload.
type FeedbackResponse ¶
type FeedbackResponse struct {
Success bool `json:"success"`
IssueURL string `json:"issue_url,omitempty"`
Error string `json:"error,omitempty"`
}
FeedbackResponse is the response from the telemetry backend.
type HeartbeatPayload ¶
type HeartbeatPayload struct {
AnonymousID string `json:"anonymous_id"`
Version string `json:"version"`
Edition string `json:"edition"`
OS string `json:"os"`
Arch string `json:"arch"`
GoVersion string `json:"go_version"`
ServerCount int `json:"server_count"`
ConnectedServerCount int `json:"connected_server_count"`
ToolCount int `json:"tool_count"`
UptimeHours int `json:"uptime_hours"`
RoutingMode string `json:"routing_mode"`
QuarantineEnabled bool `json:"quarantine_enabled"`
Timestamp string `json:"timestamp"`
}
HeartbeatPayload is the anonymous telemetry payload sent periodically.
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter enforces a maximum number of requests per hour.
func NewRateLimiter ¶
func NewRateLimiter(maxPerHour int) *RateLimiter
NewRateLimiter creates a rate limiter with the given max requests per hour.
func (*RateLimiter) Allow ¶
func (rl *RateLimiter) Allow() bool
Allow returns true if the request is within the rate limit.
type RuntimeStats ¶
type RuntimeStats interface {
GetServerCount() int
GetConnectedServerCount() int
GetToolCount() int
GetRoutingMode() string
IsQuarantineEnabled() bool
}
RuntimeStats is an interface to decouple from the runtime package.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages anonymous telemetry heartbeats and feedback submission.
func (*Service) SetRuntimeStats ¶
func (s *Service) SetRuntimeStats(stats RuntimeStats)
SetRuntimeStats sets the runtime stats provider (called after runtime is fully initialized).
func (*Service) Start ¶
Start begins the telemetry heartbeat loop. This is a blocking call; run in a goroutine.
func (*Service) SubmitFeedback ¶
func (s *Service) SubmitFeedback(ctx context.Context, req *FeedbackRequest) (*FeedbackResponse, error)
SubmitFeedback sends feedback to the telemetry backend.