Documentation ¶
Index ¶
- type Persistence
- func (p *Persistence) Create(policy ladon.Policy) error
- func (p *Persistence) Delete(id string) error
- func (p *Persistence) FindRequestCandidates(r *ladon.Request) (ladon.Policies, error)
- func (p *Persistence) Get(id string) (ladon.Policy, error)
- func (p *Persistence) GetAll(limit, offset int64) (ladon.Policies, error)
- func (p *Persistence) IsAllowed(r *ladon.Request) (err error)
- func (p *Persistence) IsAnyAllowed(r []ladon.Request) (err error)
- func (p *Persistence) Update(policy ladon.Policy) error
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) FindRequestCandidates ¶
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) IsAnyAllowed ¶
func (p *Persistence) IsAnyAllowed(r []ladon.Request) (err error)
Click to show internal directories.
Click to hide internal directories.