Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMatrixNeedsCollection = errors.New("matrix should contain a collection")
ErrMatrixNeedsCollection is returned when the matrix modifier does not contain a collection (either map or slice) inside.
var ErrMatrixNeedsListOfMaps = errors.New("matrix with a list can only contain maps as it's items")
ErrMatrixNeedsListOfMaps is returned when the matrix modifier contains something other than maps (e.g. lists or scalars) as it's items.
var ErrNeedMap = errors.New("first document should be a map")
ErrNeedMap is returned when the input document passed to preprocessor does not contain a map as it's "outer" layer.
Functions ¶
This section is empty.
Types ¶
type Preprocessor ¶
type Preprocessor struct {
// contains filtered or unexported fields
}
A Preprocessor for YAML files with matrix modifiers.
func New ¶
func New(in []byte) (*Preprocessor, error)
New constructs preprocessor by loading the first YAML document from the supplied byte slice.
func NewFromFile ¶
func NewFromFile(path string) (*Preprocessor, error)
NewFromFile constructs preprocessor by loading the first YAML document from the file located at path.
func (*Preprocessor) Dump ¶
func (p *Preprocessor) Dump() ([]byte, error)
Dump marshals the loaded (and possibly preprocessed) YAML document back.
func (*Preprocessor) Run ¶
func (p *Preprocessor) Run() error
Run preprocesses matrix modifiers in the loaded YAML document.