config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	Region           string
	S3Bucket         string
	LogRetentionDays int
}

type AuthConfig

type AuthConfig struct {
	APIKey    string // resolved from api_key_env
	JWTSecret string // resolved from jwt_secret_env
}

type CORSConfig

type CORSConfig struct {
	AllowedOrigins []string
	AllowedMethods []string
}

type CloudConfig

type CloudConfig struct {
	Provider string // aws | gcp | none
	AWS      AWSConfig
	GCP      GCPConfig
}

type Config

type Config struct {
	Environment  string
	Server       ServerConfig
	Database     DatabaseConfig
	Logging      LoggingConfig
	Webhook      WebhookConfig
	Auth         AuthConfig
	CORS         CORSConfig
	Cloud        CloudConfig
	Integrations IntegrationsConfig
	RateLimit    RateLimitConfig
	Retention    RetentionConfig
}

Config is the fully-resolved runtime configuration.

func Load

func Load() (*Config, error)

Load is the default entry (no config file).

func LoadFromFile

func LoadFromFile(path string) (*Config, error)

LoadFromFile loads config with precedence: defaults < YAML < env. Secrets referenced via *_env fields are resolved from env vars.

type DatabaseConfig

type DatabaseConfig struct {
	URL                      string // resolved from url_env
	MaxConnections           int
	MaxIdleConnections       int
	ConnectionTimeoutSeconds int
}

type DatadogConfig

type DatadogConfig struct {
	Enabled bool
	APIKey  string
	Service string
	Env     string
}

type GCPConfig

type GCPConfig struct {
	ProjectID string
	Region    string
}

type IntegrationsConfig

type IntegrationsConfig struct {
	Sentry  SentryConfig
	Datadog DatadogConfig
	Slack   SlackConfig
}

type LoggingConfig

type LoggingConfig struct {
	Level  string
	Format string
}

type RateLimitConfig

type RateLimitConfig struct {
	RequestsPerMinute int
	Burst             int
}

type RetentionConfig added in v1.2.0

type RetentionConfig struct {
	// LogRetentionDays — request_logs older than this are swept by the
	// trimmer. Defaults to 10.
	LogRetentionDays int
	// TrimmerIntervalMinutes — how often the trimmer wakes. Defaults to 60.
	TrimmerIntervalMinutes int
	// DemoWorkspaceDailyCap — requests/day cap for the seeded "local"
	// workspace (anonymous demo traffic). 0 = unlimited. Defaults to 200.
	// Signed-up workspaces get no cap by default; change via the
	// workspaces.max_daily_requests column per-workspace if needed.
	DemoWorkspaceDailyCap int
}

RetentionConfig controls the background log-trimmer + anonymous-workspace quota. Hosted deployments tune these to stay within storage limits and prevent a runaway SDK integration from draining the demo's free-tier resources.

type SentryConfig

type SentryConfig struct {
	DSN        string // resolved from dsn_env
	SampleRate float64
}

type ServerConfig

type ServerConfig struct {
	Host                   string
	Port                   int
	Mode                   string // local | hosted
	ReadTimeoutSeconds     int
	WriteTimeoutSeconds    int
	ShutdownTimeoutSeconds int
}

type SlackConfig

type SlackConfig struct {
	Enabled    bool
	WebhookURL string // resolved from webhook_url_env
}

type WebhookConfig

type WebhookConfig struct {
	MaxAttempts    int
	BaseDelayMs    int
	TimeoutSeconds int
}

Jump to

Keyboard shortcuts

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