Documentation ¶
Index ¶
- func AllFunc(ctx expr.EvalContext, vals ...value.Value) (value.BoolValue, bool)
- func AnyFunc(ctx expr.EvalContext, vals ...value.Value) (value.BoolValue, bool)
- func ContainsFunc(ctx expr.EvalContext, lv, rv value.Value) (value.BoolValue, bool)
- func CountFunc(ctx expr.EvalContext, val value.Value) (value.IntValue, bool)
- func DayOfWeek(ctx expr.EvalContext, items ...value.Value) (value.IntValue, bool)
- func EmailDomainFunc(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
- func EmailFunc(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
- func EmailNameFunc(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
- func Eq(ctx expr.EvalContext, itemA, itemB value.Value) (value.BoolValue, bool)
- func Exists(ctx expr.EvalContext, item interface{}) (value.BoolValue, bool)
- func Ge(ctx expr.EvalContext, lv, rv value.Value) (value.BoolValue, bool)
- func Gt(ctx expr.EvalContext, lv, rv value.Value) (value.BoolValue, bool)
- func HostFunc(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
- func HourOfDay(ctx expr.EvalContext, items ...value.Value) (value.IntValue, bool)
- func HourOfWeek(ctx expr.EvalContext, items ...value.Value) (value.IntValue, bool)
- func JoinFunc(ctx expr.EvalContext, items ...value.Value) (value.StringValue, bool)
- func LeFunc(ctx expr.EvalContext, lv, rv value.Value) (value.BoolValue, bool)
- func LoadAllBuiltins()
- func Lower(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
- func LtFunc(ctx expr.EvalContext, lv, rv value.Value) (value.BoolValue, bool)
- func Match(ctx expr.EvalContext, item value.Value) (value.MapValue, bool)
- func Mm(ctx expr.EvalContext, items ...value.Value) (value.IntValue, bool)
- func Ne(ctx expr.EvalContext, itemA, itemB value.Value) (value.BoolValue, bool)
- func NotFunc(ctx expr.EvalContext, item value.Value) (value.BoolValue, bool)
- func Now(ctx expr.EvalContext, items ...value.Value) (value.TimeValue, bool)
- func OneOfFunc(ctx expr.EvalContext, vals ...value.Value) (value.Value, bool)
- func PowFunc(ctx expr.EvalContext, val, toPower value.Value) (value.NumberValue, bool)
- func Qs(ctx expr.EvalContext, urlItem, keyItem value.Value) (value.StringValue, bool)
- func SplitFunc(ctx expr.EvalContext, input value.Value, splitByV value.StringValue) (value.StringsValue, bool)
- func SqrtFunc(ctx expr.EvalContext, val value.Value) (value.NumberValue, bool)
- func ToDate(ctx expr.EvalContext, item value.Value) (value.TimeValue, bool)
- func ToInt(ctx expr.EvalContext, item value.Value) (value.IntValue, bool)
- func ToTimestamp(ctx expr.EvalContext, item value.Value) (value.IntValue, bool)
- func UrlPath(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
- func Yy(ctx expr.EvalContext, items ...value.Value) (value.IntValue, bool)
- func YyMm(ctx expr.EvalContext, items ...value.Value) (value.StringValue, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllFunc ¶
All: Answers True/False if all of the arguments evaluate to truish (javascripty)
type definintion of true int > 0 = true string != "" = true boolean natively supported true/false all("hello",2, true) => true all("hello",0,true) => false all("",2, true) => false
func AnyFunc ¶
Any: Answers True/False if any of the arguments evaluate to truish (javascripty)
type definintion of true int > 0 = true string != "" = true any(item,item2) => true, true any(not_field) => false, true
func CountFunc ¶
Count: count occurences of value, ignores the value and ensures it is non null
count(anyvalue) => 1, true count(not_number) => -- Could not be evaluated
func EmailDomainFunc ¶
func EmailDomainFunc(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
email a string, parses email
email("Bob <bob@bob.com>") => bob@bob.com
func EmailFunc ¶
func EmailFunc(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
email a string, parses email
email("Bob <bob@bob.com>") => bob@bob.com, true email("Bob <bob>") => "", false
func EmailNameFunc ¶
func EmailNameFunc(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
emailname a string, parses email
emailname("Bob <bob@bob.com>") => Bob
func Exists ¶
func Exists(ctx expr.EvalContext, item interface{}) (value.BoolValue, bool)
Exists: Answers True/False if the field exists and is non null
exists(real_field) => true exists("value") => true exists("") => false exists(empty_field) => false exists(2) => true exists(todate(date_field)) => true
func HostFunc ¶
func HostFunc(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
Extract host from a String (must be urlish), doesn't do much/any validation
host("http://www.lytics.io/index.html") => http://www.lytics.io
In the event the value contains more than one input url, will ONLY evaluate first
func HourOfWeek ¶
hour of week [0-167]
func JoinFunc ¶
func JoinFunc(ctx expr.EvalContext, items ...value.Value) (value.StringValue, bool)
Join items
join("applies","oranges",",") => "apples,oranges"
func LoadAllBuiltins ¶
func LoadAllBuiltins()
func Lower ¶
func Lower(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
String lower function
must be able to convert to string
func Match ¶
match: Match a simple pattern match and return matched value
given input: {"score_value":24,"event_click":true} match("score_") => {"value":24} match("amount_") => false match("event_") => {"click":true}
func Mm ¶
Get month as integer from date
@optional timestamp (if not, gets from context reader) mm() => 01, true /// assuming message ts = jan 1 mm("2014-03-17") => 03, true
func Now ¶
Get current time of Message (message time stamp) or else choose current
server time if none is available in message context
func PowFunc ¶
func PowFunc(ctx expr.EvalContext, val, toPower value.Value) (value.NumberValue, bool)
Pow: exponents, raise x to the power of y
pow(5,2) => 25, true pow(3,2) => 9, true pow(not_number,2) => 0, false
func Qs ¶
func Qs(ctx expr.EvalContext, urlItem, keyItem value.Value) (value.StringValue, bool)
Extract qs param from a string (must be url valid)
qs("http://www.lytics.io/?utm_source=google","utm_source") => "google", true
func SplitFunc ¶
func SplitFunc(ctx expr.EvalContext, input value.Value, splitByV value.StringValue) (value.StringsValue, bool)
Split a string, accepts an optional with parameter
split(item, ",")
func SqrtFunc ¶
func SqrtFunc(ctx expr.EvalContext, val value.Value) (value.NumberValue, bool)
Sqrt
sqrt(4) => 2, true sqrt(9) => 3, true sqrt(not_number) => 0, false
func ToInt ¶
Convert to Integer: Best attempt at converting to integer
toint("5") => 5 toint("5.75") => 5 toint("5,555") => 5555 toint("$5") => 5 toint("5,555.00") => 5555
func ToTimestamp ¶
totimestamp: convert to date, then to unix Seconds
func UrlPath ¶
func UrlPath(ctx expr.EvalContext, item value.Value) (value.StringValue, bool)
Extract url path from a String (must be urlish), doesn't do much/any validation
host("http://www.lytics.io/blog/index.html") => blog
In the event the value contains more than one input url, will ONLY evaluate first
func Yy ¶
Get year in integer from field, must be able to convert to date
yy() => 15, true // assuming it is 2015 yy("2014-03-01") => 14, true
func YyMm ¶
func YyMm(ctx expr.EvalContext, items ...value.Value) (value.StringValue, bool)
Get yymm in 4 digits from argument if supplied, else uses message context ts
Types ¶
This section is empty.