INNER CODE UNIT · Go
registerParseConfig
open-policy-agent/conftest · builtins/parse_config.go:22
func registerParseConfig() {
decl := rego.Function{
Name: "parse_config",
Decl: types.NewFunction(
types.Args(types.S, types.S), // parser name, configuration
types.NewObject(nil, types.NewDynamicProperty(types.S, types.NewAny())), // map[string]any aka JSON
),
}
rego.RegisterBuiltin2(&decl, parseConfig)
}
func registerParseConfigFile() {
decl := rego.Function{
Name: "parse_config_file",
Decl: types.NewFunction(
types.Args(types.S), // path to configuration file
types.NewObject(nil, types.NewDynamicProperty(types.S, types.NewAny())), // map[string]any aka JSON
),