webhook

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromCmdlineOptions

func NewFromCmdlineOptions() plugin.Plugin

Types

type DiscordMessageEmbed

type DiscordMessageEmbed struct {
	URL    string                      `json:"url,omitempty"`
	Title  string                      `json:"title,omitempty"`
	Fields []*DiscordMessageEmbedField `json:"fields,omitempty"`
}

type DiscordMessageEmbedField

type DiscordMessageEmbedField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type DiscordWebhookEvent

type DiscordWebhookEvent struct {
	Content string                 `json:"content,omitempty"`
	Embeds  []*DiscordMessageEmbed `json:"embeds,omitempty"`
}

type WebhookOptionFunc

type WebhookOptionFunc func(*WebhookOutput)

func WithBasicAuth

func WithBasicAuth(username, password string) WebhookOptionFunc

WithBasicAuth specifies the username and password

func WithFormat

func WithFormat(format string) WebhookOptionFunc

WithFormat specifies the output webhook format

func WithLogger

func WithLogger(logger plugin.Logger) WebhookOptionFunc

WithLogger specifies the logger object to use for logging messages

func WithUrl

func WithUrl(url string, skipVerify bool) WebhookOptionFunc

WithUrl specifies the webhook URL

type WebhookOutput

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

func New

func New(options ...WebhookOptionFunc) *WebhookOutput

func (*WebhookOutput) ErrorChan

func (w *WebhookOutput) ErrorChan() chan error

ErrorChan returns the input error channel

func (*WebhookOutput) InputChan

func (w *WebhookOutput) InputChan() chan<- event.Event

InputChan returns the input event channel

func (*WebhookOutput) OutputChan

func (w *WebhookOutput) OutputChan() <-chan event.Event

OutputChan always returns nil

func (*WebhookOutput) SendWebhook

func (w *WebhookOutput) SendWebhook(e *event.Event) error

func (*WebhookOutput) Start

func (w *WebhookOutput) Start() error

Start the webhook output

func (*WebhookOutput) Stop

func (w *WebhookOutput) Stop() error

Stop the embedded output

Jump to

Keyboard shortcuts

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