Documentation ¶
Overview ¶
Package kslack
Package kslack ¶
Package kslack ¶
Package kslack
Index ¶
- Constants
- Variables
- func NewSlackNotifyConfig(pattern string, repeatCount int, level int, notifyTarget ...string) *slackNotifyConfig
- func SlackInstance() *slacker
- type ErrorConfig
- type Hook
- type NotifyConfig
- type Report
- type ReportField
- type SlackNotifyLevel
- type SlackNotifyTarget
- type SlackRunMode
- type Slacker
Constants ¶
View Source
const ( ColorDanger string = "danger" ColorWarning string = "warning" ColorGood string = "good" )
Variables ¶
View Source
var ( MySQLDbErrs []ErrorConfig = []ErrorConfig{ {}, } MemSQLDbErrs []ErrorConfig = []ErrorConfig{ {}, } MgoDbErrs []ErrorConfig = []ErrorConfig{ {}, } RedisDbErrs []ErrorConfig = []ErrorConfig{ {}, } )
Functions ¶
func NewSlackNotifyConfig ¶
func SlackInstance ¶
func SlackInstance() *slacker
Types ¶
type ErrorConfig ¶
type Hook ¶
type Hook struct { ServiceName string AuthorName string Channel string IconURL string IconEmoji string ErrorConfigs []ErrorConfig // contains filtered or unexported fields }
func NewHook ¶
func NewHook(serviceName string, configs ...ErrorConfig) *Hook
type NotifyConfig ¶
type NotifyConfig struct { Pattern string `json:"pattern"` NotifyLevel SlackNotifyLevel NotifyTarget SlackNotifyTarget Min int `json:"min"` Max int `json:"max"` }
type Report ¶
type Report struct { Key string Title string `json:"title"` Fields []ReportField `json:"fields"` }
type ReportField ¶
type ReportField struct { Title string `json:"title"` Data interface{} `json:"data"` }
type SlackNotifyLevel ¶
type SlackNotifyLevel int
const ( NotifyUser SlackNotifyLevel = 1 NotifyChannel SlackNotifyLevel = 2 )
type SlackNotifyTarget ¶
type SlackNotifyTarget string
type SlackRunMode ¶
type SlackRunMode int
region Object
const ( DebugMode SlackRunMode = 1 DevelopMode SlackRunMode = 2 ProductionMode SlackRunMode = 3 )
Click to show internal directories.
Click to hide internal directories.