Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Scheme is the identifying part of this service's configuration URL
Scheme = "slack"
)
Variables ¶
This section is empty.
Functions ¶
func CreateJSONPayload ¶
CreateJSONPayload compatible with the slack webhook api
func ValidateToken ¶
ValidateToken checks that the token is in the expected format
Types ¶
type Config ¶
type Config struct { standard.EnumlessConfig BotName string `default:"" optional:""` Token []string `description:"List of comma separated token parts"` Color string `key:"color" optional:""` Title string `key:"title" optional:""` }
Config for the slack service
func CreateConfigFromURL ¶
CreateConfigFromURL to use within the slack service
type ErrorMessage ¶
type ErrorMessage string
ErrorMessage for error events within the slack service
const ( // TokenAMissing from the service URL TokenAMissing ErrorMessage = "first part of the API token is missing" // TokenBMissing from the service URL TokenBMissing ErrorMessage = "second part of the API token is missing" // TokenCMissing from the service URL TokenCMissing ErrorMessage = "third part of the API token is missing." // TokenAMalformed inthe service URL TokenAMalformed ErrorMessage = "first part of the API token is malformed" // TokenBMalformed inthe service URL TokenBMalformed ErrorMessage = "second part of the API token is malformed" // TokenCMalformed inthe service URL TokenCMalformed ErrorMessage = "third part of the API token is malformed" // NotEnoughArguments provided in the service URL NotEnoughArguments ErrorMessage = "the apiURL does not include enough arguments" )
type JSON ¶
type JSON struct { Text string `json:"text"` BotName string `json:"username,omitempty"` Blocks []block `json:"blocks,omitempty"` Attachments []attachment `json:"attachments,omitempty"` }
JSON used within the Slack service
type Service ¶
Service sends notifications to a pre-configured channel or user
func (*Service) Initialize ¶
Initialize loads ServiceConfig from configURL and sets logger for this Service
Click to show internal directories.
Click to hide internal directories.