ladon: github.com/ory/ladon/manager/memory Index | Files

package memory

import "github.com/ory/ladon/manager/memory"

Index

Package Files

manager_memory.go

type MemoryManager Uses

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

MemoryManager is an in-memory (non-persistent) implementation of Manager.

func NewMemoryManager Uses

func NewMemoryManager() *MemoryManager

NewMemoryManager constructs and initializes new MemoryManager with no policies.

func (*MemoryManager) Create Uses

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

Create a new pollicy to MemoryManager.

func (*MemoryManager) Delete Uses

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

Delete removes a policy.

func (*MemoryManager) FindPoliciesForResource Uses

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 Uses

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 Uses

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 Uses

func (m *MemoryManager) Get(id string) (Policy, error)

Get retrieves a policy.

func (*MemoryManager) GetAll Uses

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

GetAll returns all policies.

func (*MemoryManager) Update Uses

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

Update updates an existing policy.

Package memory imports 5 packages (graph) and is imported by 20 packages. Updated 2019-05-01. Refresh now. Tools for package owners.