Documentation ¶
Overview ¶
Package template implements string substitution in the style of Python's string.Template library as extended by Docker Compose.
References: - https://github.com/docker/compose/blob/4a51af09d6cdb9407a6717334333900327bc9302/compose/config/interpolation.py - https://docs.python.org/3/library/string.html#string.Template - https://github.com/compose-spec/compose-spec/blob/b369fe5e02d80b619d14974cd1e64e7eea1b2345/spec.md#interpolation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Substitute ¶
func Substitute(template Template, env Environment) (string, error)
Types ¶
type Environment ¶
var ErrEnvironment Environment = errEnvironment{}
type Literal ¶
type Literal struct {
Value string
}
func (*Literal) Substitute ¶
func (lit *Literal) Substitute(w io.Writer, env Environment) error
type MapEnvironment ¶
type Sequence ¶
type Sequence struct {
Elements []Template
}
func (*Sequence) Substitute ¶
func (seq *Sequence) Substitute(w io.Writer, env Environment) error
Click to show internal directories.
Click to hide internal directories.