Documentation
¶
Index ¶
- type HostedAgent
- func (a *HostedAgent) Analyze(ctx context.Context, data []byte, analyzers []analyzer.AnalyzerSpec) (*analyzer.AgentResult, error)
- func (a *HostedAgent) Capabilities() []string
- func (a *HostedAgent) GetEndpoint() string
- func (a *HostedAgent) GetStats() HostedAgentStats
- func (a *HostedAgent) HealthCheck(ctx context.Context) error
- func (a *HostedAgent) IsAvailable() bool
- func (a *HostedAgent) Name() string
- func (a *HostedAgent) SetEnabled(enabled bool)
- func (a *HostedAgent) Stop()
- func (a *HostedAgent) UpdateCredentials(apiKey string) error
- type HostedAgentOptions
- type HostedAgentStats
- type HostedAnalysisOptions
- type HostedAnalysisRequest
- type HostedAnalysisResponse
- type HostedResponseMetadata
- type RateLimiter
- type RequestMetadata
- type RetryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostedAgent ¶
type HostedAgent struct {
// contains filtered or unexported fields
}
HostedAgent implements the Agent interface for remote analysis services
func NewHostedAgent ¶
func NewHostedAgent(opts *HostedAgentOptions) (*HostedAgent, error)
NewHostedAgent creates a new hosted analysis agent
func (*HostedAgent) Analyze ¶
func (a *HostedAgent) Analyze(ctx context.Context, data []byte, analyzers []analyzer.AnalyzerSpec) (*analyzer.AgentResult, error)
Analyze performs analysis using the hosted service
func (*HostedAgent) Capabilities ¶
func (a *HostedAgent) Capabilities() []string
Capabilities returns the agent's capabilities
func (*HostedAgent) GetEndpoint ¶
func (a *HostedAgent) GetEndpoint() string
GetEndpoint returns the current endpoint URL
func (*HostedAgent) GetStats ¶
func (a *HostedAgent) GetStats() HostedAgentStats
GetStats returns usage statistics for the hosted agent
func (*HostedAgent) HealthCheck ¶
func (a *HostedAgent) HealthCheck(ctx context.Context) error
HealthCheck verifies the hosted service is accessible and functioning
func (*HostedAgent) IsAvailable ¶
func (a *HostedAgent) IsAvailable() bool
IsAvailable checks if the hosted service is available
func (*HostedAgent) SetEnabled ¶
func (a *HostedAgent) SetEnabled(enabled bool)
SetEnabled enables or disables the hosted agent
func (*HostedAgent) Stop ¶
func (a *HostedAgent) Stop()
Stop cleanly shuts down the hosted agent and stops background goroutines
func (*HostedAgent) UpdateCredentials ¶
func (a *HostedAgent) UpdateCredentials(apiKey string) error
UpdateCredentials updates the API key for authentication
type HostedAgentOptions ¶
type HostedAgentOptions struct {
Endpoint string
APIKey string
Timeout time.Duration
MaxRetries int
RateLimit int // requests per minute
InsecureSkipVerify bool
CustomHeaders map[string]string
}
HostedAgentOptions configures the hosted agent
type HostedAgentStats ¶
type HostedAgentStats struct {
Enabled bool `json:"enabled"`
Endpoint string `json:"endpoint"`
Version string `json:"version"`
Capabilities int `json:"capabilities"`
RequestsThisHour int64 `json:"requestsThisHour,omitempty"`
SuccessRate float64 `json:"successRate,omitempty"`
AverageLatency string `json:"averageLatency,omitempty"`
}
HostedAgentStats provides usage statistics
type HostedAnalysisOptions ¶
type HostedAnalysisOptions struct {
IncludeRemediation bool `json:"includeRemediation"`
AnalysisTypes []string `json:"analysisTypes,omitempty"`
Priority string `json:"priority,omitempty"`
Timeout int `json:"timeout,omitempty"`
}
HostedAnalysisOptions configures the analysis request
type HostedAnalysisRequest ¶
type HostedAnalysisRequest struct {
BundleData []byte `json:"bundleData"`
Analyzers []analyzer.AnalyzerSpec `json:"analyzers"`
Options HostedAnalysisOptions `json:"options"`
Metadata RequestMetadata `json:"metadata"`
}
HostedAnalysisRequest represents the request payload for hosted analysis
type HostedAnalysisResponse ¶
type HostedAnalysisResponse struct {
Results []*analyzer.AnalyzerResult `json:"results"`
Metadata HostedResponseMetadata `json:"metadata"`
Errors []string `json:"errors,omitempty"`
Status string `json:"status"`
RequestID string `json:"requestId"`
}
HostedAnalysisResponse represents the response from hosted analysis
type HostedResponseMetadata ¶
type HostedResponseMetadata struct {
Duration time.Duration `json:"duration"`
AnalyzerCount int `json:"analyzerCount"`
ServiceVersion string `json:"serviceVersion"`
ModelVersion string `json:"modelVersion,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
}
HostedResponseMetadata provides analysis metadata from the service
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter manages API rate limiting
func NewRateLimiter ¶
func NewRateLimiter(requestsPerMinute int) *RateLimiter
NewRateLimiter creates a new rate limiter
func (*RateLimiter) Stop ¶
func (rl *RateLimiter) Stop()
Stop cleanly shuts down the rate limiter and stops the replenishment goroutine