effector

package
v2.89.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultEffector

type DefaultEffector struct {
}

DefaultEffector is default effector for Casbin.

func NewDefaultEffector

func NewDefaultEffector() *DefaultEffector

NewDefaultEffector is the constructor for DefaultEffector.

func (*DefaultEffector) MergeEffects

func (e *DefaultEffector) MergeEffects(expr string, effects []Effect, matches []float64, policyIndex int, policyLength int) (Effect, int, error)

MergeEffects merges all matching results collected by the enforcer into a single decision.

type Effect

type Effect int

Effect is the result for a policy rule.

const (
	Allow Effect = iota
	Indeterminate
	Deny
)

Values for policy effect.

type Effector

type Effector interface {
	// MergeEffects merges all matching results collected by the enforcer into a single decision.
	MergeEffects(expr string, effects []Effect, matches []float64, policyIndex int, policyLength int) (Effect, int, error)
}

Effector is the interface for Casbin effectors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL