internal

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Logger         *slog.Logger `json:"-"`
	LogLevel       string       `json:"log_level"`
	DevMode        bool         `json:"dev_mode"`
	DataDir        string       `json:"data_dir"`
	HttpPort       int          `json:"http_port"`
	DnsPort        int          `json:"dns_port"`
	DotPort        int          `json:"dot_port"`
	Upstreams      []string     `json:"upstreams"`
	BlockListURLs  []string     `json:"blocklist_urls"`
	AllowedHosts   []string     `json:"allowed_hosts"`
	NoiseFilterURL string       `json:"noise_filter_url"`
	MetricsAuth    string       `json:"-"`
	MaxCacheSize   int          `json:"max_cache_size"`
	DisableIpinfo  bool         `json:"disable_ipinfo"`
	CronSchedule   struct {
		Downloader  string `json:"downloader"`
		CacheReaper string `json:"cache_reaper"`
		IPInfo      string `json:"ipinfo"`
	} `json:"cron_schedule"`
	CacheTtlFloor        time.Duration `json:"cache_ttl_floor"`
	RequireProxyProtocol bool          `json:"require_proxy_protocol"`
	TrustedProxies       []string      `json:"trusted_proxies,omitempty"`
	EnableECS            bool          `json:"enable_ecs"`
	Timeouts             struct {
		Read  time.Duration `json:"read"`
		Write time.Duration `json:"write"`
		Dial  time.Duration `json:"dial"`
	} `json:"timeouts"`
}

func (*App) LogValue

func (app *App) LogValue() slog.Value

LogValue implements slog.LogValuer to ensure nested durations are formatted as strings.

func (*App) NewBlockLists added in v0.14.0

func (app *App) NewBlockLists(crontab *cron.Cron) ([]*blocklist.BlockList, *blocklist.Updater, error)

func (*App) RunServer

func (app *App) RunServer(ctx context.Context) error

Jump to

Keyboard shortcuts

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