Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Diff(other *model.Model) *diff.Diff
- func (c *Cache) ExpandPermission(on model.ObjectName, pn model.PermissionName) []model.RelationName
- func (c *Cache) ExpandRelation(on model.ObjectName, rn model.RelationName) []model.RelationName
- func (c *Cache) GetObjectType(objectType string) (*dsc2.ObjectType, error)
- func (c *Cache) GetObjectTypes() (ObjectTypeSlice, error)
- func (c *Cache) GetPermission(permission string) (*dsc2.Permission, error)
- func (c *Cache) GetPermissions() (PermissionSlice, error)
- func (c *Cache) GetRelationType(objectType, relation string) (*dsc2.RelationType, error)
- func (c *Cache) GetRelationTypes(objectType string) (RelationTypeSlice, error)
- func (c *Cache) ObjectExists(on model.ObjectName) bool
- func (c *Cache) PermissionExists(on model.ObjectName, pn model.PermissionName) bool
- func (c *Cache) RelationExists(on model.ObjectName, rn model.RelationName) bool
- func (c *Cache) UpdateModel(m *model.Model) error
- type ObjectTypeSlice
- type PermissionSlice
- type RelationTypeSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) Diff ¶ added in v0.0.13
Returns a diff struct resulted between the old and the new model.
func (*Cache) ExpandPermission ¶
func (c *Cache) ExpandPermission(on model.ObjectName, pn model.PermissionName) []model.RelationName
ExpandPermission returns list of relations which cover the given permission for the given object type.
func (*Cache) ExpandRelation ¶
func (c *Cache) ExpandRelation(on model.ObjectName, rn model.RelationName) []model.RelationName
ExpandRelation, returns list of relations which are a union of the given relation. For example, when a writer relation inherits reader, the expansion of a reader = reader + writer.
func (*Cache) GetObjectType ¶
func (c *Cache) GetObjectType(objectType string) (*dsc2.ObjectType, error)
GetObjectType, v2 backwards-compatibility accessor function, returns v2 ObjectType by name.
func (*Cache) GetObjectTypes ¶
func (c *Cache) GetObjectTypes() (ObjectTypeSlice, error)
GetObjectTypes, v2 backwards-compatibility accessor function, returns list of v2.ObjectType instances.
func (*Cache) GetPermission ¶
func (c *Cache) GetPermission(permission string) (*dsc2.Permission, error)
GetPermission, v2 backwards-compatibility accessor function, returns v2 Permission by permission name.
func (*Cache) GetPermissions ¶
func (c *Cache) GetPermissions() (PermissionSlice, error)
GetPermissions, v2 backwards-compatibility accessor function, returns list of v2 Permission instances.
func (*Cache) GetRelationType ¶
func (c *Cache) GetRelationType(objectType, relation string) (*dsc2.RelationType, error)
GetRelationType, v2 backwards-compatibility accessor function, returns v2 RelationType by object type and relation name.
func (*Cache) GetRelationTypes ¶
func (c *Cache) GetRelationTypes(objectType string) (RelationTypeSlice, error)
GetRelationTypes, v2 backwards-compatibility accessor function, returns list of v2 RelationType instances, optionally filtered by by object type.
func (*Cache) ObjectExists ¶
func (c *Cache) ObjectExists(on model.ObjectName) bool
ObjectExists, checks if given object type name exists in the model cache.
func (*Cache) PermissionExists ¶
func (c *Cache) PermissionExists(on model.ObjectName, pn model.PermissionName) bool
PermissionExists, checks if given permission, for the given object type, exists in the model cache.
func (*Cache) RelationExists ¶
func (c *Cache) RelationExists(on model.ObjectName, rn model.RelationName) bool
RelationExists, checks if given relation type, for the given object type, exists in the model cache.
type ObjectTypeSlice ¶ added in v0.0.4
type ObjectTypeSlice []*dsc2.ObjectType
func (ObjectTypeSlice) Paginate ¶ added in v0.0.4
func (s ObjectTypeSlice) Paginate(page *dsc2.PaginationRequest) (*paging.Result[*dsc2.ObjectType], error)
type PermissionSlice ¶ added in v0.0.4
type PermissionSlice []*dsc2.Permission
func (PermissionSlice) Paginate ¶ added in v0.0.4
func (s PermissionSlice) Paginate(page *dsc2.PaginationRequest) (*paging.Result[*dsc2.Permission], error)
type RelationTypeSlice ¶ added in v0.0.4
type RelationTypeSlice []*dsc2.RelationType
func (RelationTypeSlice) Paginate ¶ added in v0.0.4
func (s RelationTypeSlice) Paginate(page *dsc2.PaginationRequest) (*paging.Result[*dsc2.RelationType], error)