Documentation
¶
Index ¶
- Constants
- func ProcessMessageResponse(msg MessageResponse, channel string, api *slack.Client, rtm *slack.RTM) error
- type AzureCostsConfig
- type AzureCostsMessageHandler
- type AzureShutdownConfig
- type AzureShutdownMessageHandler
- type AzureStatusMessageHandler
- type AzureStorageMessageHandler
- type BaseMessageResponse
- type DBConfig
- type DatabaseBackupMessageHandler
- type FileDetails
- type FileMessageResponse
- type MessageHandler
- type MessageResponse
- type MiscMessageHandler
- type SendgridMessageHandler
- type ServerStatusMessageHandler
- type ServiceBusMessageHandler
- type TextMessageResponse
Constants ¶
const ( TextMessageType int = 1 // just returning a text message. FileMessageType int = 2 // File )
Variables ¶
This section is empty.
Functions ¶
func ProcessMessageResponse ¶
Types ¶
type AzureCostsConfig ¶
type AzureCostsMessageHandler ¶
type AzureCostsMessageHandler struct {
// contains filtered or unexported fields
}
AzureCostMessageHandler gets the costs from Azure Billing API.
func NewAzureCostMessageHandler ¶
func NewAzureCostMessageHandler() *AzureCostsMessageHandler
func (*AzureCostsMessageHandler) ParseMessage ¶
func (ss *AzureCostsMessageHandler) ParseMessage(msg string, user string) (MessageResponse, error)
ParseMessage takes a message, determines what to do return the text that should go to the user.
type AzureShutdownConfig ¶
type AzureShutdownMessageHandler ¶
type AzureShutdownMessageHandler struct {
// contains filtered or unexported fields
}
AzureCostMessageHandler gets the costs from Azure Billing API.
func NewAzureShutdownMessageHandler ¶
func NewAzureShutdownMessageHandler() *AzureShutdownMessageHandler
func (*AzureShutdownMessageHandler) ParseMessage ¶
func (as *AzureShutdownMessageHandler) ParseMessage(msg string, user string) (MessageResponse, error)
ParseMessage takes a message, determines what to do return the text that should go to the user.
type AzureStatusMessageHandler ¶
type AzureStatusMessageHandler struct { AIHelper *helper.AppInsightsHelper AMHelper *helper.AzureMonitorHelper // contains filtered or unexported fields }
ServerStatusMessageHandler stores status about server (test, stage, prod etc) status
func NewAzureStatusMessageHandler ¶
func NewAzureStatusMessageHandler() *AzureStatusMessageHandler
func (*AzureStatusMessageHandler) ParseMessage ¶
func (ss *AzureStatusMessageHandler) ParseMessage(msg string, user string) (MessageResponse, error)
ParseMessage takes a message, determines what to do return the text that should go to the user.
type AzureStorageMessageHandler ¶
type AzureStorageMessageHandler struct { Configuration config.Config // contains filtered or unexported fields }
AzureStorageMessageHandler checks for SG messages.
func NewAzureStorageMessageHandler ¶
func NewAzureStorageMessageHandler(configFilePath string) *AzureStorageMessageHandler
func (*AzureStorageMessageHandler) ParseMessage ¶
func (sg *AzureStorageMessageHandler) ParseMessage(msg string, user string) (MessageResponse, error)
ParseMessage takes a message, determines what to do return the text that should go to the user.
type BaseMessageResponse ¶
type BaseMessageResponse struct {
// contains filtered or unexported fields
}
func (BaseMessageResponse) GetMessageResponseType ¶
func (bm BaseMessageResponse) GetMessageResponseType() int
type DBConfig ¶
type DBConfig struct { ExportSubscriptionID string `json:"ExportSubscriptionID"` ImportSubscriptionID string `json:"ImportSubscriptionID"` TenantID string `json:"TenantID"` ClientID string `json:"ClientID"` ClientSecret string `json:"ClientSecret"` ExportResourceGroup string `json:"ExportResourceGroup"` ImportResourceGroup string `json:"ImportResourceGroup"` StorageKey string `json:"StorageKey"` StorageURL string `json:"StorageURL"` SqlExportAdminLogin string `json:"SqlExportAdminLogin"` SqlExportAdminPassword string `json:"SqlExportAdminPassword"` SqlImportAdminLogin string `json:"SqlImportAdminLogin"` SqlImportAdminPassword string `json:"SqlImportAdminPassword"` AllowedUsers string `json:"AllowedUsers"` BackupPrefix string `json:"BackupPrefix"` ExportServerName string `json:"ExportServerName"` ImportServerName string `json:"ImportServerName"` DatabaseName string `json:"DatabaseName"` ImportStorageKey string `json:"DatabaseName"` AllowedUsersList []string }
type DatabaseBackupMessageHandler ¶
type DatabaseBackupMessageHandler struct {
// contains filtered or unexported fields
}
func NewDatabaseBackupMessageHandler ¶
func NewDatabaseBackupMessageHandler() *DatabaseBackupMessageHandler
func (*DatabaseBackupMessageHandler) ParseMessage ¶
func (ss *DatabaseBackupMessageHandler) ParseMessage(msg string, user string) (MessageResponse, error)
ParseMessage takes a message, determines what to do return the text that should go to the user.
type FileDetails ¶
type FileMessageResponse ¶
type FileMessageResponse struct { BaseMessageResponse Details []FileDetails }
func NewFileMessageResponse ¶
func NewFileMessageResponse(details []FileDetails) FileMessageResponse
func NewSingleFileMessageResponse ¶
func NewSingleFileMessageResponse(fileName string, title string, contents []byte) FileMessageResponse
type MessageHandler ¶
type MessageHandler interface { // ParseMessage takes a message, determines what to do // return the text that should go to the user. ParseMessage(msg string, user string) (MessageResponse, error) }
MessageHandler takes a message, parses it and determines what it should do. Returns the MessageResponse (which could be text, or a file?) that should be returned to the user.
type MessageResponse ¶
type MessageResponse interface {
GetMessageResponseType() int
}
type MiscMessageHandler ¶
type MiscMessageHandler struct { }
MiscMessageHandler misc rubbish
func NewMiscMessageHandler ¶
func NewMiscMessageHandler() *MiscMessageHandler
func (*MiscMessageHandler) ParseMessage ¶
func (sg *MiscMessageHandler) ParseMessage(msg string, user string) (MessageResponse, error)
ParseMessage takes a message, determines what to do return the text that should go to the user.
type SendgridMessageHandler ¶
type SendgridMessageHandler struct {
Handler *helper.SendgridHandler
}
SendgridMessageHandler checks for SG messages.
func NewSendgridMessageHandler ¶
func NewSendgridMessageHandler() *SendgridMessageHandler
func (*SendgridMessageHandler) ParseMessage ¶
func (sg *SendgridMessageHandler) ParseMessage(msg string, user string) (MessageResponse, error)
ParseMessage takes a message, determines what to do return the text that should go to the user.
type ServerStatusMessageHandler ¶
type ServerStatusMessageHandler struct {
// contains filtered or unexported fields
}
ServerStatusMessageHandler stores status about server (test, stage, prod etc) status
func NewServerStatusMessageHandler ¶
func NewServerStatusMessageHandler() *ServerStatusMessageHandler
func (*ServerStatusMessageHandler) ParseMessage ¶
func (ss *ServerStatusMessageHandler) ParseMessage(msg string, user string) (MessageResponse, error)
ParseMessage takes a message, determines what to do return the text that should go to the user.
type ServiceBusMessageHandler ¶
type ServiceBusMessageHandler struct {
// contains filtered or unexported fields
}
ServiceBusMessageHandler snooping
func NewServiceBusMessageHandler ¶
func NewServiceBusMessageHandler() *ServiceBusMessageHandler
func (*ServiceBusMessageHandler) ParseMessage ¶
func (sb *ServiceBusMessageHandler) ParseMessage(msg string, user string) (MessageResponse, error)
ParseMessage takes a message, determines what to do return the text that should go to the user.
type TextMessageResponse ¶
type TextMessageResponse struct { BaseMessageResponse Message string }
func NewTextMessageResponse ¶
func NewTextMessageResponse(msg string) TextMessageResponse