Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Scheme is the identifying part of this service's configuration URL Scheme = "generic" // DefaultWebhookScheme is the scheme used for webhook URLs unless overridden DefaultWebhookScheme = "https" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { standard.EnumlessConfig ContentType string `key:"contenttype" default:"application/json" desc:"The value of the Content-Type header"` DisableTLS bool `key:"disabletls" default:"No"` Template string `key:"template" optional:"" desc:"The template used for creating the request payload"` Title string `key:"title" default:""` TitleKey string `key:"titlekey" default:"title" desc:"The key that will be used for the title value"` MessageKey string `key:"messagekey" default:"message" desc:"The key that will be used for the message value"` RequestMethod string `key:"method" default:"POST"` // contains filtered or unexported fields }
Config for use within the generic service
func ConfigFromWebhookURL ¶
ConfigFromWebhookURL creates a new Config from a parsed Webhook URL
func DefaultConfig ¶
func DefaultConfig() (*Config, format.PropKeyResolver)
DefaultConfig creates a PropKeyResolver and uses it to populate the default values of a new Config, returning both
func (*Config) SetURL ¶
SetURL updates a ServiceConfig from a URL representation of it's field values
func (*Config) WebhookURL ¶
WebhookURL returns a url.URL that is synchronized with the config props
type Service ¶
Service providing a generic notification service
func (*Service) GetConfigURLFromCustom ¶
GetConfigURLFromCustom creates a regular service URL from one with a custom host
func (*Service) Initialize ¶
Initialize loads ServiceConfig from configURL and sets logger for this Service
Click to show internal directories.
Click to hide internal directories.