Table of Contents

Class CompilationParameters

Namespace
OpaDotNet.Compilation.Abstractions
Assembly
OpaDotNet.Compilation.Abstractions.dll

Compilation parameters.

public record CompilationParameters : IEquatable<CompilationParameters>
Inheritance
CompilationParameters
Implements
Inherited Members

Constructors

CompilationParameters()

public CompilationParameters()

CompilationParameters(CompilationParameters)

protected CompilationParameters(CompilationParameters original)

Parameters

original CompilationParameters

Properties

CapabilitiesBytes

Capabilities json that defines the built-in functions and other language features that policies may depend on.

public ReadOnlyMemory<byte> CapabilitiesBytes { get; set; }

Property Value

ReadOnlyMemory<byte>

CapabilitiesFilePath

Capabilities file that defines the built-in functions and other language features that policies may depend on. CapabilitiesFilePath overrides any other specified capabilities.

public string? CapabilitiesFilePath { get; set; }

Property Value

string

CapabilitiesStream

Capabilities json that defines the built-in functions and other language features that policies may depend on.

[Obsolete("Use CompilationParameters.CapabilitiesBytes instead")]
public Stream? CapabilitiesStream { get; init; }

Property Value

Stream

CapabilitiesVersion

OPA capabilities version. If set, compiler will merge capabilities of specified version with any additional custom capabilities.

public string? CapabilitiesVersion { get; set; }

Property Value

string

Debug

If true compiler will log debug information; otherwise false;

public bool Debug { get; set; }

Property Value

bool

DisablePrintStatements

If print statements are not enabled, calls to print() are erased at compile-time

public bool DisablePrintStatements { get; set; }

Property Value

bool

Entrypoints

Which documents (entrypoints) will be queried when asking for policy decisions.

public IReadOnlyList<string>? Entrypoints { get; set; }

Property Value

IReadOnlyList<string>

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Follow symlinks in the input set of paths when building the bundle.

public bool FollowSymlinks { get; set; }

Property Value

bool

Ignore

Set file and directory names to ignore during loading (e.g., '.*' excludes hidden files).

public IReadOnlySet<string> Ignore { get; set; }

Property Value

IReadOnlySet<string>

IsBundle

Specifies if compilation source if file or bundle.

public bool IsBundle { get; set; }

Property Value

bool

OutputPath

Path compiler will use to store intermediate compilation artifacts.

public string? OutputPath { get; set; }

Property Value

string

Remarks

Directory must exist and requires write permissions.

PruneUnused

Exclude dependents of entrypoints.

public bool PruneUnused { get; set; }

Property Value

bool

RegoVersion

Sets OPA features and behaviors that will be enabled by default.

public RegoVersion RegoVersion { get; set; }

Property Value

RegoVersion

Revision

Output bundle revision.

public string? Revision { get; set; }

Property Value

string

Methods

Equals(CompilationParameters?)

public virtual bool Equals(CompilationParameters? other)

Parameters

other CompilationParameters

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(CompilationParameters?, CompilationParameters?)

public static bool operator ==(CompilationParameters? left, CompilationParameters? right)

Parameters

left CompilationParameters
right CompilationParameters

Returns

bool

operator !=(CompilationParameters?, CompilationParameters?)

public static bool operator !=(CompilationParameters? left, CompilationParameters? right)

Parameters

left CompilationParameters
right CompilationParameters

Returns

bool