Documentation
¶
Index ¶
- Variables
- func Ignore() types.Value
- func IsIgnore(v types.Value) bool
- func IsVariable(v types.Value) bool
- func PartialError(err error) ast.IsNode
- func PartialPolicy(env Env, p *ast.Policy) (policy *ast.Policy, keep bool)
- func PolicyToNode(p *ast.Policy) ast.Node
- func ToPartialError(n ast.IsNode) (error, bool)
- func ToVariable(ent types.EntityUID) (types.String, bool)
- func TypeName(v types.Value) string
- func ValueToBool(v types.Value) (types.Boolean, error)
- func ValueToDatetime(v types.Value) (types.Datetime, error)
- func ValueToDecimal(v types.Value) (types.Decimal, error)
- func ValueToDuration(v types.Value) (types.Duration, error)
- func ValueToEntity(v types.Value) (types.EntityUID, error)
- func ValueToIP(v types.Value) (types.IPAddr, error)
- func ValueToLong(v types.Value) (types.Long, error)
- func ValueToRecord(v types.Value) (types.Record, error)
- func ValueToSet(v types.Value) (types.Set, error)
- func ValueToString(v types.Value) (types.String, error)
- func Variable(v types.String) types.Value
- type BoolEvaler
- type ComparableValue
- type Env
- type Evaler
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrType = fmt.Errorf("type error")
Functions ¶
func IsVariable ¶ added in v0.3.1
func PartialError ¶ added in v1.2.6
PartialError returns a node that represents a partial error.
func PartialPolicy ¶ added in v0.3.1
PartialPolicy returns a partially evaluated version of the policy and a boolean indicating if the policy should be kept. (Policies that are determined to evaluate to false are not kept.)
func ToPartialError ¶ added in v1.2.6
ToPartialError returns the error if the node is a partial error.
Types ¶
type BoolEvaler ¶ added in v0.3.1
type BoolEvaler struct {
// contains filtered or unexported fields
}
func Compile ¶
func Compile(p *ast.Policy) BoolEvaler
type ComparableValue ¶ added in v0.3.2
type ComparableValue interface { types.Value // LessThan returns true if the lhs is less than the rhs, and an // error if the rhs is not comparable to the lhs LessThan(types.Value) (bool, error) // LessThan returns true if the lhs is less than or equal to the // rhs, and an error if the rhs is not comparable to the lhs LessThanOrEqual(types.Value) (bool, error) }
ComparableValue provides the interface that must be implemented to support operator overloading of <, <=, >, and >=
Click to show internal directories.
Click to hide internal directories.