config

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveConfig

func SaveConfig(persister *inyaml.Persister, config *Config) error

SaveConfig saves the configuration to the persister

Types

type Config

type Config struct {
	Template   Template   `yaml:"template" json:"template" default:""`
	Output     Output     `yaml:"output" json:"output" default:""`
	Variables  Variables  `yaml:"variables" json:"variables" default:"{}"`
	Engine     Engine     `yaml:"engine" json:"engine" default:"pdflatex"`
	Conversion Conversion `yaml:"conversion" json:"conversion"`
}

Config defines the YAML configuration schema for AutoPDF

func GetConfig

func GetConfig(persister *inyaml.Persister) (*Config, error)

GetConfig retrieves the configuration from the persister

func GetDefaultConfig

func GetDefaultConfig() *Config

GetDefaultConfig returns a default configuration

func NewConfigFromYAML

func NewConfigFromYAML(yamlData []byte) (*Config, error)

NewConfigFromYAML creates a new Config from YAML data

func (*Config) Marshal

func (c *Config) Marshal() ([]byte, error)

func (*Config) String

func (c *Config) String() string

func (*Config) ToJSON

func (c *Config) ToJSON() (string, error)

ToJSON converts a Config to JSON string representation

func (*Config) Unmarshal

func (c *Config) Unmarshal(data []byte) error

type Conversion

type Conversion struct {
	Enabled bool     `yaml:"enabled" json:"enabled" default:"false"`
	Formats []string `yaml:"formats" json:"formats" default:"[]"`
}

type Engine

type Engine string

func (Engine) String

func (e Engine) String() string

type Output

type Output string

func (Output) String

func (o Output) String() string

type Template

type Template string

func (Template) String

func (t Template) String() string

type Variables

type Variables map[string]string

func (Variables) String

func (v Variables) String() string

Jump to

Keyboard shortcuts

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