config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config provides configuration file support for pdf-cli.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

ConfigPath returns the path to the config file.

func Reset

func Reset()

Reset clears the global config (useful for testing).

func Save

func Save(cfg *Config) error

Save writes the config to the config file.

Types

type CompressConfig

type CompressConfig struct {
	Quality string `yaml:"quality"` // low, medium, high
}

CompressConfig holds compression settings.

type Config

type Config struct {
	Defaults DefaultsConfig `yaml:"defaults"`
	Compress CompressConfig `yaml:"compress"`
	Encrypt  EncryptConfig  `yaml:"encrypt"`
	OCR      OCRConfig      `yaml:"ocr"`
}

Config holds the application configuration.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with default values.

func Get

func Get() *Config

Get returns the global configuration, loading it if necessary.

func Load

func Load() (*Config, error)

Load reads the config file and returns the configuration. If the file doesn't exist, returns default config. Environment variables can override config file values.

type DefaultsConfig

type DefaultsConfig struct {
	OutputFormat string `yaml:"output_format"` // json, csv, tsv, human
	Verbose      bool   `yaml:"verbose"`
	ShowProgress bool   `yaml:"show_progress"`
}

DefaultsConfig holds default settings.

type EncryptConfig

type EncryptConfig struct {
	Algorithm string `yaml:"algorithm"` // aes128, aes256
}

EncryptConfig holds encryption settings.

type OCRConfig

type OCRConfig struct {
	Language string `yaml:"language"` // eng, deu, fra, etc.
	Backend  string `yaml:"backend"`  // auto, native, wasm
}

OCRConfig holds OCR settings.

Jump to

Keyboard shortcuts

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