slack

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeySlackURL         = "notification.slack.incoming_webhook_url"
	KeySlackChannelName = "notification.slack.channel_name"
)
View Source
const (
	KeySlackPayloadTemplateRegistry = "notification.slack.payload_template_registry"
	KeySlackDockerIconURL           = "notification.slack.docker_icon_url"
)
View Source
const (
	KeySlackPayloadTemplateRepository = "notification.slack.payload_template_repository"
)

Variables

This section is empty.

Functions

func Notify

func Notify(wh *IncomingWebhook) error

func PrintIncomingWebhookRegistry

func PrintIncomingWebhookRegistry(path string, notify bool)

func PrintIncomingWebhookRepository

func PrintIncomingWebhookRepository(r *http.Request, path string, h repository.Handler, p repository.WebhookProvider, notify bool)

Types

type Attachment

type Attachment struct {
	AuthorName string  `json:"author_name"` // e.g) github
	AuthorIcon string  `json:"author_icon"` // e.g) "http://cdn.flaticon.com/png/256/25231.png"
	Color      string  `json:"color"`       // e.g) good, warn, danger, #00ff00
	Text       string  `json:"text"`
	Fields     []Field `json:"fields"`
}

type Field

type Field struct {
	Title string `json:"title"`
	Value string `json:"value"`
	Short bool   `json:"short"`
}

type IncomingWebhook

type IncomingWebhook struct {
	Channel     string       `json:"channel"` // e.g) #api-test
	Username    string       `json:"username"`
	Text        string       `json:"text"`
	Attachments []Attachment `json:"attachments"`
}

https://kii.slack.com/services/B0JGN99RN?added=1

func NewIncomingWebhookRegistry

func NewIncomingWebhookRegistry(e *registry.Event, exiterr error) (*IncomingWebhook, error)

func NewIncomingWebhookRepository

func NewIncomingWebhookRepository(w *repository.Webhook, u repository.WebhookProvider, exiterr error) (*IncomingWebhook, error)

Jump to

Keyboard shortcuts

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