memory

package
v0.8.10 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

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) 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