Documentation ¶
Index ¶
- func Action(name string, child *base.Child) *base.ActionDefinition
- func Actions(defs ...*base.ActionDefinition) []*base.ActionDefinition
- func ComputedUserSet(relation string, exclusion bool) *base.Child
- func Entity(name string, relations []*base.RelationDefinition, ...) *base.EntityDefinition
- func Intersection(children ...*base.Child) *base.Child
- func Reference(name string) *base.RelationReference
- func Relation(name string, references ...*base.RelationReference) *base.RelationDefinition
- func Relations(defs ...*base.RelationDefinition) []*base.RelationDefinition
- func Schema(entities ...*base.EntityDefinition) *base.SchemaDefinition
- func TupleToUserSet(reference, relation string, exclusion bool) *base.Child
- func Union(children ...*base.Child) *base.Child
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Action ¶
func Action(name string, child *base.Child) *base.ActionDefinition
Action - Action builder creates a new action definition with the given name and child entity
func Actions ¶
func Actions(defs ...*base.ActionDefinition) []*base.ActionDefinition
Actions - Actions builder creates a slice of action definitions from the given variadic list of action definitions
func ComputedUserSet ¶
ComputedUserSet - returns a Child definition that represents a computed set of users based on a relation relation: the name of the relation on which the computed set is based exclusion: a boolean indicating if the computed set should exclude or include the users in the set
func Entity ¶
func Entity(name string, relations []*base.RelationDefinition, actions []*base.ActionDefinition) *base.EntityDefinition
Entity - Entity builder This function creates and returns a new instance of EntityDefinition. It takes in the name of the entity, an array of relations, and an array of actions. It then initializes the EntityDefinition with the provided values and returns it. The EntityDefinition contains information about the entity's name, its relations, actions, and references.
func Intersection ¶
Intersection - Returns a child element that represents the intersection of the given children. This child element can be used in defining entity relations and actions.
func Relation ¶
func Relation(name string, references ...*base.RelationReference) *base.RelationDefinition
Relation - Relation builder function that creates a new RelationDefinition instance with the given name and references.
Parameters: - name: a string representing the name of the relation. - references: a variadic parameter representing the relation references associated with this relation.
Returns: - a pointer to a new RelationDefinition instance with the given name and references.
func Relations ¶
func Relations(defs ...*base.RelationDefinition) []*base.RelationDefinition
Relations - Relations builder
func Schema ¶
func Schema(entities ...*base.EntityDefinition) *base.SchemaDefinition
Schema is a function that returns a pointer to a SchemaDefinition structure. It takes a variable number of pointers to EntityDefinition structures as input arguments, which are added to the schema being constructed. The function creates a new SchemaDefinition structure, initializes its EntityDefinitions field to an empty map, and then adds each input EntityDefinition structure to this map with the entity name as the key. Finally, it returns the pointer to the constructed SchemaDefinition structure.
func TupleToUserSet ¶
TupleToUserSet - Returns a pointer to a base.Child struct, containing a Leaf struct with a TupleToUserSet struct, that represents a child computation where the tuple set is passed to the computed user set. Takes a reference string, relation string, and exclusion boolean as arguments. reference: the name of the reference to the tuple set relation: the name of the relation for the computed user set exclusion: a boolean indicating whether to exclude the computed user set Returns a pointer to a base.Child struct.
Types ¶
This section is empty.