{"modulePath":"github.com/telecomposeio/docker-cli","version":"v0.0.0-20230330191823-de0d30ff24fa","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package interpolation\n\n## Constants\n\n```go\nconst PathMatchAll = \"*\"\n```\nPathMatchAll is a token used as part of a Path to match any key at that level in the nested structure\n\n```go\nconst PathMatchList = \"[]\"\n```\nPathMatchList is a token used as part of a Path to match items in a list\n\n## Functions\n\n```go\nfunc Interpolate(config map[string]interface{}, opts Options) (map[string]interface{}, error)\n```\nInterpolate replaces variables in a string with the values from a mapping\n\n## Types\n\n```go\ntype Cast func(value string) (interface{}, error)\n```\nCast a value to a new type, or return an error if the value can't be cast\n\n```go\ntype LookupValue func(key string) (string, bool)\n```\nLookupValue 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.\n\n```go\ntype Options struct {\n\t// LookupValue from a key\n\tLookupValue LookupValue\n\t// TypeCastMapping maps key paths to functions to cast to a type\n\tTypeCastMapping map[Path]Cast\n\t// Substitution function to use\n\tSubstitute func(string, template.Mapping) (string, error)\n}\n```\nOptions supported by Interpolate\n\n```go\ntype Path string\n```\nPath is a dotted path of keys to a value in a nested mapping structure. A \\* section in a path will match any key in the mapping structure.\n\n```go\nfunc NewPath(items ...string) Path\n```\nNewPath returns a new Path\n\n```go\nfunc (p Path) Next(part string) Path\n```\nNext returns a new path by append part to the current path\n\n","path":"github.com/telecomposeio/docker-cli/cli/compose/interpolation","name":"interpolation","synopsis":"","isRedistributable":true}
