config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Presets = map[Preset]presetDimensions{
	PresetWidescreen: {Width: 1920, Height: 1080},
	PresetDesktop:    {Width: 1440, Height: 900},
	PresetSquare:     {Width: 1200, Height: 1200},
	PresetPortrait:   {Width: 1080, Height: 1350},
}

Presets maps preset name strings to their width and height.

Functions

func PresetNames

func PresetNames() []string

PresetNames returns the ordered list of available preset names. This is maintained as a literal slice because Go maps are unordered.

Types

type Config

type Config struct {
	URL        string
	Dir        string
	Filename   string
	Preset     Preset
	Width      int
	Height     int
	Zoom       float64
	Scroll     int
	Delay      time.Duration
	ChromePath string
}

Config holds all configuration for taking a screenshot.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config populated with sensible defaults.

func (*Config) ApplyPreset

func (c *Config) ApplyPreset(preset Preset) error

ApplyPreset sets Width and Height from the named preset.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that the configuration is complete and consistent.

type Preset

type Preset string

Preset represents a named screen resolution preset.

const (
	PresetWidescreen Preset = "widescreen"
	PresetDesktop    Preset = "desktop"
	PresetSquare     Preset = "square"
	PresetPortrait   Preset = "portrait"
	PresetCustom     Preset = "custom"
)

Jump to

Keyboard shortcuts

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