add (untested) function to set webhook with certificate

This commit is contained in:
Syfaro 2015-09-07 11:44:29 -05:00
parent 87a279827e
commit ca40caaa47
2 changed files with 40 additions and 7 deletions

View file

@ -237,3 +237,17 @@ func NewWebhook(link string) WebhookConfig {
Clear: false,
}
}
// NewWebhookWithCert creates a new webhook with a selfsigned certificate.
//
// link is the url you wish to get webhooks,
// file contains a string to a file, or a FileReader or FileBytes.
func NewWebhookWithCert(link string, file interface{}) WebhookConfig {
u, _ := url.Parse(link)
return WebhookConfig{
URL: u,
Clear: false,
Certificate: file,
}
}