Documentation
¶
Index ¶
- Constants
- type AlertUpdateRequest
- type AlertUpdater
- type ConversationMessage
- type RateLimitedUpdater
- type Service
- func (x *Service) BotID() string
- func (x *Service) ClearExpiredIconCache()
- func (x *Service) ClearExpiredProfileCache()
- func (x *Service) DefaultChannelID() string
- func (x *Service) GetChannelName(ctx context.Context, channelID string) (string, error)
- func (x *Service) GetClient() interfaces.SlackClient
- func (x *Service) GetConversationHistory(ctx context.Context, channelID string, threadID string, limit int, ...) ([]ConversationMessage, error)
- func (x *Service) GetUserGroupName(ctx context.Context, groupID string) (string, error)
- func (x *Service) GetUserIcon(ctx context.Context, userID string) ([]byte, string, error)
- func (x *Service) GetUserProfile(ctx context.Context, userID string) (string, error)
- func (x *Service) IsBotUser(userID string) bool
- func (x *Service) NewThread(thread model.Thread) interfaces.SlackThreadService
- func (x *Service) PostAlert(ctx context.Context, alert *alert.Alert) (interfaces.SlackThreadService, error)
- func (x *Service) PostMessage(ctx context.Context, message string) (*ThreadService, error)
- func (x *Service) PostNotice(ctx context.Context, channelID, message string, noticeID fmt.Stringer) (string, error)
- func (x *Service) PostNoticeThreadDetails(ctx context.Context, channelID, threadTS string, alert *alert.Alert, ...) error
- func (x *Service) PostTicket(ctx context.Context, ticket *ticket.Ticket, alerts alert.Alerts) (interfaces.SlackThreadService, string, error)
- func (x *Service) ShowBindToTicketModal(ctx context.Context, callbackID model.CallbackID, tickets []*ticket.Ticket, ...) error
- func (x *Service) ShowEditTicketModal(ctx context.Context, ticket *ticket.Ticket, triggerID string) error
- func (x *Service) ShowResolveTicketModal(ctx context.Context, ticket *ticket.Ticket, triggerID string, ...) error
- func (x *Service) ShowSalvageModal(ctx context.Context, ticket *ticket.Ticket, unboundAlerts alert.Alerts, ...) error
- func (x *Service) Stop()
- func (x *Service) TeamID() string
- func (x *Service) ToExternalMsgURL(channelID, threadID string) string
- func (x *Service) ToMsgURL(channelID, threadID string) string
- func (x *Service) ToTicketURL(ticketID string) string
- func (x *Service) UpdateAlerts(ctx context.Context, alerts alert.Alerts)
- func (x *Service) UpdateSalvageModal(ctx context.Context, ticket *ticket.Ticket, unboundAlerts alert.Alerts, ...) error
- type ServiceOption
- type ThreadService
- func (x *ThreadService) AttachFile(ctx context.Context, title, fileName string, data []byte) error
- func (x *ThreadService) ChannelID() string
- func (x *ThreadService) Entity() *model.Thread
- func (x *ThreadService) NewStateFunc(ctx context.Context, message string) func(ctx context.Context, msg string)
- func (x *ThreadService) NewTraceMessage(ctx context.Context, initialMessage string) func(ctx context.Context, traceMsg string)
- func (x *ThreadService) NewUpdatableMessage(ctx context.Context, initialMessage string) func(ctx context.Context, newMsg string)
- func (x *ThreadService) PostAlert(ctx context.Context, alert *alert.Alert) error
- func (x *ThreadService) PostAlertList(ctx context.Context, list *alert.List) (string, error)
- func (x *ThreadService) PostAlertLists(ctx context.Context, clusters []*alert.List) error
- func (x *ThreadService) PostAlerts(ctx context.Context, alerts alert.Alerts) error
- func (x *ThreadService) PostComment(ctx context.Context, comment string) error
- func (x *ThreadService) PostCommentWithMessageID(ctx context.Context, comment string) (string, error)
- func (x *ThreadService) PostContextBlock(ctx context.Context, text string) error
- func (x *ThreadService) PostFinding(ctx context.Context, finding *ticket.Finding) error
- func (x *ThreadService) PostLinkToTicket(ctx context.Context, ticketURL, ticketTitle string) error
- func (x *ThreadService) PostResolveDetails(ctx context.Context, t *ticket.Ticket) error
- func (x *ThreadService) PostSessionActions(ctx context.Context, ticketID types.TicketID, ticketStatus types.TicketStatus, ...) error
- func (x *ThreadService) PostTicket(ctx context.Context, ticket *ticket.Ticket, alerts alert.Alerts) (string, error)
- func (x *ThreadService) PostTicketList(ctx context.Context, tickets []*ticket.Ticket) error
- func (x *ThreadService) Reply(ctx context.Context, message string)
- func (x *ThreadService) ThreadID() string
- func (x *ThreadService) ToExternalMsgURL() string
- func (x ThreadService) ToMsgURL(channelID, threadID string) string
- func (x *ThreadService) UpdateAlert(ctx context.Context, alert alert.Alert) error
- func (x *ThreadService) UpdateAlertList(ctx context.Context, list *alert.List, status string) error
- type UpdaterOption
Constants ¶
const UserProfileCacheExpiry = 10 * time.Minute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertUpdateRequest ¶
AlertUpdateRequest represents a request to update an alert message
type AlertUpdater ¶
AlertUpdater defines the interface for updating alert messages with rate limiting
func NewRateLimitedUpdater ¶
func NewRateLimitedUpdater(client interfaces.SlackClient, opts ...UpdaterOption) AlertUpdater
NewRateLimitedUpdater creates a new rate-limited updater with optional configurations
type ConversationMessage ¶ added in v0.5.0
type ConversationMessage struct {
User *model.User
Text string
Timestamp time.Time
Thread model.Thread
}
ConversationMessage represents a message from conversation history
type RateLimitedUpdater ¶
type RateLimitedUpdater struct {
// contains filtered or unexported fields
}
RateLimitedUpdater provides rate-limited alert message updates
func (*RateLimitedUpdater) Stop ¶
func (r *RateLimitedUpdater) Stop()
Stop gracefully stops the rate-limited updater
func (*RateLimitedUpdater) UpdateAlert ¶
func (r *RateLimitedUpdater) UpdateAlert(ctx context.Context, alert alert.Alert)
UpdateAlert queues an alert update request asynchronously
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(client interfaces.SlackClient, channelID string, opts ...ServiceOption) (*Service, error)
func NewTestService ¶
func (*Service) ClearExpiredIconCache ¶
func (x *Service) ClearExpiredIconCache()
ClearExpiredIconCache removes expired cache entries
func (*Service) ClearExpiredProfileCache ¶
func (x *Service) ClearExpiredProfileCache()
ClearExpiredProfileCache removes expired profile cache entries
func (*Service) DefaultChannelID ¶
func (*Service) GetChannelName ¶
GetChannelName returns the channel name for the given channel ID
func (*Service) GetClient ¶
func (x *Service) GetClient() interfaces.SlackClient
GetClient returns the underlying SlackClient
func (*Service) GetConversationHistory ¶ added in v0.5.0
func (x *Service) GetConversationHistory( ctx context.Context, channelID string, threadID string, limit int, oldest int64, ) ([]ConversationMessage, error)
GetConversationHistory retrieves conversation history from Slack If threadID is provided, gets thread messages. Otherwise gets channel messages. limit: 0 means all messages, oldest: 0 means no time restriction
func (*Service) GetUserGroupName ¶
GetUserGroupName returns the user group name for the given group ID
func (*Service) GetUserIcon ¶
GetUserIcon returns the user's icon image data
func (*Service) GetUserProfile ¶
GetUserProfile returns the user's profile name
func (*Service) NewThread ¶
func (x *Service) NewThread(thread model.Thread) interfaces.SlackThreadService
func (*Service) PostAlert ¶
func (x *Service) PostAlert(ctx context.Context, alert *alert.Alert) (interfaces.SlackThreadService, error)
func (*Service) PostMessage ¶
PostMessage posts a message to the channel and returns the thread. It's just for testing.
func (*Service) PostNotice ¶ added in v0.4.0
func (x *Service) PostNotice(ctx context.Context, channelID, message string, noticeID fmt.Stringer) (string, error)
PostNotice posts a notice message to Slack with an escalate button
func (*Service) PostNoticeThreadDetails ¶ added in v0.4.0
func (x *Service) PostNoticeThreadDetails(ctx context.Context, channelID, threadTS string, alert *alert.Alert, llmResponse *alert.GenAIResponse) error
PostNoticeThreadDetails posts detailed information about the notice in a thread
func (*Service) PostTicket ¶
func (x *Service) PostTicket(ctx context.Context, ticket *ticket.Ticket, alerts alert.Alerts) (interfaces.SlackThreadService, string, error)
PostTicket posts a ticket to a new thread and returns the thread service
func (*Service) ShowBindToTicketModal ¶
func (*Service) ShowEditTicketModal ¶ added in v0.5.0
func (*Service) ShowResolveTicketModal ¶
func (*Service) ShowSalvageModal ¶
func (*Service) Stop ¶
func (x *Service) Stop()
Stop gracefully stops the service and its rate-limited updater
func (*Service) ToExternalMsgURL ¶
func (*Service) ToTicketURL ¶
ToTicketURL generates a URL to the ticket detail page in the frontend
func (*Service) UpdateAlerts ¶
type ServiceOption ¶
type ServiceOption func(*Service)
ServiceOption represents a configuration option for Service
func WithFrontendURL ¶
func WithFrontendURL(frontendURL string) ServiceOption
WithFrontendURL sets the frontend URL for generating ticket detail URLs
func WithUpdaterOptions ¶
func WithUpdaterOptions(opts ...UpdaterOption) ServiceOption
WithUpdaterOptions sets options for the rate-limited updater
type ThreadService ¶
type ThreadService struct {
// contains filtered or unexported fields
}
func (*ThreadService) AttachFile ¶
func (*ThreadService) ChannelID ¶
func (x *ThreadService) ChannelID() string
func (*ThreadService) Entity ¶
func (x *ThreadService) Entity() *model.Thread
func (*ThreadService) NewStateFunc ¶
func (*ThreadService) NewTraceMessage ¶ added in v0.2.0
func (x *ThreadService) NewTraceMessage(ctx context.Context, initialMessage string) func(ctx context.Context, traceMsg string)
NewTraceMessage creates a new trace message function that posts new context blocks when byte limits are exceeded instead of updating existing ones
func (*ThreadService) NewUpdatableMessage ¶ added in v0.1.0
func (*ThreadService) PostAlertList ¶
func (*ThreadService) PostAlertLists ¶
func (*ThreadService) PostAlerts ¶
func (*ThreadService) PostComment ¶
func (x *ThreadService) PostComment(ctx context.Context, comment string) error
PostComment posts a simple text comment to the thread
func (*ThreadService) PostCommentWithMessageID ¶
func (x *ThreadService) PostCommentWithMessageID(ctx context.Context, comment string) (string, error)
PostCommentWithMessageID posts a simple text comment to the thread and returns the message ID
func (*ThreadService) PostContextBlock ¶ added in v0.5.0
func (x *ThreadService) PostContextBlock(ctx context.Context, text string) error
PostContextBlock posts a message as a context block to the thread
func (*ThreadService) PostFinding ¶
func (*ThreadService) PostLinkToTicket ¶
func (x *ThreadService) PostLinkToTicket(ctx context.Context, ticketURL, ticketTitle string) error
PostLinkToTicket posts a link to a ticket in the current thread
func (*ThreadService) PostResolveDetails ¶ added in v0.9.0
PostResolveDetails posts resolve details (conclusion and comment) to the thread
func (*ThreadService) PostSessionActions ¶ added in v0.9.0
func (x *ThreadService) PostSessionActions(ctx context.Context, ticketID types.TicketID, ticketStatus types.TicketStatus, sessionURL string) error
PostSessionActions posts session details link and Resolve/Edit action buttons to the thread
func (*ThreadService) PostTicket ¶
func (*ThreadService) PostTicketList ¶
func (*ThreadService) ThreadID ¶
func (x *ThreadService) ThreadID() string
func (*ThreadService) ToExternalMsgURL ¶
func (x *ThreadService) ToExternalMsgURL() string
func (*ThreadService) UpdateAlert ¶
func (*ThreadService) UpdateAlertList ¶
UpdateAlertList updates an alert list message with completion status
type UpdaterOption ¶
type UpdaterOption func(*RateLimitedUpdater)
UpdaterOption represents a configuration option for RateLimitedUpdater
func WithInterval ¶
func WithInterval(interval time.Duration) UpdaterOption
WithInterval sets the rate limiting interval
func WithRetryInterval ¶
func WithRetryInterval(interval time.Duration) UpdaterOption
WithRetryInterval sets the base retry interval for exponential backoff