package interpolation
import "github.com/compose-spec/compose-go/v2/interpolation"
Index ¶
- func Interpolate(config map[string]interface{}, opts Options) (map[string]interface{}, error)
- type Cast
- type LookupValue
- type Options
Functions ¶
func Interpolate ¶
Interpolate replaces variables in a string with the values from a mapping
Types ¶
type Cast ¶
Cast a value to a new type, or return an error if the value can't be cast
type LookupValue ¶
LookupValue is a function which maps from variable names to values. Returns the value as a string and a bool indicating whether the value is present, to distinguish between an empty string and the absence of a value.
type Options ¶
type Options struct { // LookupValue from a key LookupValue LookupValue // TypeCastMapping maps key paths to functions to cast to a type TypeCastMapping map[tree.Path]Cast // Substitution function to use Substitute func(string, template.Mapping) (string, error) }
Options supported by Interpolate
Source Files ¶
- Version
- v2.4.8 (latest)
- Published
- Feb 10, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 2 months ago –
Tools for package owners.