slack_notification

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Slack Notification

Feature

  • Send message to Slack

Config

Config Webhook URL and open the notification

  • Webhook URL: such as https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

Preview

Slack Config

Document

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Info embed.FS

Functions

This section is empty.

Types

type Notification

type Notification struct {
	Config          *NotificationConfig
	UserConfigCache *UserConfigCache
}

func (*Notification) ConfigFields

func (n *Notification) ConfigFields() []plugin.ConfigField

func (*Notification) ConfigReceiver

func (n *Notification) ConfigReceiver(config []byte) error

func (*Notification) GetNewQuestionSubscribers

func (n *Notification) GetNewQuestionSubscribers() (userIDs []string)

GetNewQuestionSubscribers returns the subscribers of the new question notification

func (*Notification) Info

func (n *Notification) Info() plugin.Info

func (*Notification) Notify

func (n *Notification) Notify(msg plugin.NotificationMessage)

Notify sends a notification to the user

func (*Notification) UserConfigFields

func (n *Notification) UserConfigFields() []plugin.ConfigField

func (*Notification) UserConfigReceiver

func (n *Notification) UserConfigReceiver(userID string, config []byte) error

type NotificationConfig

type NotificationConfig struct {
	Notification bool `json:"notification"`
}

type UserConfig

type UserConfig struct {
	WebhookURL                   string `json:"webhook_url"`
	InboxNotifications           bool   `json:"inbox_notifications"`
	AllNewQuestions              bool   `json:"all_new_questions"`
	NewQuestionsForFollowingTags bool   `json:"new_questions_for_following_tags"`
	UpvotedAnswers               bool   `json:"upvoted_answers"`
	DownvotedAnswers             bool   `json:"downvoted_answers"`
	UpdatedQuestions             bool   `json:"updated_questions"`
	UpdatedAnswers               bool   `json:"updated_answers"`
}

type UserConfigCache

type UserConfigCache struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewUserConfigCache

func NewUserConfigCache() *UserConfigCache

func (*UserConfigCache) SetUserConfig

func (ucc *UserConfigCache) SetUserConfig(userID string, config *UserConfig)

type WebhookReq

type WebhookReq struct {
	Blocks []struct {
		Type string `json:"type"`
		Text struct {
			Type string `json:"type"`
			Text string `json:"text"`
		} `json:"text"`
	} `json:"blocks"`
}

func NewWebhookReq

func NewWebhookReq(content string) *WebhookReq

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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