Documentation
¶
Overview ¶
Package builder exposes an API to create a River configuration file by constructing a set of tokens.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
A Block encapsulates a body within a named and labeled River block. Blocks must be created by calling NewBlock, but its public struct fields may be safely modified by callers.
type Body ¶
type Body struct {
// contains filtered or unexported fields
}
Body is a list of block and attribute statements. A Body cannot be manually created, but is retrieved from a File or Block.
func (*Body) AppendBlock ¶
AppendBlock adds a new block inside of the Body.
func (*Body) AppendFrom ¶
func (b *Body) AppendFrom(goValue interface{})
AppendFrom sets attributes and appends blocks defined by goValue into the Body. If any value reachable from goValue implements Tokenizer, the printed tokens will instead be retrieved by calling the RiverTokenize method.
goValue must be a struct or a pointer to a struct that contains River struct tags.
func (*Body) AppendTokens ¶
AppendTokens appends raw tokens to the Body.
func (*Body) SetAttributeTokens ¶
SetAttributeTokens sets an attribute to the Body whose value is a set of raw tokens. If the attribute was previously set, its value tokens are updated.
Attributes will be written out in the order they were initially created.
func (*Body) SetAttributeValue ¶
SetAttributeValue sets an attribute in the Body whose value is converted from a Go value to a River value. The Go value is encoded using the normal Go to River encoding rules. If any value reachable from goValue implements Tokenizer, the printed tokens will instead be retrieved by calling the RiverTokenize method.
If the attribute was previously set, its value tokens are updated.
Attributes will be written out in the order they were initially crated.
type Expr ¶
type Expr struct {
// contains filtered or unexported fields
}
An Expr represents a single River expression.
func (*Expr) SetValue ¶
func (e *Expr) SetValue(goValue interface{})
SetValue sets the Expr to a River value converted from a Go value. The Go value is encoded using the normal Go to River encoding rules. If any value reachable from goValue implements Tokenizer, the printed tokens will instead be retrieved by calling the RiverTokenize method.
type File ¶
type File struct {
// contains filtered or unexported fields
}
A File represents a River configuration file.