config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteDefault

func WriteDefault(path string) error

WriteDefault writes a default config file to the given path.

Types

type AuthConfig

type AuthConfig struct {
	APIKey Secret `mapstructure:"api_key"`
}

AuthConfig holds the Pulse API key used to authenticate requests.

type Config

type Config struct {
	Server       ServerConfig       `mapstructure:"server"`
	Database     DatabaseConfig     `mapstructure:"database"`
	Log          LogConfig          `mapstructure:"log"`
	Auth         AuthConfig         `mapstructure:"auth"`
	FlareSolverr FlareSolverrConfig `mapstructure:"flaresolverr"`

	// ConfigFile is the path of the config file that was loaded, if any.
	ConfigFile string `mapstructure:"-"`
}

Config holds all application configuration. Values are loaded from config.yaml and can be overridden by PULSE_* environment variables (e.g. PULSE_SERVER_PORT=9696).

func Load

func Load(configPath string) (*Config, error)

Load reads configuration from file, env, and flags, then returns a Config.

type DatabaseConfig

type DatabaseConfig struct {
	Driver string `mapstructure:"driver"`
	DSN    Secret `mapstructure:"dsn"`
}

DatabaseConfig selects and configures the database driver.

type FlareSolverrConfig

type FlareSolverrConfig struct {
	// URL is the FlareSolverr endpoint (e.g., "http://localhost:8191").
	// Empty means disabled.
	URL string `mapstructure:"url"`
}

FlareSolverrConfig holds optional FlareSolverr proxy settings. When URL is set, Pulse will use FlareSolverr to bypass Cloudflare challenges on protected indexer sites.

type LogConfig

type LogConfig struct {
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
}

LogConfig controls log output format and verbosity.

type Secret

type Secret string

Secret is a string value that is redacted when printed.

func (Secret) String

func (s Secret) String() string

String redacts the value.

func (Secret) Value

func (s Secret) Value() string

Value returns the underlying string.

type ServerConfig

type ServerConfig struct {
	Host        string `mapstructure:"host"`
	Port        int    `mapstructure:"port"`
	ExternalURL string `mapstructure:"external_url"` // e.g., "http://pulse:9696" — for Torznab proxy URLs
}

ServerConfig controls the HTTP server.

Jump to

Keyboard shortcuts

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