ingest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package ingest captures inbound webhooks: it verifies signatures, persists the raw request durably, and queues delivery. It does the minimum synchronous work so the provider gets a fast response.

Index

Constants

This section is empty.

Variables

View Source
var ErrSourceNotFound = errors.New("ingest: source not found")

ErrSourceNotFound means the request targeted an unregistered source.

Functions

This section is empty.

Types

type Capturer

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

Capturer owns the capture path.

func NewCapturer

func NewCapturer(store storage.Store, sources *source.Service, verifiers *signature.Registry, logger *slog.Logger) *Capturer

NewCapturer wires the capture path.

func (*Capturer) Capture

func (c *Capturer) Capture(ctx context.Context, sourceName string, req Request) (Result, error)

Capture persists the request and, when accepted, queues delivery. A request that fails signature verification is still captured (status rejected) but not queued, so forged requests remain inspectable.

type Request

type Request struct {
	Method   string
	Path     string
	Query    string
	Headers  map[string][]string
	Body     []byte
	SourceIP string
}

Request is a captured inbound HTTP request.

type Result

type Result struct {
	EventID  string
	Accepted bool // false when signature verification failed
}

Result reports what happened to a captured request.

Jump to

Keyboard shortcuts

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