namespace

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddComment

func AddComment(metadata *v0.Metadata, comment string) (*v0.Metadata, error)

AddComment adds a comment to the given metadata message.

func ComputedUserset

func ComputedUserset(relation string) *v0.SetOperation_Child

ComputesUserset creates a child for a set operation that follows a relation on the given starting object.

func Exclusion

func Exclusion(firstChild *v0.SetOperation_Child, rest ...*v0.SetOperation_Child) *v0.UsersetRewrite

Exclusion creates a rewrite definition that starts with the usersets of the first child and iteratively removes usersets that appear in the remaining children.

func GetComments

func GetComments(metadata *v0.Metadata) []string

GetComments returns the comment metadata found within the given metadata message.

func GetRelationKind

func GetRelationKind(relation *v0.Relation) iv1.RelationMetadata_RelationKind

GetRelationKind returns the kind of the relation.

func Intersection

func Intersection(firstChild *v0.SetOperation_Child, rest ...*v0.SetOperation_Child) *v0.UsersetRewrite

Intersection creates a rewrite definition that returns/considers only usersets present in all children.

func Namespace

func Namespace(name string, relations ...*v0.Relation) *v0.NamespaceDefinition

Namespace creates a namespace definition with one or more defined relations.

func NamespaceWithComment

func NamespaceWithComment(name string, comment string, relations ...*v0.Relation) *v0.NamespaceDefinition

NamespaceWithComment creates a namespace definition with one or more defined relations.

func Relation

func Relation(name string, rewrite *v0.UsersetRewrite, allowedDirectRelations ...*v0.RelationReference) *v0.Relation

Relation creates a relation definition with an optional rewrite definition.

func RelationReference

func RelationReference(namespaceName string, relationName string) *v0.RelationReference

RelationReference creates a relation reference.

func RelationWithComment

func RelationWithComment(name string, comment string, rewrite *v0.UsersetRewrite, allowedDirectRelations ...*v0.RelationReference) *v0.Relation

RelationWithComment creates a relation definition with an optional rewrite definition.

func Rewrite

func Rewrite(rewrite *v0.UsersetRewrite) *v0.SetOperation_Child

Rewrite wraps a rewrite as a set operation child of another rewrite.

func SetRelationKind

func SetRelationKind(relation *v0.Relation, kind iv1.RelationMetadata_RelationKind) error

SetRelationKind sets the kind of relation.

func StripMetadata

func StripMetadata(nsconfig *v0.NamespaceDefinition) *v0.NamespaceDefinition

StripMetadata removes all metadata from the given namespace.

func This

func This() *v0.SetOperation_Child

This creates a child for a set operation that references only direct usersets with the parent relation.

func TupleToUserset

func TupleToUserset(tuplesetRelation, usersetRelation string) *v0.SetOperation_Child

TupleToUserset creates a child which first loads all tuples with the specific relation, and then unions all children on the usersets found by following a relation on those loaded tuples.

func Union

func Union(firstChild *v0.SetOperation_Child, rest ...*v0.SetOperation_Child) *v0.UsersetRewrite

Union creates a rewrite definition that combines/considers usersets in all children.

Types

This section is empty.

Jump to

Keyboard shortcuts

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