config

package
v0.0.0-...-11e1b04 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Server configuration
	Port int `envconfig:"PORT" default:"10001"`

	// Recording configuration
	FrameRate   int    `envconfig:"FRAME_RATE" default:"10"`
	DisplayNum  int    `envconfig:"DISPLAY_NUM" default:"1"`
	MaxSizeInMB int    `envconfig:"MAX_SIZE_MB" default:"500"`
	OutputDir   string `envconfig:"OUTPUT_DIR" default:"."`

	// Absolute or relative path to the ffmpeg binary. If empty the code falls back to "ffmpeg" on $PATH.
	PathToFFmpeg string `envconfig:"FFMPEG_PATH" default:"ffmpeg"`

	// DevTools proxy configuration
	DevToolsProxyPort int  `envconfig:"DEVTOOLS_PROXY_PORT" default:"9222"`
	LogCDPMessages    bool `envconfig:"LOG_CDP_MESSAGES" default:"false"`

	// How long to wait after the last active request before re-enabling scale-to-zero.
	ScaleToZeroCooldown time.Duration `envconfig:"SCALE_TO_ZERO_COOLDOWN" default:"1s"`

	// ChromeDriver proxy: external port where the proxy listens.
	ChromeDriverProxyPort int `envconfig:"CHROMEDRIVER_PROXY_PORT" default:"9224"`
	// Internal ChromeDriver upstream used by the ChromeDriver proxy.
	ChromeDriverUpstreamAddr string `envconfig:"CHROMEDRIVER_UPSTREAM_ADDR" default:"127.0.0.1:9225"`
	// DevTools proxy address passed to ChromeDriver as goog:chromeOptions.debuggerAddress.
	// If empty, it is derived from DevToolsProxyPort as 127.0.0.1:<port>.
	DevToolsProxyAddr string `envconfig:"DEVTOOLS_PROXY_ADDR" default:""`

	// S2 durable event storage. All three fields must be set to enable the S2 sink.
	S2Basin       string `envconfig:"S2_BASIN"        default:""`
	S2AccessToken string `envconfig:"S2_ACCESS_TOKEN" default:""`
	S2Stream      string `envconfig:"S2_STREAM"       default:""`
}

Config holds all configuration for the server

func Load

func Load() (*Config, error)

Load loads configuration from environment variables

func (*Config) LogValue

func (c *Config) LogValue() slog.Value

LogValue implements slog.LogValuer, redacting secret fields.

Jump to

Keyboard shortcuts

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