manager

package
v0.0.0-...-a7b145a Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewManager)

Functions

func NewManager

func NewManager(client *ent.Client) ladon.Manager

Types

type EntManager

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

func (*EntManager) Create

func (l *EntManager) Create(policy ladon.Policy) error

Create persists the policy.

func (*EntManager) Delete

func (l *EntManager) Delete(id string) error

Delete removes a policy.

func (*EntManager) FindPoliciesForResource

func (l *EntManager) FindPoliciesForResource(resource string) (ladon.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 (*EntManager) FindPoliciesForSubject

func (l *EntManager) FindPoliciesForSubject(subject string) (ladon.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 (*EntManager) FindRequestCandidates

func (l *EntManager) 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 (*EntManager) Get

func (l *EntManager) Get(id string) (ladon.Policy, error)

Get retrieves a policy.

func (*EntManager) GetAll

func (l *EntManager) GetAll(limit int64, offset int64) (ladon.Policies, error)

GetAll retrieves all policies.

func (*EntManager) Update

func (l *EntManager) 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