ast

package
v0.11.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Child

type Child interface {
	// AsRewrite returns the child as a subject-set rewrite, as relations
	// require a top-level rewrite, even if just one child was parsed.
	AsRewrite() *SubjectSetRewrite
}

Child are all possible types of subject-set rewrites.

type Children

type Children = []Child

type ComputedSubjectSet

type ComputedSubjectSet struct {
	Relation string `json:"relation"`
}

func (*ComputedSubjectSet) AsRewrite

func (c *ComputedSubjectSet) AsRewrite() *SubjectSetRewrite

type InvertResult

type InvertResult struct {
	Child Child `json:"inverted"`
}

InvertResult inverts the check result of the child.

func (*InvertResult) AsRewrite

func (i *InvertResult) AsRewrite() *SubjectSetRewrite

type Operator

type Operator int
const (
	OperatorOr  Operator = iota // or
	OperatorAnd                 // and
)

func (Operator) MarshalJSON

func (i Operator) MarshalJSON() ([]byte, error)

func (Operator) String

func (i Operator) String() string

type Relation

type Relation struct {
	Name              string             `json:"name"`
	Types             []RelationType     `json:"types,omitempty"`
	SubjectSetRewrite *SubjectSetRewrite `json:"rewrite,omitempty"`
}

type RelationType

type RelationType struct {
	Namespace string `json:"namespace"`
	Relation  string `json:"relation,omitempty"` // optional
}

type SubjectSetRewrite

type SubjectSetRewrite struct {
	Operation Operator `json:"operator"`
	Children  Children `json:"children"`
}

func (*SubjectSetRewrite) AsRewrite

func (r *SubjectSetRewrite) AsRewrite() *SubjectSetRewrite

type TupleToSubjectSet

type TupleToSubjectSet struct {
	Relation                   string `json:"relation"`
	ComputedSubjectSetRelation string `json:"computed_subject_set_relation"`
}

func (*TupleToSubjectSet) AsRewrite

func (t *TupleToSubjectSet) AsRewrite() *SubjectSetRewrite

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL