Documentation ¶
Overview ¶
nolint: staticcheck
nolint: staticcheck
Index ¶
- type Cache
- func (c *Cache) CanUpdate(other *model.Model, stats *stts.Stats) error
- func (c *Cache) Check(req *dsr.CheckRequest, relReader graph.RelationReader) (*dsr.CheckResponse, error)
- func (c *Cache) ExpandPermission(on model.ObjectName, pn model.RelationName) []model.RelationName
- func (c *Cache) ExpandRelation(on model.ObjectName, rn model.RelationName) []model.RelationName
- func (c *Cache) GetGraph(req *dsr.GetGraphRequest, relReader graph.RelationReader) (*dsr.GetGraphResponse, error)
- 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) Metadata() *model.Metadata
- func (c *Cache) ObjectExists(on model.ObjectName) bool
- func (c *Cache) PermissionExists(on model.ObjectName, pn model.RelationName) bool
- func (c *Cache) RelationExists(on model.ObjectName, rn model.RelationName) bool
- func (c *Cache) UpdateModel(m *model.Model) error
- func (c *Cache) ValidateRelation(relation *dsc.Relation) 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) Check ¶ added in v0.1.0
func (c *Cache) Check(req *dsr.CheckRequest, relReader graph.RelationReader) (*dsr.CheckResponse, error)
func (*Cache) ExpandPermission ¶
func (c *Cache) ExpandPermission(on model.ObjectName, pn model.RelationName) []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) GetGraph ¶ added in v0.1.1
func (c *Cache) GetGraph(req *dsr.GetGraphRequest, relReader graph.RelationReader) (*dsr.GetGraphResponse, error)
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.RelationName) 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.
func (*Cache) UpdateModel ¶
UpdateModel, swaps the cache model instance.
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)