memory

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2020 License: Apache-2.0 Imports: 5 Imported by: 127

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryManager

type MemoryManager struct {
	Policies map[string]Policy
	sync.RWMutex
}

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(policy Policy) error

Create a new pollicy to MemoryManager.

func (*MemoryManager) Delete

func (m *MemoryManager) Delete(id string) error

Delete removes a policy.

func (*MemoryManager) FindPoliciesForResource added in v1.0.0

func (m *MemoryManager) FindPoliciesForResource(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(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(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(id string) (Policy, error)

Get retrieves a policy.

func (*MemoryManager) GetAll

func (m *MemoryManager) GetAll(limit, offset int64) (Policies, error)

GetAll returns all policies.

func (*MemoryManager) Update added in v0.8.0

func (m *MemoryManager) Update(policy Policy) error

Update updates an existing policy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL