Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Delta ¶
type Delta struct { // Type is the type of this delta. Type DeltaType // RelationName is the name of the relation to which this delta applies, if any. RelationName string // AllowedType is the allowed relation type added or removed, if any. AllowedType *core.AllowedRelation }
Delta holds a single change of a namespace.
type DeltaType ¶
type DeltaType string
DeltaType defines the type of namespace deltas.
const ( // NamespaceAdded indicates that the namespace was newly added/created. NamespaceAdded DeltaType = "namespace-added" // NamespaceRemoved indicates that the namespace was removed. NamespaceRemoved DeltaType = "namespace-removed" // NamespaceCommentsChanged indicates that the comment(s) on the namespace were changed. NamespaceCommentsChanged DeltaType = "namespace-comments-changed" // AddedRelation indicates that the relation was added to the namespace. AddedRelation DeltaType = "added-relation" // RemovedRelation indicates that the relation was removed from the namespace. RemovedRelation DeltaType = "removed-relation" // AddedPermission indicates that the permission was added to the namespace. AddedPermission DeltaType = "added-permission" // RemovedPermission indicates that the permission was removed from the namespace. RemovedPermission DeltaType = "removed-permission" // ChangedPermissionImpl indicates that the implementation of the permission has changed in some // way. ChangedPermissionImpl DeltaType = "changed-permission-implementation" // ChangedPermissionComment indicates that the comment of the permission has changed in some way. ChangedPermissionComment DeltaType = "changed-permission-comment" // LegacyChangedRelationImpl indicates that the implementation of the relation has changed in some // way. This is for legacy checks and should not apply to any modern namespaces created // via schema. LegacyChangedRelationImpl DeltaType = "legacy-changed-relation-implementation" // RelationAllowedTypeAdded indicates that an allowed relation type has been added to // the relation. RelationAllowedTypeAdded DeltaType = "relation-allowed-type-added" // RelationAllowedTypeRemoved indicates that an allowed relation type has been removed from // the relation. RelationAllowedTypeRemoved DeltaType = "relation-allowed-type-removed" // ChangedRelationComment indicates that the comment of the relation has changed in some way. ChangedRelationComment DeltaType = "changed-relation-comment" )
type Diff ¶
type Diff struct {
// contains filtered or unexported fields
}
Diff holds the diff between two namespaces.
func DiffNamespaces ¶
func DiffNamespaces(existing *core.NamespaceDefinition, updated *core.NamespaceDefinition) (*Diff, error)
DiffNamespaces performs a diff between two namespace definitions. One or both of the definitions can be `nil`, which will be treated as an add/remove as applicable.
type ExpressionChangeType ¶ added in v1.35.3
type ExpressionChangeType string
ExpressionChangeType defines the type of expression changes.
const ( // ExpressionUnchanged indicates that the expression was unchanged. ExpressionUnchanged ExpressionChangeType = "expression-unchanged" // ExpressionOperationChanged indicates that the operation type of the expression was changed. ExpressionOperationChanged ExpressionChangeType = "operation-changed" // ExpressionChildrenChanged indicates that the children of the expression were changed. ExpressionChildrenChanged ExpressionChangeType = "children-changed" // ExpressionOperationExpanded indicates that the operation type of the expression was expanded // from a union of a single child to multiple children under a union, intersection or another // operation. ExpressionOperationExpanded ExpressionChangeType = "operation-expanded" )
type ExpressionDiff ¶ added in v1.35.3
type ExpressionDiff struct {
// contains filtered or unexported fields
}
ExpressionDiff holds the diff between two expressions.
func DiffExpressions ¶ added in v1.35.3
func DiffExpressions(existing *core.UsersetRewrite, updated *core.UsersetRewrite) (*ExpressionDiff, error)
DiffExpressions diffs two expressions.
func (*ExpressionDiff) Change ¶ added in v1.35.3
func (ed *ExpressionDiff) Change() ExpressionChangeType
Change returns the type of change that occurred.
func (*ExpressionDiff) ChildDiffs ¶ added in v1.35.3
func (ed *ExpressionDiff) ChildDiffs() []*OperationDiff
ChildDiffs returns the child diffs, if any.
func (*ExpressionDiff) Existing ¶ added in v1.35.3
func (ed *ExpressionDiff) Existing() *core.UsersetRewrite
Existing returns the existing expression, if any.
func (*ExpressionDiff) Updated ¶ added in v1.35.3
func (ed *ExpressionDiff) Updated() *core.UsersetRewrite
Updated returns the updated expression, if any.
type OperationDiff ¶ added in v1.35.3
type OperationDiff struct {
// contains filtered or unexported fields
}
OperationDiff holds the diff between two set operations.
func (*OperationDiff) Change ¶ added in v1.35.3
func (od *OperationDiff) Change() SetOperationChangeType
Change returns the type of change that occurred.
func (*OperationDiff) ChildExpressionDiff ¶ added in v1.35.3
func (od *OperationDiff) ChildExpressionDiff() *ExpressionDiff
ChildExpressionDiff returns the child expression diff, if any.
func (*OperationDiff) Existing ¶ added in v1.35.3
func (od *OperationDiff) Existing() *core.SetOperation_Child
Existing returns the existing set operation, if any.
func (*OperationDiff) Updated ¶ added in v1.35.3
func (od *OperationDiff) Updated() *core.SetOperation_Child
Updated returns the updated set operation, if any.
type SetOperationChangeType ¶ added in v1.35.3
type SetOperationChangeType string
SetOperationChangeType defines the type of set operation changes.
const ( // OperationUnchanged indicates that the set operation was unchanged. OperationUnchanged SetOperationChangeType = "operation-changed" // OperationAdded indicates that a set operation was added. OperationAdded SetOperationChangeType = "operation-added" // OperationRemoved indicates that a set operation was removed. OperationRemoved SetOperationChangeType = "operation-removed" // OperationTypeChanged indicates that the type of set operation was changed. OperationTypeChanged SetOperationChangeType = "operation-type-changed" // OperationComputedUsersetChanged indicates that the computed userset of the operation was changed. OperationComputedUsersetChanged SetOperationChangeType = "operation-computed-userset-changed" // OperationTuplesetChanged indicates that the tupleset of the operation was changed. OperationTuplesetChanged SetOperationChangeType = "operation-tupleset-changed" // OperationChildExpressionChanged indicates that the child expression of the operation was changed. OperationChildExpressionChanged SetOperationChangeType = "operation-child-expression-changed" )