Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientOptions ¶
type ClientOptions struct { // Debug will print extra debug log messages. Debug bool // Webhook contains the options for the slack webhook. Webhook WebhookOptions }
ClientOptions are the configurable options of the slack client.
type WebhookOptions ¶
type WebhookOptions struct { // Enabled will start the webhook endpoint if true. Enabled bool // UseLetsEncrypt will setup for you a letsencrypt certificate if true. UseLetsEncrypt bool // Domain name of the webhook service, used in the letsencrypt certificate process. Domain string // VerificationToken is the token used to check incoming actions come from slack. VerificationToken string // Addr is the address on which the webhook will be run. Required // if EnableWebhook is true. Addr string // UseHTTPS will use HTTPS instead of HTTP to serve the webhook. // Note that using HTTPS is required by slack for receiving webhooks. // If UseLetsEncrypt is true, the value of this property will be ignored. UseHTTPS bool // CertFile is the path to the SSL certificate. If UseHTTPS is true it is required. CertFile string // KeyFile is the path to the SSL key. If UseHTTPS is true it is required. KeyFile string // RegistrationFile is the file to read/write registration info to. The ACME protocol requires remembering some details // about a registration. Therefore, the file is saved at the given location. // If not given, and PrivateKeyFile is given, then gives an error - if you're saving your private key, // you need to save your user registration. RegistrationFile string // PrivateKeyFile is the file to read/write the private key from/to. If this is not empty, and the file does not exist, // then the user is assumed not to be registered, and the file is created. if this is empty, then // a new private key is generated and used for all queries. The private key is lost on stopping the program. PrivateKeyFile string }
WebhookOptions are the configurable options of the slack webhook.
type WebhookService ¶
type WebhookService struct {
// contains filtered or unexported fields
}
WebhookService is a service to handle slack interactive messages callbacks.
func NewWebhookService ¶
func NewWebhookService(token string) *WebhookService
NewWebhookService returns a new WebhookService with the given token.
func (*WebhookService) Consume ¶
func (s *WebhookService) Consume() <-chan slack.AttachmentActionCallback
Consume returns a channel where callbacks will be sent.
func (*WebhookService) ServeHTTP ¶
func (s *WebhookService) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP is the actual HTTP handler of the service.
Click to show internal directories.
Click to hide internal directories.