Documentation
¶
Index ¶
- func SetRetryTimeout(d time.Duration) collectionOption
- func WithLogger(log logr.Logger) collectionOption
- type GroupingPersister
- func (p *GroupingPersister) Insert(ent types.Entity, grp types.Group) error
- func (p *GroupingPersister) List() ([]types.GroupingPolicy, error)
- func (p *GroupingPersister) Remove(ent types.Entity, grp types.Group) error
- func (p *GroupingPersister) Watch(ctx context.Context) (<-chan types.GroupingPolicyChange, error)
- type PermissionPersister
- func (p *PermissionPersister) Insert(sub types.Subject, obj types.Object, act types.Action) error
- func (p *PermissionPersister) List() ([]types.PermissionPolicy, error)
- func (p *PermissionPersister) Remove(sub types.Subject, obj types.Object) error
- func (p *PermissionPersister) Update(sub types.Subject, obj types.Object, act types.Action) error
- func (p *PermissionPersister) Watch(ctx context.Context) (<-chan types.PermissionPolicyChange, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetRetryTimeout ¶
SetRetryTimeout controls how long it will wait before retry watch change stream
func WithLogger ¶
WithLogger set a logger for the collection to use with
Types ¶
type GroupingPersister ¶
type GroupingPersister struct {
// contains filtered or unexported fields
}
GroupingPersister is a GroupingPersister backed by mongodb
func NewGrouping ¶
func NewGrouping(coll *mgo.Collection, opts ...collectionOption) (*GroupingPersister, error)
NewGrouping uses the given mongodb collection as backend to persist grouping polices
func (*GroupingPersister) List ¶
func (p *GroupingPersister) List() ([]types.GroupingPolicy, error)
List all policies from the persister
func (*GroupingPersister) Watch ¶
func (p *GroupingPersister) Watch(ctx context.Context) (<-chan types.GroupingPolicyChange, error)
Watch any changes occurred about the policies in the persister
type PermissionPersister ¶
type PermissionPersister struct {
// contains filtered or unexported fields
}
PermissionPersister is a PermissionPersister backed by mongodb
func NewPermission ¶
func NewPermission(coll *mgo.Collection, opts ...collectionOption) (*PermissionPersister, error)
NewPermission uses the given mongodb collection as backend to persist grouping polices
func (*PermissionPersister) List ¶
func (p *PermissionPersister) List() ([]types.PermissionPolicy, error)
List all polices from the persister
func (*PermissionPersister) Watch ¶
func (p *PermissionPersister) Watch(ctx context.Context) (<-chan types.PermissionPolicyChange, error)
Watch any changes occurred about the polices in the persister
Click to show internal directories.
Click to hide internal directories.