package json

import "github.com/open-policy-agent/opa/ast/json"

Index

Types

type MarshalOptions

type MarshalOptions struct {
	// IncludeLocation toggles the marshaling of location information
	IncludeLocation NodeToggle
	// IncludeLocationText additionally/optionally includes the text of the location
	IncludeLocationText bool
	// ExcludeLocationFile additionally/optionally excludes the file of the location
	// Note that this is inverted (i.e. not "include" as the default needs to remain false)
	ExcludeLocationFile bool
}

MarshalOptions defines the options for JSON marshaling, currently only toggling the marshaling of location information is supported

type NodeToggle

type NodeToggle struct {
	Term           bool
	Package        bool
	Comment        bool
	Import         bool
	Rule           bool
	Head           bool
	Expr           bool
	SomeDecl       bool
	Every          bool
	With           bool
	Annotations    bool
	AnnotationsRef bool
}

NodeToggle is a generic struct to allow the toggling of settings for different ast node types

type Options

type Options struct {
	MarshalOptions MarshalOptions
}

Options defines the options for JSON operations, currently only marshaling can be configured

Source Files

json.go

Version
v0.65.0
Published
May 30, 2024
Platform
js/wasm
Last checked
21 minutes ago

Tools for package owners.