webhook

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL    string
	Secret string
	Bus    *events.Bus
	Log    *slog.Logger
	Client *http.Client
}

Config configures the webhook dispatcher.

type Payload

type Payload struct {
	Event     string    `json:"event"`
	Timestamp time.Time `json:"timestamp"`
	Data      any       `json:"data"`
}

Payload is the JSON structure sent to the webhook endpoint.

type Service

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

Service subscribes to critical events and sends HTTP POST notifications.

func New

func New(cfg Config) *Service

New creates a new webhook Service.

func (*Service) Run

func (s *Service) Run(ctx context.Context)

Run listens for critical events on the event bus until ctx is cancelled.

Jump to

Keyboard shortcuts

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