Documentation
¶
Index ¶
Constants ¶
View Source
const (
VariantFileExt = ".variant"
)
Variables ¶
View Source
var JSONPathFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "data", Type: cty.String, }, { Name: "query", Type: cty.String, }, }, VarParam: &function.Parameter{ Name: "file", Type: cty.String, }, Type: func(args []cty.Value) (cty.Type, error) { data := args[0].AsString() query := args[1].AsString() v, err := getValueAtJSONPath(data, query) return v.Type(), err }, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { data := args[0].AsString() query := args[1].AsString() v, err := getValueAtJSONPath(data, query) return v, err }, })
JSONPathFunc takes JSON and a query to fetch the value for the query.
Functions ¶
func FindVariantFiles ¶
func FindVariantFiles(fs *fs.FileSystem, path string) ([]string, error)
FindVariantFiles walks the given path and returns the files ending whose ext is .variant Also, it returns the path if the path is just a file and a HCL file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.