Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeLocalSelector ¶
func MakeLocalSelector(uri *url.URL, path []pdp.Expression, t pdp.Type, def, err pdp.Expression) (pdp.Expression, error)
MakeLocalSelector creates instance of local selector. Arguments content and item are id of content in storage and id of content item within content. Argument path defines set of expressions to get a value of type t. Local selector implements late binding and checks path and type on any evaluation. If content storage doesn't have a value for given path the value of def expression is returned if it was provided. In case if other error occurs the value of err expression is returned if it was provided.
Types ¶
type LocalSelector ¶
type LocalSelector struct {
// contains filtered or unexported fields
}
LocalSelector represent local selector expression. The expression extracts value from local content storage by given path and validates that result has desired type.
func (LocalSelector) Calculate ¶
func (s LocalSelector) Calculate(ctx *pdp.Context) (pdp.AttributeValue, error)
Calculate implements Expression interface and returns calculated value
func (LocalSelector) GetResultType ¶
func (s LocalSelector) GetResultType() pdp.Type
GetResultType implements Expression interface and returns type of final value expected by the selector from corresponding content.