Documentation ¶
Index ¶
- Constants
- Variables
- func ApprovalsResponse(approvalsManager approvals.Manager) string
- func IsBotCommand(eventText string) bool
- func RegisterBot(name string, b Bot)
- func RemoveApprovalHandler(identifier string, approvalsManager approvals.Manager) string
- func Run(approvalsManager approvals.Manager)
- func Stop()
- func UnregisterBot(name string)
- type ApprovalResponse
- type Bot
- type BotManager
- func (bm *BotManager) ProcessApprovalResponses(ctx context.Context, reply BotReplyApproval) error
- func (bm *BotManager) ProcessBotMessages(ctx context.Context, respond BotMessageResponder)
- func (bm *BotManager) SetupBot(botName string, bot Bot)
- func (bm *BotManager) SubscribeForApprovals(ctx context.Context, approval BotRequestApproval) error
- type BotMessage
- type BotMessageResponder
- type BotReplyApproval
- type BotRequestApproval
- type Filter
Constants ¶
View Source
const (
RemoveApprovalPrefix = "rm approval"
)
Variables ¶
View Source
var ( BotEventTextToResponse = map[string][]string{ "help": { `Here's a list of supported commands`, `- "get deployments" -> get a list of all deployments`, `- "get approvals" -> get a list of approvals`, `- "rm approval <approval identifier>" -> remove approval`, `- "approve <approval identifier>" -> approve update request`, `- "reject <approval identifier>" -> reject update request`, }, } ApprovalResponseKeyword = "approve" RejectResponseKeyword = "reject" )
Functions ¶
func ApprovalsResponse ¶
func IsBotCommand ¶
func RegisterBot ¶
RegisterBot makes a bot implementation available by the provided name.
func RemoveApprovalHandler ¶
func UnregisterBot ¶
func UnregisterBot(name string)
UnregisterBot removes a Sender with a particular name from the list.
Types ¶
type ApprovalResponse ¶
type ApprovalResponse struct { User string Status types.ApprovalStatus Text string }
ApprovalResponse - used to track approvals once vote begins
func IsApproval ¶
func IsApproval(eventUser string, eventText string) (resp *ApprovalResponse, ok bool)
type BotManager ¶
type BotManager struct {
// contains filtered or unexported fields
}
BotManager holds approvalsManager and k8sImplementer for every bot
func (*BotManager) ProcessApprovalResponses ¶
func (bm *BotManager) ProcessApprovalResponses(ctx context.Context, reply BotReplyApproval) error
func (*BotManager) ProcessBotMessages ¶
func (bm *BotManager) ProcessBotMessages(ctx context.Context, respond BotMessageResponder)
func (*BotManager) SetupBot ¶
func (bm *BotManager) SetupBot(botName string, bot Bot)
func (*BotManager) SubscribeForApprovals ¶
func (bm *BotManager) SubscribeForApprovals(ctx context.Context, approval BotRequestApproval) error
type BotMessage ¶
BotMessage represents abstract container for any bot Message add here more fields if you needed for a new bot implementation
type BotMessageResponder ¶
type BotReplyApproval ¶
type BotRequestApproval ¶
Click to show internal directories.
Click to hide internal directories.