Documentation
¶
Index ¶
Constants ¶
View Source
const ( EffectorAllowOverride = "allow-override" EffectorDenyOverride = "deny-override" EffectorAllowAndDeny = "allow-and-deny" )
Variables ¶
View Source
var ( ErrNeedEffectFieldKey = errors.New("must give an effect field key") ErrUnknownEffectType = errors.New("unknown policy effect type") )
Functions ¶
func ModelFromViper ¶
ModelFromViper load model definetion from a viper instance.
You can use viper to load a concrete configure file in JSON, TOML, YAML format.
TOML format example:
[request_definition] r = "sub, dom, obj, act" [policy_definition] p = "sub, obj, act" [role_definition] g = "_, _, _" g1 = "_, _" [policy_effect] type = "allow-override" [matchers] m = "g(r.sub, p.sub, r.dom) && r.obj == p.obj && r.act == p.act"
Types ¶
type CSVIterator ¶
type CSVIterator struct {
// contains filtered or unexported fields
}
func NewCSVIterator ¶
func NewCSVIterator(ioReader io.Reader) (itr *CSVIterator)
NewCSVIterator constructs an iterator that load CSV data from an io.Reader.
The CSV data must be in the format described in RFC 4180.
Additional support comments that start with '#'.
func (*CSVIterator) Error ¶
func (it *CSVIterator) Error() (err error)
type ModelOption ¶
type ModelOption interface {
// contains filtered or unexported methods
}
An option configures a new model when load it.
func ExtensionFuncs ¶
func ExtensionFuncs(funcs ...core.ExtensionFunc) ModelOption
func RoleDomainMatch ¶
func RoleDomainMatch(key string, fn core.RoleDomainMatchFunc) ModelOption
Click to show internal directories.
Click to hide internal directories.