Documentation ¶
Index ¶
- type MemoryManager
- func (m *MemoryManager) Create(ctx context.Context, policy Policy) error
- func (m *MemoryManager) Delete(ctx context.Context, id string) error
- func (m *MemoryManager) FindPoliciesForResource(ctx context.Context, resource string) (Policies, error)
- func (m *MemoryManager) FindPoliciesForSubject(ctx context.Context, subject string) (Policies, error)
- func (m *MemoryManager) FindRequestCandidates(ctx context.Context, r *Request) (Policies, error)
- func (m *MemoryManager) Get(ctx context.Context, id string) (Policy, error)
- func (m *MemoryManager) GetAll(ctx context.Context, limit, offset int64) (Policies, error)
- func (m *MemoryManager) Update(ctx context.Context, policy Policy) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryManager ¶
MemoryManager is an in-memory (non-persistent) implementation of Manager.
func NewMemoryManager ¶
func NewMemoryManager() *MemoryManager
NewMemoryManager constructs and initializes new MemoryManager with no policies.
func (*MemoryManager) Create ¶
func (m *MemoryManager) Create(ctx context.Context, policy Policy) error
Create a new pollicy to MemoryManager.
func (*MemoryManager) Delete ¶
func (m *MemoryManager) Delete(ctx context.Context, id string) error
Delete removes a policy.
func (*MemoryManager) FindPoliciesForResource ¶ added in v1.0.0
func (m *MemoryManager) FindPoliciesForResource(ctx context.Context, resource string) (Policies, error)
FindPoliciesForResource returns policies that could match the resource. It either returns a set of policies that apply to the resource, or a superset of it. If an error occurs, it returns nil and the error.
func (*MemoryManager) FindPoliciesForSubject ¶ added in v1.0.0
func (m *MemoryManager) FindPoliciesForSubject(ctx context.Context, subject string) (Policies, error)
FindPoliciesForSubject returns policies that could match the subject. It either returns a set of policies that applies to the subject, or a superset of it. If an error occurs, it returns nil and the error.
func (*MemoryManager) FindRequestCandidates ¶
func (m *MemoryManager) FindRequestCandidates(ctx context.Context, r *Request) (Policies, error)
FindRequestCandidates returns candidates that could match the request object. It either returns a set that exactly matches the request, or a superset of it. If an error occurs, it returns nil and the error.
func (*MemoryManager) Get ¶
func (m *MemoryManager) Get(ctx context.Context, id string) (Policy, error)
Get retrieves a policy.