Versions in this module Expand all Collapse all v0 v0.3.1 Feb 20, 2026 Changes in this version + type InMemoryDB struct + func NewInMemoryDB() *InMemoryDB + func (db *InMemoryDB) DeleteMoveMapping(_ context.Context, channelID, correlationID string) error + func (db *InMemoryDB) DropAllData(_ context.Context) error + func (db *InMemoryDB) FindActiveChannels(_ context.Context) ([]string, error) + func (db *InMemoryDB) FindChannelProcessingState(_ context.Context, channelID string) (*ChannelProcessingState, error) + func (db *InMemoryDB) FindIssueBySlackPostID(_ context.Context, channelID, postID string) (string, json.RawMessage, error) + func (db *InMemoryDB) FindMoveMapping(_ context.Context, channelID, correlationID string) (json.RawMessage, error) + func (db *InMemoryDB) FindOpenIssueByCorrelationID(_ context.Context, channelID, correlationID string) (string, json.RawMessage, error) + func (db *InMemoryDB) Init(_ context.Context, _ bool) error + func (db *InMemoryDB) LoadOpenIssuesInChannel(_ context.Context, channelID string) (map[string]json.RawMessage, error) + func (db *InMemoryDB) MoveIssue(_ context.Context, issue Issue, sourceChannelID, targetChannelID string) error + func (db *InMemoryDB) SaveAlert(_ context.Context, alert *Alert) error + func (db *InMemoryDB) SaveChannelProcessingState(_ context.Context, state *ChannelProcessingState) error + func (db *InMemoryDB) SaveIssue(_ context.Context, issue Issue) error + func (db *InMemoryDB) SaveIssues(ctx context.Context, issues ...Issue) error + func (db *InMemoryDB) SaveMoveMapping(_ context.Context, moveMapping MoveMapping) error v0.3.0 Feb 19, 2026 Changes in this version + const MaxAuthorLength + const MaxAutoResolveSeconds + const MaxCheckboxOptionValueLength + const MaxCorrelationIDLength + const MaxEscalationCount + const MaxEscalationSlackMentionCount + const MaxFallbackTextLength + const MaxFieldCount + const MaxFieldTitleLength + const MaxFieldValueLength + const MaxFooterLength + const MaxHeaderLength + const MaxHostLength + const MaxIconEmojiLength + const MaxIgnoreIfTextContainsCount + const MaxIgnoreIfTextContainsLength + const MaxMentionLength + const MaxRouteKeyLength + const MaxSlackChannelIDLength + const MaxTextLength + const MaxTimestampAge + const MaxUsernameLength + const MaxWebhookButtonTextLength + const MaxWebhookCheckboxInputCount + const MaxWebhookCheckboxOptionCount + const MaxWebhookCheckboxOptionTextLength + const MaxWebhookConfirmationTextLength + const MaxWebhookCount + const MaxWebhookIDLength + const MaxWebhookInputDescriptionLength + const MaxWebhookInputIDLength + const MaxWebhookInputLabelLength + const MaxWebhookInputTextLength + const MaxWebhookPayloadCount + const MaxWebhookPlainTextInputCount + const MaxWebhookURLLength + const MinAutoResolveSeconds + const MinEscalationDelayDiffSeconds + const MinEscalationDelaySeconds + var IconRegex = regexp.MustCompile(fmt.Sprintf(`^:[^:]{1,%d}:$`, MaxIconEmojiLength)) + var SlackChannelIDOrNameRegex = regexp.MustCompile(fmt.Sprintf(`^[0-9a-zA-Z\-_]{1,%d}$`, MaxSlackChannelIDLength)) + var SlackMentionRegex = regexp.MustCompile(fmt.Sprintf(`^((<!here>)|(<!channel>)|(<@[^>\s]{1,%d}>))$`, MaxMentionLength)) + func SeverityIsValid(s AlertSeverity) bool + func SeverityPriority(s AlertSeverity) int + func ValidSeverities() []string + func ValidWebhookAccessLevels() []string + func ValidWebhookButtonStyles() []string + func ValidWebhookDisplayModes() []string + func WebhookAccessLevelIsValid(s WebhookAccessLevel) bool + func WebhookButtonStyleIsValid(s WebhookButtonStyle) bool + func WebhookDisplayModeIsValid(s WebhookDisplayMode) bool + type Alert struct + ArchivingDelaySeconds int + Author string + AutoResolveAsInconclusive bool + AutoResolveSeconds int + CorrelationID string + Escalation []*Escalation + FailOnRateLimitError bool + FallbackText string + Fields []*Field + Footer string + Header string + HeaderWhenResolved string + Host string + IconEmoji string + IgnoreIfTextContains []string + IssueFollowUpEnabled bool + Link string + Metadata map[string]any + NotificationDelaySeconds int + RouteKey string + Severity AlertSeverity + SlackChannelID string + Text string + TextWhenResolved string + Timestamp time.Time + Type string + Username string + Webhooks []*Webhook + func NewAlert(severity AlertSeverity) *Alert + func NewErrorAlert() *Alert + func NewInfoAlert() *Alert + func NewPanicAlert() *Alert + func NewResolvedAlert() *Alert + func NewWarningAlert() *Alert + func (a *Alert) Clean() + func (a *Alert) UniqueID() string + func (a *Alert) Validate() error + func (a *Alert) ValidateAutoResolve() error + func (a *Alert) ValidateCorrelationID() error + func (a *Alert) ValidateEscalation() error + func (a *Alert) ValidateFields() error + func (a *Alert) ValidateHeaderAndText() error + func (a *Alert) ValidateIcon() error + func (a *Alert) ValidateIgnoreIfTextContains() error + func (a *Alert) ValidateLink() error + func (a *Alert) ValidateSeverity() error + func (a *Alert) ValidateSlackChannelIDAndRouteKey() error + func (a *Alert) ValidateWebhooks() error + type AlertSeverity string + const AlertError + const AlertInfo + const AlertPanic + const AlertResolved + const AlertWarning + type ChannelProcessingState struct + ChannelID string + Created time.Time + LastChannelActivity time.Time + LastProcessed time.Time + OpenIssues int + func NewChannelProcessingState(channelID string) *ChannelProcessingState + type DB interface + DeleteMoveMapping func(ctx context.Context, channelID, correlationID string) error + DropAllData func(ctx context.Context) error + FindActiveChannels func(ctx context.Context) ([]string, error) + FindChannelProcessingState func(ctx context.Context, channelID string) (*ChannelProcessingState, error) + FindIssueBySlackPostID func(ctx context.Context, channelID, postID string) (string, json.RawMessage, error) + FindMoveMapping func(ctx context.Context, channelID, correlationID string) (json.RawMessage, error) + FindOpenIssueByCorrelationID func(ctx context.Context, channelID, correlationID string) (string, json.RawMessage, error) + Init func(ctx context.Context, skipSchemaValidation bool) error + LoadOpenIssuesInChannel func(ctx context.Context, channelID string) (map[string]json.RawMessage, error) + MoveIssue func(ctx context.Context, issue Issue, sourceChannelID, targetChannelID string) error + SaveAlert func(ctx context.Context, alert *Alert) error + SaveChannelProcessingState func(ctx context.Context, state *ChannelProcessingState) error + SaveIssue func(ctx context.Context, issue Issue) error + SaveIssues func(ctx context.Context, issues ...Issue) error + SaveMoveMapping func(ctx context.Context, moveMapping MoveMapping) error + type Escalation struct + DelaySeconds int + MoveToChannel string + Severity AlertSeverity + SlackMentions []string + type Field struct + Title string + Value string + type FifoQueueItem struct + Ack func() + Body string + MessageID string + Nack func() + ReceiveTimestamp time.Time + SlackChannelID string + type InMemoryFifoQueue struct + func NewInMemoryFifoQueue(name string, bufferSize int, writeTimeout time.Duration) *InMemoryFifoQueue + func (q *InMemoryFifoQueue) Name() string + func (q *InMemoryFifoQueue) Receive(ctx context.Context, sinkCh chan<- *FifoQueueItem) error + func (q *InMemoryFifoQueue) Send(ctx context.Context, slackChannelID, _, body string) error + type Issue interface + ChannelID func() string + CurrentPostID func() string + GetCorrelationID func() string + IsOpen func() bool + UniqueID func() string + type Logger interface + Debug func(msg string) + Debugf func(format string, args ...any) + Error func(msg string) + Errorf func(format string, args ...any) + Info func(msg string) + Infof func(format string, args ...any) + WithField func(key string, value any) Logger + WithFields func(fields map[string]any) Logger + type Metrics interface + Add func(name string, value float64, labelValues ...string) + Inc func(name string, labelValues ...string) + Observe func(name string, value float64, labelValues ...string) + RegisterCounter func(name, help string, labels ...string) + RegisterGauge func(name, help string, labels ...string) + RegisterHistogram func(name, help string, buckets []float64, labels ...string) + Set func(name string, value float64, labelValues ...string) + type MoveMapping interface + ChannelID func() string + GetCorrelationID func() string + UniqueID func() string + type NoopLogger struct + func (l *NoopLogger) Debug(msg string) + func (l *NoopLogger) Debugf(format string, args ...any) + func (l *NoopLogger) Error(msg string) + func (l *NoopLogger) Errorf(format string, args ...any) + func (l *NoopLogger) Info(msg string) + func (l *NoopLogger) Infof(format string, args ...any) + func (l *NoopLogger) WithField(key string, value any) Logger + func (l *NoopLogger) WithFields(fields map[string]any) Logger + type NoopMetrics struct + func (m *NoopMetrics) Add(_ string, _ float64, _ ...string) + func (m *NoopMetrics) Inc(_ string, _ ...string) + func (m *NoopMetrics) Observe(_ string, _ float64, _ ...string) + func (m *NoopMetrics) RegisterCounter(_, _ string, _ ...string) + func (m *NoopMetrics) RegisterGauge(_, _ string, _ ...string) + func (m *NoopMetrics) RegisterHistogram(_, _ string, _ []float64, _ ...string) + func (m *NoopMetrics) Set(_ string, _ float64, _ ...string) + type Webhook struct + AccessLevel WebhookAccessLevel + ButtonStyle WebhookButtonStyle + ButtonText string + CheckboxInput []*WebhookCheckboxInput + ConfirmationText string + DisplayMode WebhookDisplayMode + ID string + Payload map[string]any + PlainTextInput []*WebhookPlainTextInput + URL string + type WebhookAccessLevel string + const WebhookAccessLevelChannelAdmins + const WebhookAccessLevelChannelMembers + const WebhookAccessLevelGlobalAdmins + type WebhookButtonStyle string + const WebhookButtonStyleDanger + const WebhookButtonStylePrimary + type WebhookCallback struct + ChannelID string + CheckboxInput map[string][]string + ID string + Input map[string]string + MessageID string + Payload map[string]any + Timestamp time.Time + UserID string + UserRealName string + func (w *WebhookCallback) GetCheckboxInputSelectedValues(key string) []string + func (w *WebhookCallback) GetInputValue(key string) string + func (w *WebhookCallback) GetPayloadBool(key string, defaultValue bool) bool + func (w *WebhookCallback) GetPayloadInt(key string, defaultValue int) int + func (w *WebhookCallback) GetPayloadString(key string) string + func (w *WebhookCallback) GetPayloadValue(key string) any + type WebhookCheckboxInput struct + ID string + Label string + Options []*WebhookCheckboxOption + type WebhookCheckboxOption struct + Selected bool + Text string + Value string + type WebhookDisplayMode string + const WebhookDisplayModeAlways + const WebhookDisplayModeOpenIssue + const WebhookDisplayModeResolvedIssue + type WebhookPlainTextInput struct + Description string + ID string + InitialValue string + MaxLength int + MinLength int + Multiline bool