channel

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMapper

func InitMapper(conf []config.Channel) map[string]WebhookChannel

Types

type BarkChannel

type BarkChannel struct {
	CustomServerUrl string
	DeviceKey       string
	CustomIcon      string
}

func (*BarkChannel) PostToWebhook

func (channel *BarkChannel) PostToWebhook(taskType, title, content string) error

PostToWebhook push message to Bark-Server, related document: https://github.com/Finb/bark-server/blob/master/docs/API_V2.md

func (*BarkChannel) Type

func (channel *BarkChannel) Type() string

type DingTalkChannel

type DingTalkChannel struct {
	// contains filtered or unexported fields
}

func (*DingTalkChannel) PostToWebhook

func (channel *DingTalkChannel) PostToWebhook(taskType, title, content string) error

PostToWebhook push message to DingTalk chat robot, related document: https://developers.dingtalk.com/document/robots/custom-robot-access/ .

func (*DingTalkChannel) Type

func (channel *DingTalkChannel) Type() string

type DiscardChannel

type DiscardChannel struct {
}

func (*DiscardChannel) PostToWebhook

func (channel *DiscardChannel) PostToWebhook(taskType, title, content string) error

func (*DiscardChannel) Type

func (channel *DiscardChannel) Type() string

type EmailChannel

type EmailChannel struct {
	// contains filtered or unexported fields
}

func (*EmailChannel) PostToWebhook

func (channel *EmailChannel) PostToWebhook(taskType, title, content string) error

func (*EmailChannel) Type

func (channel *EmailChannel) Type() string

type WebhookChannel

type WebhookChannel interface {
	// Type return the webhook channel type.
	Type() string

	// PostToWebhook push message to the webhook.
	PostToWebhook(taskType, title, content string) error
}

Jump to

Keyboard shortcuts

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