forked from TrueCloudLab/certificates
25 lines
486 B
Go
25 lines
486 B
Go
|
package webhook
|
||
|
|
||
|
type ControllerOption func(*Controller) error
|
||
|
|
||
|
func WithURL(url string) ControllerOption {
|
||
|
return func(c *Controller) error {
|
||
|
c.webhook.URL = url
|
||
|
return nil
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func WithBearerToken(token string) ControllerOption {
|
||
|
return func(c *Controller) error {
|
||
|
c.webhook.BearerToken = token
|
||
|
return nil
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func WithDisableTLSClientAuth(enabled bool) ControllerOption {
|
||
|
return func(c *Controller) error {
|
||
|
c.webhook.DisableTLSClientAuth = enabled
|
||
|
return nil
|
||
|
}
|
||
|
}
|