Documentation
¶
Index ¶
Constants ¶
const ( // DefaultTimeout is the default HTTP client timeout for Slack webhook requests DefaultTimeout = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnalysisResult ¶
type AnalysisResult struct {
Status string `json:"status"`
Content string `json:"content"`
Metadata map[string]any `json:"metadata,omitempty"`
Error string `json:"error,omitempty"`
Prompt string `json:"prompt,omitempty"`
}
AnalysisResult represents the analysis output passed to reporters.
type ArtifactLink ¶
ArtifactLink represents a single uploaded artifact with its presigned URL.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides methods for interacting with Slack webhooks
func NewClient ¶
func NewClient() *Client
NewClient creates a new Slack client with default settings
func NewClientWithTimeout ¶
NewClientWithTimeout creates a new Slack client with a custom timeout
func (*Client) SendMessage ¶
SendMessage is a convenience method to send a simple text message to Slack
type ClusterInfo ¶
type ClusterInfo struct {
ID string
Name string
Provider string
Region string
CloudProvider string
Version string
Expiration string
}
ClusterInfo holds cluster information for reporting
type NotificationConfig ¶
type NotificationConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Reporters []ReporterConfig `json:"reporters" yaml:"reporters"`
}
NotificationConfig holds configuration for notification settings
func BuildNotificationConfig ¶
func BuildNotificationConfig(webhook string, channel string, clusterInfo interface{}, reportDir string) *NotificationConfig
BuildNotificationConfig creates notification configuration for log analysis.
type ReporterConfig ¶
type ReporterConfig struct {
Type string `json:"type" yaml:"type"`
Enabled bool `json:"enabled" yaml:"enabled"`
Settings map[string]interface{} `json:"settings" yaml:"settings"`
}
ReporterConfig holds configuration for different reporter implementations
func SlackReporterConfig ¶
func SlackReporterConfig(webhookURL string, enabled bool) ReporterConfig
SlackReporterConfig creates a reporter config for Slack
type SlackReporter ¶
type SlackReporter struct {
// contains filtered or unexported fields
}
SlackReporter implements Reporter interface for Slack webhook notifications
func NewSlackReporter ¶
func NewSlackReporter() *SlackReporter
NewSlackReporter creates a new Slack reporter
func (*SlackReporter) Name ¶
func (s *SlackReporter) Name() string
Name returns the reporter identifier
func (*SlackReporter) Report ¶
func (s *SlackReporter) Report(ctx context.Context, result *AnalysisResult, config *ReporterConfig) error
Report sends the analysis result to Slack via webhook
type WorkflowPayload ¶
type WorkflowPayload struct {
Channel string `json:"channel"`
Summary string `json:"summary"`
Analysis string `json:"analysis"`
ExtendedLogs string `json:"extended_logs,omitempty"`
ClusterDetails string `json:"cluster_details,omitempty"`
Image string `json:"image,omitempty"`
Env string `json:"env,omitempty"`
Commit string `json:"commit,omitempty"`
TektonURL string `json:"tekton_url,omitempty"`
RepoLink string `json:"repo_link"`
LogLink string `json:"log_link"`
JunitXMLLink string `json:"junit_xml_link"`
}
WorkflowPayload represents the Slack workflow webhook payload