webhook

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

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

Dispatcher processes pending webhook deliveries.

func NewDispatcher

func NewDispatcher(q *repo.Queries) *Dispatcher

func (*Dispatcher) ProcessPending

func (d *Dispatcher) ProcessPending()

ProcessPending fetches and delivers pending webhooks with exponential backoff.

type Endpoint

type Endpoint struct {
	ID        string    `json:"id"`
	OrgID     string    `json:"org_id"`
	URL       string    `json:"url"`
	Events    []string  `json:"events"`
	Active    bool      `json:"active"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Service

type Service interface {
	CreateEndpoint(orgID, url string, events []string) (Endpoint, error)
	ListEndpoints(orgID string) ([]Endpoint, error)
	UpdateEndpoint(orgID, id, url string, events []string, active bool) error
	Dispatch(orgID, event string, payload json.RawMessage) error
	TestEndpoint(orgID, endpointID string) error
}

func NewService

func NewService(q *repo.Queries) Service

Jump to

Keyboard shortcuts

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