webhook

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(path string, msg hermod.Message) error

Dispatch sends a message to the source that holds the given path.

func Register

func Register(path string) chan hermod.Message

Register creates the channel a webhook source reads its path from. It holds the path if nothing else does, and otherwise waits to take it over.

func Unregister

func Unregister(path string, ch chan hermod.Message)

Unregister releases a channel's claim on a path. Only the channel that holds the path removes it, so an outgoing engine's teardown cannot remove the source that took over from it.

Types

type WebhookSource

type WebhookSource struct {
	Path string
	// contains filtered or unexported fields
}

WebhookSource implements the hermod.Source interface for receiving HTTP requests.

func NewWebhookSource

func NewWebhookSource(path string) *WebhookSource

NewWebhookSource creates a new WebhookSource.

func (*WebhookSource) Ack

func (s *WebhookSource) Ack(ctx context.Context, msg hermod.Message) error

Ack is a no-op for webhooks.

func (*WebhookSource) Close

func (s *WebhookSource) Close() error

Close unregisters the source, unless another has already taken the path over.

func (*WebhookSource) Ping

func (s *WebhookSource) Ping(ctx context.Context) error

Ping is a no-op for webhooks.

func (*WebhookSource) Read

func (s *WebhookSource) Read(ctx context.Context) (hermod.Message, error)

Read blocks until a message is received via Dispatch.

Jump to

Keyboard shortcuts

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