Documentation ¶
Index ¶
Constants ¶
const ( // EmailNamespace is a function namespace for email functions EmailNamespace = "email" // EmailLocalFnName is a name for email.local function EmailLocalFnName = "local" )
Variables ¶
This section is empty.
Functions ¶
func EmailLocal ¶
EmailLocal returns local part of the email
Types ¶
type Expression ¶
type Expression struct {
// contains filtered or unexported fields
}
Expression is an expression template that can interpolate to some variables
func RoleVariable ¶
func RoleVariable(variable string) (*Expression, error)
RoleVariable checks if the passed in string matches the variable pattern {{external.foo}} or {{internal.bar}}. If it does, it returns the variable prefix and the variable name. In the previous example this would be "external" or "internal" for the variable prefix and "foo" or "bar" for the variable name. If no variable pattern is found, trace.NotFound is returned.
func (*Expression) Interpolate ¶
func (p *Expression) Interpolate(traits map[string][]string) ([]string, error)
Interpolate interpolates the variable adding prefix and suffix if present, returns trace.NotFound in case if the trait is not found, nil in case of success and BadParameter error otherwise
func (*Expression) Namespace ¶
func (p *Expression) Namespace() string
Namespace returns a variable namespace, e.g. external or internal
type TransformFn ¶
TransformFn is an optional transform function that can take in string and replace it with another value