Documentation
¶
Index ¶
- Variables
- func GetRegoModuleAccess() []byte
- func GetRegoModuleAssign() []byte
- func GetRegoModuleContent() []byte
- func Lua(code []byte) (*lua.FunctionProto, error)
- func Rego(policy string, name string, modules ...*ast.Module) (*ast.Compiler, error)
- func RegoFormat(policy string) (string, error)
- func RegoQueryAccess(ctx context.Context, comp *ast.Compiler) (rego.PreparedEvalQuery, error)
- func RegoQueryAssign(ctx context.Context, comp *ast.Compiler) (rego.PreparedEvalQuery, error)
- func RegoQueryContent(ctx context.Context, comp *ast.Compiler) (rego.PreparedEvalQuery, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ModuleAssign is the module to import to handle rego team policy. ModuleAssign = ast.MustParseModuleWithOpts( regoAssignModule, ast.ParserOptions{ RegoVersion: ast.RegoVersion(1), AllFutureKeywords: true, Capabilities: ast.CapabilitiesForThisVersion(), }, ) // ModuleAccess is the module to import to handle rego access policy. ModuleAccess = ast.MustParseModuleWithOpts( regoAccessModule, ast.ParserOptions{ RegoVersion: ast.RegoVersion(1), AllFutureKeywords: true, Capabilities: ast.CapabilitiesForThisVersion(), }, ) // ModuleContent is the module to import to handle rego content policy. ModuleContent = ast.MustParseModuleWithOpts( regoContentModule, ast.ParserOptions{ RegoVersion: ast.RegoVersion(1), AllFutureKeywords: true, Capabilities: ast.CapabilitiesForThisVersion(), }, ) )
Functions ¶
func GetRegoModuleAccess ¶
func GetRegoModuleAccess() []byte
GetRegoModuleAccess returns the code for the access module.
func GetRegoModuleAssign ¶
func GetRegoModuleAssign() []byte
GetRegoModuleAssign returns the code for the assign module.
func GetRegoModuleContent ¶
func GetRegoModuleContent() []byte
GetRegoModuleContent returns the code for the content module.
func Rego ¶
Rego returns a compiler that compiled the given policy. It is compiled with the with given modules.
func RegoFormat ¶
RegoFormat formats the given rego policy.
func RegoQueryAccess ¶
RegoQueryAccess runs the access query using the given *ast.Compiler.
func RegoQueryAssign ¶
RegoQueryAssign runs the assign query using the given *ast.Compiler.
func RegoQueryContent ¶
RegoQueryContent runs the content query using the given *ast.Compiler.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.