persistence

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Persistence

type Persistence struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, wg *sync.WaitGroup, config configuration.Config) (result *Persistence, err error)

func (*Persistence) Create

func (p *Persistence) Create(policy ladon.Policy) error

Create persists the policy.

func (*Persistence) Delete

func (p *Persistence) Delete(id string) error

Delete removes a policy.

func (*Persistence) FindRequestCandidates

func (p *Persistence) FindRequestCandidates(r *ladon.Request) (ladon.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 (*Persistence) Get

func (p *Persistence) Get(id string) (ladon.Policy, error)

Get retrieves a policy.

func (*Persistence) GetAll

func (p *Persistence) GetAll(limit, offset int64) (ladon.Policies, error)

GetAll retrieves all policies.

func (*Persistence) IsAllowed

func (p *Persistence) IsAllowed(r *ladon.Request) (err error)

func (*Persistence) IsAnyAllowed

func (p *Persistence) IsAnyAllowed(r []ladon.Request) (err error)

func (*Persistence) Update

func (p *Persistence) Update(policy ladon.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