Documentation ¶
Overview ¶
Package generator converts Pomerium Policy Language into Rego.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Criterion ¶
type Criterion interface { DataType() CriterionDataType Name() string GenerateRule(subPath string, data parser.Value) (rule *ast.Rule, additionalRules []*ast.Rule, err error) }
A Criterion generates rego rules based on data.
type CriterionConstructor ¶
A CriterionConstructor is a function which returns a Criterion for a Generator.
type CriterionDataType ¶
type CriterionDataType string
A CriterionDataType describes the expected format of the data to be sent to the criterion.
const ( // CriterionDataTypeUnknown indicates that the type of data is unknown. CriterionDataTypeUnknown CriterionDataType = "" // CriterionDataTypeUnused indicates that the data is unused. CriterionDataTypeUnused CriterionDataType = "unused" )
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
A Generator generates a rego script from a policy.
func (*Generator) GetCriterion ¶
GetCriterion gets a Criterion for the given name.
type Option ¶
type Option func(*Generator)
An Option configures the Generator.
func WithCriterion ¶
func WithCriterion(criterionConstructor CriterionConstructor) Option
WithCriterion adds a Criterion to the generator's known criteria.
Click to show internal directories.
Click to hide internal directories.