mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-25 17:55:15 -06:00
e8deba62bd
This commit adds support for named argument declarations for built-in functions as well as additional metadata/annotations on built-in functions (e.g., descriptions, categories, etc.) This commit allows us to generate a data file (builtin_metadata.json) that other tools can consume to improve the Rego authoring experience. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com> Co-authored-by: Torin Sandall <torinsandall@gmail.com>
27 lines
799 B
Go
27 lines
799 B
Go
// Copyright 2016 The OPA Authors. All rights reserved.
|
|
// Use of this source code is governed by an Apache2
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/open-policy-agent/opa/cmd"
|
|
)
|
|
|
|
func main() {
|
|
if err := cmd.RootCommand.Execute(); err != nil {
|
|
fmt.Println(err)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
// Capabilities + built-in metadata file generation:
|
|
//go:generate build/gen-run-go.sh internal/cmd/genopacapabilities/main.go capabilities.json
|
|
//go:generate build/gen-run-go.sh internal/cmd/genbuiltinmetadata/main.go builtin_metadata.json
|
|
|
|
// WASM base binary generation:
|
|
//go:generate build/gen-run-go.sh internal/cmd/genopawasm/main.go -o internal/compiler/wasm/opa/opa.go internal/compiler/wasm/opa/opa.wasm internal/compiler/wasm/opa/callgraph.csv
|