webhook

package
v0.0.0-...-0762aee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2022 License: BSD-2-Clause Imports: 7 Imported by: 22

Documentation

Overview

Package webhook provides a slack webhook client implementation.

See: https://api.slack.com/incoming-webhooks

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// URL is the webhook URL to use
	URL string
}

Client is a slack webhook client for posting messages using a webhook URL.

func New

func New(url string) *Client

New returns a new Client which sends request using the webhook URL.

Example
c := New("https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")
m := &chat.Message{Text: "test message"}
m.Send(c)
Output:

func (*Client) Send

func (c *Client) Send(url string, msg, resp interface{}) error

Send sends the request to slack using the webhook protocol. The url parameter only exists to satisfy the slack.Client interface and is not used by the webhook Client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL