Documentation
¶
Index ¶
- func SaveConfig(persister Store, config *Config) error
- type BoolVariable
- func (v BoolVariable) Get(path string) (Variable, bool)
- func (v BoolVariable) Keys() []string
- func (v BoolVariable) Len() int
- func (v BoolVariable) MarshalJSON() ([]byte, error)
- func (v *BoolVariable) Set(path string, value Variable) error
- func (v BoolVariable) String() string
- func (v BoolVariable) Type() VariableType
- func (v *BoolVariable) UnmarshalJSON(data []byte) error
- type Config
- type Conversion
- type Engine
- type MapVariable
- func (v MapVariable) Get(path string) (Variable, bool)
- func (v MapVariable) Keys() []string
- func (v MapVariable) Len() int
- func (v MapVariable) MarshalJSON() ([]byte, error)
- func (v *MapVariable) Set(path string, value Variable) error
- func (v MapVariable) String() string
- func (v MapVariable) Type() VariableType
- func (v *MapVariable) UnmarshalJSON(data []byte) error
- type NumberVariable
- func (v NumberVariable) Get(path string) (Variable, bool)
- func (v NumberVariable) Keys() []string
- func (v NumberVariable) Len() int
- func (v NumberVariable) MarshalJSON() ([]byte, error)
- func (v *NumberVariable) Set(path string, value Variable) error
- func (v NumberVariable) String() string
- func (v NumberVariable) Type() VariableType
- func (v *NumberVariable) UnmarshalJSON(data []byte) error
- type Output
- type SliceVariable
- func (v SliceVariable) Get(path string) (Variable, bool)
- func (v SliceVariable) Keys() []string
- func (v SliceVariable) Len() int
- func (v SliceVariable) MarshalJSON() ([]byte, error)
- func (v *SliceVariable) Set(path string, value Variable) error
- func (v SliceVariable) String() string
- func (v SliceVariable) Type() VariableType
- func (v *SliceVariable) UnmarshalJSON(data []byte) error
- type Store
- type StringVariable
- func (v StringVariable) Get(path string) (Variable, bool)
- func (v StringVariable) Keys() []string
- func (v StringVariable) Len() int
- func (v StringVariable) MarshalJSON() ([]byte, error)
- func (v *StringVariable) Set(path string, value Variable) error
- func (v StringVariable) String() string
- func (v StringVariable) Type() VariableType
- func (v *StringVariable) UnmarshalJSON(data []byte) error
- type Template
- type Variable
- type VariableSet
- func (vs *VariableSet) Flatten() map[string]string
- func (vs *VariableSet) Get(name string) (Variable, bool)
- func (vs *VariableSet) GetByPath(path string) (Variable, bool)
- func (vs *VariableSet) GetString(name string) (string, bool)
- func (vs *VariableSet) GetVariables() map[string]Variable
- func (vs *VariableSet) Keys() []string
- func (vs *VariableSet) Len() int
- func (vs *VariableSet) MarshalJSON() ([]byte, error)
- func (vs *VariableSet) Range(fn func(name string, value Variable) bool)
- func (vs *VariableSet) Set(name string, value Variable)
- func (vs *VariableSet) SetByPath(path string, value Variable) error
- func (vs *VariableSet) UnmarshalJSON(data []byte) error
- type VariableType
- type Variables
- func (v Variables) GetString(path string) (string, bool)
- func (v Variables) MarshalJSON() ([]byte, error)
- func (v Variables) MarshalYAML() (interface{}, error)
- func (v *Variables) SetString(path string, value string) error
- func (v Variables) String() string
- func (v *Variables) UnmarshalJSON(data []byte) error
- func (v *Variables) UnmarshalYAML(value *yaml.Node) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveConfig ¶
SaveConfig saves the configuration to the persister
Types ¶
type BoolVariable ¶
type BoolVariable struct {
Value bool
}
BoolVariable represents a boolean variable
func (BoolVariable) Keys ¶
func (v BoolVariable) Keys() []string
func (BoolVariable) Len ¶
func (v BoolVariable) Len() int
func (BoolVariable) MarshalJSON ¶
func (v BoolVariable) MarshalJSON() ([]byte, error)
func (BoolVariable) String ¶
func (v BoolVariable) String() string
func (BoolVariable) Type ¶
func (v BoolVariable) Type() VariableType
func (*BoolVariable) UnmarshalJSON ¶
func (v *BoolVariable) UnmarshalJSON(data []byte) error
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"`
Passes int `yaml:"passes" json:"passes" default:"1"`
UseLatexmk bool `yaml:"use_latexmk" json:"use_latexmk" default:"false"`
}
Config defines the YAML configuration schema for AutoPDF
func GetDefaultConfig ¶
func GetDefaultConfig() *Config
GetDefaultConfig returns a default configuration
func NewConfigFromYAML ¶
NewConfigFromYAML creates a new Config from YAML data
type Conversion ¶
type MapVariable ¶
MapVariable represents a map of nested variables
func NewMapVariable ¶
func NewMapVariable() *MapVariable
func (MapVariable) Keys ¶
func (v MapVariable) Keys() []string
func (MapVariable) Len ¶
func (v MapVariable) Len() int
func (MapVariable) MarshalJSON ¶
func (v MapVariable) MarshalJSON() ([]byte, error)
func (MapVariable) String ¶
func (v MapVariable) String() string
func (MapVariable) Type ¶
func (v MapVariable) Type() VariableType
func (*MapVariable) UnmarshalJSON ¶
func (v *MapVariable) UnmarshalJSON(data []byte) error
type NumberVariable ¶
type NumberVariable struct {
Value float64
}
NumberVariable represents a numeric variable
func (NumberVariable) Keys ¶
func (v NumberVariable) Keys() []string
func (NumberVariable) Len ¶
func (v NumberVariable) Len() int
func (NumberVariable) MarshalJSON ¶
func (v NumberVariable) MarshalJSON() ([]byte, error)
func (NumberVariable) String ¶
func (v NumberVariable) String() string
func (NumberVariable) Type ¶
func (v NumberVariable) Type() VariableType
func (*NumberVariable) UnmarshalJSON ¶
func (v *NumberVariable) UnmarshalJSON(data []byte) error
type SliceVariable ¶
type SliceVariable struct {
Values []Variable
}
SliceVariable represents a slice of variables
func NewSliceVariable ¶
func NewSliceVariable() *SliceVariable
func (SliceVariable) Keys ¶
func (v SliceVariable) Keys() []string
func (SliceVariable) Len ¶
func (v SliceVariable) Len() int
func (SliceVariable) MarshalJSON ¶
func (v SliceVariable) MarshalJSON() ([]byte, error)
func (SliceVariable) String ¶
func (v SliceVariable) String() string
func (SliceVariable) Type ¶
func (v SliceVariable) Type() VariableType
func (*SliceVariable) UnmarshalJSON ¶
func (v *SliceVariable) UnmarshalJSON(data []byte) error
type Store ¶
GetConfig retrieves the configuration from the persister Store is the persistence capability required by configuration serialization.
type StringVariable ¶
type StringVariable struct {
Value string
}
StringVariable represents a simple string variable
func (StringVariable) Keys ¶
func (v StringVariable) Keys() []string
func (StringVariable) Len ¶
func (v StringVariable) Len() int
func (StringVariable) MarshalJSON ¶
func (v StringVariable) MarshalJSON() ([]byte, error)
func (StringVariable) String ¶
func (v StringVariable) String() string
func (StringVariable) Type ¶
func (v StringVariable) Type() VariableType
func (*StringVariable) UnmarshalJSON ¶
func (v *StringVariable) UnmarshalJSON(data []byte) error
type Variable ¶
type Variable interface {
// String returns the string representation for template substitution
String() string
// Get retrieves a nested value by path (e.g., "foo.bar[0]")
Get(path string) (Variable, bool)
// Set sets a nested value by path
Set(path string, value Variable) error
// Keys returns the keys for map-like variables
Keys() []string
// Len returns the length for slice-like variables
Len() int
// Type returns the variable type
Type() VariableType
// MarshalJSON implements json.Marshaler
MarshalJSON() ([]byte, error)
// UnmarshalJSON implements json.Unmarshaler
UnmarshalJSON(data []byte) error
}
Variable represents a complex variable that can be: - A simple string value - A map of nested variables - A slice of values - Any combination of the above
type VariableSet ¶
type VariableSet struct {
// contains filtered or unexported fields
}
VariableSet represents a collection of variables with complex operations
func NewVariableSet ¶
func NewVariableSet() *VariableSet
func (*VariableSet) Flatten ¶
func (vs *VariableSet) Flatten() map[string]string
FlattenVariables flattens nested variables into dot-notation paths
func (*VariableSet) GetVariables ¶
func (vs *VariableSet) GetVariables() map[string]Variable
GetVariables returns a copy of the variables map for template processing
func (*VariableSet) Keys ¶
func (vs *VariableSet) Keys() []string
func (*VariableSet) Len ¶
func (vs *VariableSet) Len() int
func (*VariableSet) MarshalJSON ¶
func (vs *VariableSet) MarshalJSON() ([]byte, error)
func (*VariableSet) Range ¶
func (vs *VariableSet) Range(fn func(name string, value Variable) bool)
RangeVariables provides iteration over variables
func (*VariableSet) Set ¶
func (vs *VariableSet) Set(name string, value Variable)
func (*VariableSet) UnmarshalJSON ¶
func (vs *VariableSet) UnmarshalJSON(data []byte) error
type VariableType ¶
type VariableType int
VariableType represents the type of a variable
const ( VariableTypeString VariableType = iota VariableTypeMap VariableTypeSlice VariableTypeNumber VariableTypeBool )
type Variables ¶
type Variables struct {
*VariableSet
}
Variables represents a collection of complex variables
func (Variables) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (Variables) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler
func (*Variables) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler