Documentation ¶
Index ¶
- func Exclusion(start *core.ObjectAndRelation, children ...*core.RelationTupleTreeNode) *core.RelationTupleTreeNode
- func FindOperation[T any](rewrite *core.UsersetRewrite, opPath OperationPath) *T
- func HasThis(rewrite *core.UsersetRewrite) bool
- func Intersection(start *core.ObjectAndRelation, children ...*core.RelationTupleTreeNode) *core.RelationTupleTreeNode
- func Leaf(start *core.ObjectAndRelation, subjects ...*core.ObjectAndRelation) *core.RelationTupleTreeNode
- func Union(start *core.ObjectAndRelation, children ...*core.RelationTupleTreeNode) *core.RelationTupleTreeNode
- func WalkRewrite(rewrite *core.UsersetRewrite, handler WalkHandler) interface{}
- type OperationPath
- type WalkHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exclusion ¶
func Exclusion(start *core.ObjectAndRelation, children ...*core.RelationTupleTreeNode) *core.RelationTupleTreeNode
Exclusion constructs a RelationTupleTreeNode exclusion operation.
func FindOperation ¶ added in v1.8.0
func FindOperation[T any](rewrite *core.UsersetRewrite, opPath OperationPath) *T
FindOperation finds the operation at the given path in the rewrite, if any.
func HasThis ¶
func HasThis(rewrite *core.UsersetRewrite) bool
HasThis returns true if there exists a `_this` node anywhere within the given rewrite. If the rewrite is nil, returns false.
func Intersection ¶
func Intersection(start *core.ObjectAndRelation, children ...*core.RelationTupleTreeNode) *core.RelationTupleTreeNode
Intersection constructs a RelationTupleTreeNode intersection operation.
func Leaf ¶
func Leaf(start *core.ObjectAndRelation, subjects ...*core.ObjectAndRelation) *core.RelationTupleTreeNode
Leaf constructs a RelationTupleTreeNode leaf.
func Union ¶
func Union(start *core.ObjectAndRelation, children ...*core.RelationTupleTreeNode) *core.RelationTupleTreeNode
Union constructs a RelationTupleTreeNode union operation.
func WalkRewrite ¶
func WalkRewrite(rewrite *core.UsersetRewrite, handler WalkHandler) interface{}
WalkRewrite walks a userset rewrite tree, invoking the handler found on each node of the tree until the handler returns a non-nil value, which is in turn returned from this function. Returns nil if no valid value was found. If the rewrite is nil, returns nil.
Types ¶
type OperationPath ¶ added in v1.8.0
type OperationPath = []uint32
type WalkHandler ¶
type WalkHandler func(childOneof *core.SetOperation_Child) interface{}
WalkHandler is a function invoked for each node in the rewrite tree. If it returns non-nil, that value is returned from the walk. Otherwise, the walk continues.