config

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: 4 Imported by: 0

Documentation

Overview

Package config loads gateway configuration from environment variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// HTTP listen address, e.g. ":8080".
	Addr string

	// DatabaseURL points at the SQLite file, e.g. "file:whook.db".
	DatabaseURL string

	// AdminToken guards every endpoint except ingest and health. Empty means
	// the management API is unprotected, which is only sensible for local dev.
	AdminToken string

	// MaxBodyBytes is the largest inbound request body the ingest endpoint
	// will accept. Larger requests are rejected with 413 and not captured.
	MaxBodyBytes int64

	// SecretKey encrypts provider signing secrets at rest. Required once a
	// source configures a signing secret.
	SecretKey string

	// Delivery worker settings.
	Workers      int
	PollInterval time.Duration

	// Retention. RetentionAge is how long received events are kept; zero
	// disables pruning entirely. FailedRetentionAge keeps rejected and
	// dead-lettered events longer for debugging; it defaults to RetentionAge.
	RetentionAge       time.Duration
	FailedRetentionAge time.Duration
	PruneInterval      time.Duration

	// Ingest rate limiting, per source. IngestRate is requests per second; zero
	// disables limiting. IngestBurst is the bucket size; zero defaults to one
	// second of capacity.
	IngestRate  float64
	IngestBurst int
}

Config holds all runtime settings for the gateway.

func Load

func Load() (Config, error)

Load reads configuration from the environment, applying defaults.

Jump to

Keyboard shortcuts

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