funcs

package
v1.1.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 45 Imported by: 0

Documentation

Overview

Package funcs for pipeline

Index

Constants

View Source
const (
	InvalidInt   = math.MinInt32
	DefaultInt   = int64(0xdeadbeef)
	DefaultStr   = ""
	InvalidStr   = "deadbeaf"
	InvalidFloat = math.SmallestNonzeroFloat64
	DefaultFloat = float64(0.0)
)

Variables

View Source
var (
	URLDecodeMarkdown = PLDoc{
		Doc: docURLDecode, Deprecated: false,
		FnCategory: map[string][]string{
			// contains filtered or unexported fields
		},
	}

	HTTPRequestMarkdown = PLDoc{
		Doc: docHTTPRequest,
		FnCategory: map[string][]string{
			// contains filtered or unexported fields
		},
	}

	CacheGetMarkdown = PLDoc{
		Doc: docCacheGet,
		FnCategory: map[string][]string{
			// contains filtered or unexported fields
		},
	}

	CacheSetMarkdown = PLDoc{
		Doc: docCacheSet,
		FnCategory: map[string][]string{
			// contains filtered or unexported fields
		},
	}
)
View Source
var (
	URLDecodeMarkdownEN = PLDoc{
		Doc: docURLDecodeEN, Deprecated: false,
		FnCategory: map[string][]string{
			// contains filtered or unexported fields
		},
	}

	HTTPRequestMarkdownEN = PLDoc{
		Doc: docHTTPRequestEN, Deprecated: false,
		FnCategory: map[string][]string{
			// contains filtered or unexported fields
		},
	}

	CacheGetMarkdownEN = PLDoc{
		Doc: docCacheGetEN, Deprecated: false,
		FnCategory: map[string][]string{
			// contains filtered or unexported fields
		},
	}

	CacheSetMarkdownEN = PLDoc{
		Doc: docCacheSetEN, Deprecated: false,
		FnCategory: map[string][]string{
			// contains filtered or unexported fields
		},
	}
)
View Source
var (
	FnPtKvsGet = NewFunc(
		"pt_kvs_get",
		[]*Param{
			{
				Name: "name",
				Type: []ast.DType{ast.String},
			},
		},
		[]ast.DType{ast.Bool, ast.Int, ast.Float, ast.String,
			ast.List, ast.Map, ast.Nil},
		[2]*PLDoc{
			{
				Language: langTagZhCN, Doc: docPtKvsGet,
				FnCategory: map[string][]string{
					langTagZhCN: {cPointOp}},
			},
			{
				Language: langTagEnUS, Doc: docPtKvsGetEN,
				FnCategory: map[string][]string{
					langTagEnUS: {ePointOp}},
			},
		},
		ptKvsGet,
	)

	FnPtKvsSet = NewFunc(
		"pt_kvs_set",
		[]*Param{
			{
				Name: "name",
				Type: []ast.DType{ast.String},
			},
			{
				Name: "value",
				Type: []ast.DType{ast.Bool, ast.Int, ast.Float, ast.String,
					ast.List, ast.Map, ast.Nil},
			},
			{
				Name:     "as_tag",
				Type:     []ast.DType{ast.Bool},
				Optional: true,
				DefaultVal: func() (any, ast.DType) {
					return false, ast.Bool
				},
			},
		},
		[]ast.DType{ast.Bool},
		[2]*PLDoc{
			{
				Language: langTagZhCN, Doc: docKvsSet,
				FnCategory: map[string][]string{
					langTagZhCN: {cPointOp}},
			},
			{
				Language: langTagEnUS, Doc: docPtKvsSetEN,
				FnCategory: map[string][]string{
					langTagEnUS: {ePointOp}},
			},
		},
		ptKvsSet,
	)

	FnPtKvsDel = NewFunc(
		"pt_kvs_del",
		[]*Param{
			{
				Name: "name",
				Type: []ast.DType{ast.String},
			},
		},
		nil,
		[2]*PLDoc{
			{
				Language: langTagZhCN, Doc: docKvsDel,
				FnCategory: map[string][]string{
					langTagZhCN: {cPointOp}},
			},
			{
				Language: langTagEnUS, Doc: docPtKvsDelEN,
				FnCategory: map[string][]string{
					langTagEnUS: {ePointOp}},
			},
		},
		ptKvsDel,
	)

	FnPtKvsKeys = NewFunc(
		"pt_kvs_keys",
		[]*Param{
			{
				Name:     "tags",
				Type:     []ast.DType{ast.Bool},
				Optional: true,
				DefaultVal: func() (any, ast.DType) {
					return true, ast.Bool
				},
			},
			{
				Name:     "fields",
				Type:     []ast.DType{ast.Bool},
				Optional: true,
				DefaultVal: func() (any, ast.DType) {
					return true, ast.Bool
				},
			},
		},
		[]ast.DType{ast.List},
		[2]*PLDoc{
			{
				Language: langTagZhCN, Doc: docKvsKeys,
				FnCategory: map[string][]string{
					langTagZhCN: {cPointOp}},
			},
			{
				Language: langTagEnUS, Doc: docPtKvsKeysEN,
				FnCategory: map[string][]string{
					langTagEnUS: {ePointOp}},
			},
		},
		ptKvsKeys,
	)
)

embed docs.

View Source
var (
	FnHash = NewFunc(
		"hash",
		[]*Param{
			{
				Name: "text",
				Type: []ast.DType{ast.String},
			},
			{
				Name: "method",
				Type: []ast.DType{ast.String},
			},
		},
		[]ast.DType{ast.String},
		[2]*PLDoc{
			{
				Language: langTagZhCN, Doc: docHash,
				FnCategory: map[string][]string{
					langTagZhCN: {cStringOp}},
			},
			{
				Language: langTagEnUS, Doc: docHashEN,
				FnCategory: map[string][]string{
					langTagEnUS: {eStringOp},
				},
			},
		},
		hashFn,
	)
)

embed docs.

View Source
var FuncsCheckMap = map[string]runtime.FuncCheck{
	"agg_create":             AggCreateChecking,
	"agg_metric":             AggAddMetricChecking,
	"append":                 AppendChecking,
	"cidr":                   CIDRChecking,
	"grok":                   GrokChecking,
	"add_key":                AddkeyChecking,
	"delete":                 DeleteMapItemChecking,
	"adjust_timezone":        AdjustTimezoneChecking,
	"json":                   JSONChecking,
	"add_pattern":            AddPatternChecking,
	"b64dec":                 B64decChecking,
	"b64enc":                 B64encChecking,
	"cast":                   CastChecking,
	"datetime":               DateTimeChecking,
	"default_time":           DefaultTimeChecking,
	"default_time_with_fmt":  DefaultTimeWithFmtChecking,
	"drop":                   DropChecking,
	"drop_key":               DropkeyChecking,
	"drop_origin_data":       DropOriginDataChecking,
	"exit":                   ExitChecking,
	"geoip":                  GeoIPChecking,
	"get_key":                GetkeyChecking,
	"group_between":          GroupChecking,
	"group_in":               GroupInChecking,
	"kv_split":               KVSplitChecking,
	"len":                    LenChecking,
	"load_json":              LoadJSONChecking,
	"lowercase":              LowercaseChecking,
	"nullif":                 NullIfChecking,
	"rename":                 RenameChecking,
	"set_measurement":        SetMeasurementChecking,
	"set_tag":                SetTagChecking,
	"strfmt":                 StrfmtChecking,
	"trim":                   TrimChecking,
	"timestamp":              TimestampChecking,
	"uppercase":              UppercaseChecking,
	"use":                    UseChecking,
	"url_decode":             URLDecodeChecking,
	"user_agent":             UserAgentChecking,
	"parse_duration":         ParseDurationChecking,
	"parse_date":             ParseDateChecking,
	"cover":                  CoverChecking,
	"query_refer_table":      QueryReferTableChecking,
	"mquery_refer_table":     MQueryReferTableChecking,
	"replace":                ReplaceChecking,
	"duration_precision":     DurationPrecisionChecking,
	"sql_cover":              SQLCoverChecking,
	"xml":                    XMLChecking,
	"match":                  MatchChecking,
	"decode":                 DecodeChecking,
	"url_parse":              URLParseChecking,
	"sample":                 SampleChecking,
	"value_type":             ValueTypeChecking,
	"vaild_json":             ValidJSONChecking,
	"valid_json":             ValidJSONChecking,
	"conv_traceid_w3c_to_dd": ConvTraceIDW3C2DDChecking,
	"create_point":           CreatePointChecking,
	"parse_int":              ParseIntChecking,
	"format_int":             FormatIntChecking,
	"pt_name":                PtNameChecking,
	"http_request":           HTTPRequestChecking,
	"cache_get":              CacheGetChecking,
	"cache_set":              CacheSetChecking,
	"gjson":                  GJSONChecking,
	"point_window":           PtWindowChecking,
	"window_hit":             PtWindowHitChecking,

	"pt_kvs_set":  FnPtKvsSet.Check,
	"pt_kvs_get":  FnPtKvsGet.Check,
	"pt_kvs_del":  FnPtKvsDel.Check,
	"pt_kvs_keys": FnPtKvsKeys.Check,
	"hash":        FnHash.Check,

	"json_all": JSONAllChecking,
}
View Source
var FuncsMap = map[string]runtime.FuncCall{
	"agg_create":             AggCreate,
	"agg_metric":             AggAddMetric,
	"append":                 Append,
	"cidr":                   CIDR,
	"grok":                   Grok,
	"add_key":                AddKey,
	"delete":                 DeleteMapItem,
	"adjust_timezone":        AdjustTimezone,
	"json":                   JSON,
	"add_pattern":            AddPattern,
	"b64dec":                 B64dec,
	"b64enc":                 B64enc,
	"cast":                   Cast,
	"datetime":               DateTime,
	"default_time":           DefaultTime,
	"default_time_with_fmt":  DefaultTimeWithFmt,
	"drop":                   Drop,
	"drop_key":               Dropkey,
	"drop_origin_data":       DropOriginData,
	"exit":                   Exit,
	"geoip":                  GeoIP,
	"get_key":                Getkey,
	"group_between":          Group,
	"group_in":               GroupIn,
	"kv_split":               KVSplit,
	"lowercase":              Lowercase,
	"len":                    Len,
	"load_json":              LoadJSON,
	"nullif":                 NullIf,
	"rename":                 Rename,
	"set_tag":                SetTag,
	"set_measurement":        SetMeasurement,
	"strfmt":                 Strfmt,
	"trim":                   Trim,
	"timestamp":              Timestamp,
	"uppercase":              Uppercase,
	"use":                    Use,
	"url_decode":             URLDecode,
	"user_agent":             UserAgent,
	"parse_duration":         ParseDuration,
	"parse_date":             ParseDate,
	"cover":                  Cover,
	"query_refer_table":      QueryReferTable,
	"mquery_refer_table":     MQueryReferTableMulti,
	"replace":                Replace,
	"duration_precision":     DurationPrecision,
	"xml":                    XML,
	"match":                  Match,
	"sql_cover":              SQLCover,
	"decode":                 Decode,
	"sample":                 Sample,
	"url_parse":              URLParse,
	"value_type":             ValueType,
	"vaild_json":             ValidJSON,
	"valid_json":             ValidJSON,
	"conv_traceid_w3c_to_dd": ConvTraceIDW3C2DD,
	"create_point":           CreatePoint,
	"parse_int":              ParseInt,
	"format_int":             FormatInt,
	"pt_name":                PtName,
	"http_request":           HTTPRequest,
	"cache_get":              CacheGet,
	"cache_set":              CacheSet,
	"gjson":                  GJSON,
	"point_window":           PtWindow,
	"window_hit":             PtWindowHit,
	"pt_kvs_set":             FnPtKvsSet.Call,
	"pt_kvs_get":             FnPtKvsGet.Call,
	"pt_kvs_del":             FnPtKvsDel.Call,
	"pt_kvs_keys":            FnPtKvsKeys.Call,
	"hash":                   FnHash.Call,

	"json_all": JSONAll,
}
View Source
var PipelineFunctionDocs = map[string]*PLDoc{
	"add_key()":                &addKeyMarkdown,
	"add_pattern()":            &addPatternMarkdown,
	"adjust_timezone()":        &adjustTimezoneMarkdown,
	"agg_create()":             &aggCreateMarkdown,
	"agg_metric()":             &aggMetricMarkdown,
	"append()":                 &appendMarkdown,
	"b64dec()":                 &b64decMarkdown,
	"b64enc()":                 &b64encMarkdown,
	"cast()":                   &castMarkdown,
	"delete()":                 &deleteMarkdown,
	"cidr()":                   &cidrMarkdown,
	"cover()":                  &coverMarkdown,
	"datetime()":               &datetimeMarkdown,
	"decode()":                 &decodeMarkdown,
	"default_time()":           &defaultTimeMarkdown,
	"drop()":                   &dropMarkdown,
	"drop_key()":               &dropKeyMarkdown,
	"drop_origin_data()":       &dropOriginDataMarkdown,
	"duration_precision()":     &durationPrecisionMarkdown,
	"exit()":                   &exitMarkdown,
	"geoip()":                  &geoIPMarkdown,
	"get_key()":                &getKeyMarkdown,
	"grok()":                   &grokMarkdown,
	"group_between()":          &groupBetweenMarkdown,
	"group_in()":               &groupInMarkdown,
	"kv_split()":               &kvSplitMarkdown,
	"json()":                   &jsonMarkdown,
	"len()":                    &lenMarkdown,
	"load_json()":              &loadJSONMarkdown,
	"lowercase()":              &lowercaseMarkdown,
	"nullif()":                 &nullIfMarkdown,
	"parse_date()":             &parseDateMarkdown,
	"parse_duration()":         &parseDurationMarkdown,
	"query_refer_table()":      &queryReferTableMarkdown,
	"match()":                  &matchMarkdown,
	"mquery_refer_table()":     &mQueryReferTableMarkdown,
	"rename()":                 &renameMarkdown,
	"replace()":                &replaceMarkdown,
	"set_measurement()":        &setMeasurementMarkdown,
	"set_tag()":                &setTagMarkdown,
	"sql_cover()":              &sqlCoverMarkdown,
	"strfmt()":                 &strfmtMarkdown,
	"trim()":                   &trimMarkdown,
	"uppercase()":              &uppercaseMarkdown,
	"url_decode()":             &URLDecodeMarkdown,
	"use()":                    &useMarkdown,
	"user_agent()":             &userAgentMarkdown,
	"xml()":                    &xmlMarkdown,
	"sample()":                 &sampleMarkdown,
	"url_parse()":              &urlParseMarkdown,
	"timestamp()":              &timestampMarkdown,
	"value_type()":             &valueTypeMarkdown,
	"valid_json()":             &validJSONMarkdown,
	"conv_traceid_w3c_to_dd()": &convTraceID128MD,
	"create_point()":           &createPointMarkdown,
	"parse_int()":              &parseIntMarkdown,
	"format_int()":             &formatIntMarkdown,
	"pt_name()":                &ptNameMarkdown,
	"http_request()":           &HTTPRequestMarkdown,
	"cache_get()":              &CacheGetMarkdown,
	"cache_set()":              &CacheSetMarkdown,
	"gjson()":                  &gjsonMarkdown,
	"point_window()":           &pointWinodoeMarkdown,
	"window_hit()":             &winHitMarkdown,
	"pt_kvs_set()":             FnPtKvsSet.Doc[0],
	"pt_kvs_get()":             FnPtKvsGet.Doc[0],
	"pt_kvs_del()":             FnPtKvsDel.Doc[0],
	"pt_kvs_keys()":            FnPtKvsKeys.Doc[0],
	"hash()":                   FnHash.Doc[0],
}
View Source
var PipelineFunctionDocsEN = map[string]*PLDoc{
	"add_key()":                &addKeyMarkdownEN,
	"add_pattern()":            &addPatternMarkdownEN,
	"adjust_timezone()":        &adjustTimezoneMarkdownEN,
	"agg_create()":             &aggCreateMarkdownEN,
	"agg_metric()":             &aggMetricMarkdownEN,
	"append()":                 &appendMarkdownEN,
	"b64dec()":                 &b64decMarkdownEN,
	"b64enc()":                 &b64encMarkdownEN,
	"cast()":                   &castMarkdownEN,
	"delete()":                 &deleteMarkdownEN,
	"cidr()":                   &cidrMarkdownEN,
	"cover()":                  &coverMarkdownEN,
	"datetime()":               &datetimeMarkdownEN,
	"decode()":                 &decodeMarkdownEN,
	"default_time()":           &defaultTimeMarkdownEN,
	"drop()":                   &dropMarkdownEN,
	"drop_key()":               &dropKeyMarkdownEN,
	"drop_origin_data()":       &dropOriginDataMarkdownEN,
	"duration_precision()":     &durationPrecisionMarkdownEN,
	"exit()":                   &exitMarkdownEN,
	"geoip()":                  &geoIPMarkdownEN,
	"get_key()":                &getKeyMarkdownEN,
	"grok()":                   &grokMarkdownEN,
	"group_between()":          &groupBetweenMarkdownEN,
	"group_in()":               &groupInMarkdownEN,
	"kv_split()":               &kvSplitMarkdownEN,
	"json()":                   &jsonMarkdownEN,
	"len()":                    &lenMarkdownEN,
	"load_json()":              &loadJSONMarkdownEN,
	"lowercase()":              &lowercaseMarkdownEN,
	"nullif()":                 &nullIfMarkdownEN,
	"parse_date()":             &parseDateMarkdownEN,
	"parse_duration()":         &parseDurationMarkdownEN,
	"query_refer_table()":      &queryReferTableMarkdownEN,
	"match()":                  &matchMarkdownEN,
	"mquery_refer_table()":     &mQueryReferTableMarkdownEN,
	"rename()":                 &renameMarkdownEN,
	"replace()":                &replaceMarkdownEN,
	"set_measurement()":        &setMeasurementMarkdownEN,
	"set_tag()":                &setTagMarkdownEN,
	"sql_cover()":              &sqlCoverMarkdownEN,
	"strfmt()":                 &strfmtMarkdownEN,
	"trim()":                   &trimMarkdownEN,
	"uppercase()":              &uppercaseMarkdownEN,
	"url_decode()":             &URLDecodeMarkdownEN,
	"use()":                    &useMarkdownEN,
	"user_agent()":             &userAgentMarkdownEN,
	"xml()":                    &xmlMarkdownEN,
	"sample()":                 &sampleMarkdownEN,
	"url_parse()":              &urlParseMarkdownEN,
	"timestamp()":              &timestampMarkdownEN,
	"value_type()":             &valueTypeMarkdownEN,
	"valid_json()":             &validJSONMarkdownEN,
	"conv_traceid_w3c_to_dd()": &convTraceID128MDEN,
	"create_point()":           &createPointMarkdownEN,
	"parse_int()":              &parseIntMarkdownEN,
	"format_int()":             &formatIntMarkdownEN,
	"pt_name()":                &ptNameMarkdownEN,
	"http_request()":           &HTTPRequestMarkdownEN,
	"cache_get()":              &CacheGetMarkdownEN,
	"cache_set()":              &CacheSetMarkdownEN,
	"gjson()":                  &gjsonMarkdownEN,
	"point_window()":           &pointWinodoeMarkdownEN,
	"window_hit()":             &winHitMarkdownEN,
	"pt_kvs_set()":             FnPtKvsSet.Doc[1],
	"pt_kvs_get()":             FnPtKvsGet.Doc[1],
	"pt_kvs_del()":             FnPtKvsDel.Doc[1],
	"pt_kvs_keys()":            FnPtKvsKeys.Doc[1],
	"hash()":                   FnHash.Doc[1],
}

Functions

func AddKey

func AddKey(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AddPattern

func AddPattern(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AddPatternChecking

func AddPatternChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AddkeyChecking

func AddkeyChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AdjustTimezone

func AdjustTimezone(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AdjustTimezoneChecking

func AdjustTimezoneChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AggAddMetric

func AggAddMetric(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AggAddMetricChecking

func AggAddMetricChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AggCreate

func AggCreate(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AggCreateChecking

func AggCreateChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Append

func Append(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func AppendChecking

func AppendChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func B64dec

func B64dec(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func B64decChecking

func B64decChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func B64enc

func B64enc(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func B64encChecking

func B64encChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CIDR

func CIDR(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CIDRChecking

func CIDRChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CIDRContains

func CIDRContains(ipAddr, prefix string) (bool, error)

func CacheGet added in v1.1.12

func CacheGet(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CacheGetChecking added in v1.1.12

func CacheGetChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CacheSet added in v1.1.12

func CacheSet(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CacheSetChecking added in v1.1.12

func CacheSetChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Cast

func Cast(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CastChecking

func CastChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ConvTraceIDW3C2DD

func ConvTraceIDW3C2DD(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ConvTraceIDW3C2DDChecking

func ConvTraceIDW3C2DDChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Cover

func Cover(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CoverChecking

func CoverChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CreatePoint

func CreatePoint(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func CreatePointChecking

func CreatePointChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DateFormatHandle

func DateFormatHandle(t *time.Time, fmts string) (string, error)

func DateTime

func DateTime(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DateTimeChecking

func DateTimeChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Decode

func Decode(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DecodeChecking

func DecodeChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DefaultTime

func DefaultTime(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DefaultTimeChecking

func DefaultTimeChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DefaultTimeWithFmt

func DefaultTimeWithFmt(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DefaultTimeWithFmtChecking

func DefaultTimeWithFmtChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DeleteMapItem

func DeleteMapItem(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DeleteMapItemChecking

func DeleteMapItemChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Drop

func Drop(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DropChecking

func DropChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DropOriginData

func DropOriginData(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DropOriginDataChecking

func DropOriginDataChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Dropkey

func Dropkey(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DropkeyChecking

func DropkeyChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DurationPrecision

func DurationPrecision(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func DurationPrecisionChecking

func DurationPrecisionChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Exit

func Exit(ctx *runtime.Task, node *ast.CallExpr) *errchain.PlError

func ExitChecking

func ExitChecking(ctx *runtime.Task, node *ast.CallExpr) *errchain.PlError

func Expr

func Expr(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ExprChecking

func ExprChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func FormatInt

func FormatInt(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func FormatIntChecking

func FormatIntChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GJSON added in v1.1.14

func GJSON(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GJSONChecking added in v1.1.14

func GJSONChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GeoIP

func GeoIP(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GeoIPChecking

func GeoIPChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GeoIPHandle

func GeoIPHandle(db ipdb.IPdb, ip string) (map[string]string, error)

func Getkey

func Getkey(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GetkeyChecking

func GetkeyChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Grok

func Grok(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GrokChecking

func GrokChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Group

func Group(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GroupChecking

func GroupChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GroupHandle

func GroupHandle(value interface{}, start, end float64) bool

func GroupIn

func GroupIn(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GroupInChecking

func GroupInChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func GroupInHandle

func GroupInHandle(value interface{}, set []interface{}) bool

func GsonGet

func GsonGet(s string, node *ast.Node, deleteAfter bool) (any, string, error)

func HTTPRequest added in v1.1.12

func HTTPRequest(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func HTTPRequestChecking added in v1.1.12

func HTTPRequestChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func InitLog

func InitLog()

func JSON

func JSON(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func JSONAll

func JSONAll(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func JSONAllChecking

func JSONAllChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func JSONChecking

func JSONChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func JSONParse

func JSONParse(jsonStr string) map[string]interface{}

func KVSplit

func KVSplit(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func KVSplitChecking

func KVSplitChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Len

func Len(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func LenChecking

func LenChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func LoadJSON

func LoadJSON(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func LoadJSONChecking

func LoadJSONChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Lowercase

func Lowercase(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func LowercaseChecking

func LowercaseChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func MQueryReferTableChecking

func MQueryReferTableChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func MQueryReferTableMulti

func MQueryReferTableMulti(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Match

func Match(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func MatchChecking

func MatchChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func NullIf

func NullIf(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func NullIfChecking

func NullIfChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ParseDate

func ParseDate(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ParseDateChecking

func ParseDateChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ParseDuration

func ParseDuration(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ParseDurationChecking

func ParseDurationChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ParseInt

func ParseInt(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ParseIntChecking

func ParseIntChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func PtName

func PtName(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func PtNameChecking

func PtNameChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func PtWindow added in v1.1.15

func PtWindow(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func PtWindowChecking added in v1.1.15

func PtWindowChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func PtWindowHit added in v1.1.15

func PtWindowHit(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func PtWindowHitChecking added in v1.1.15

func PtWindowHitChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func QueryReferTable

func QueryReferTable(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func QueryReferTableChecking

func QueryReferTableChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Rename

func Rename(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func RenameChecking

func RenameChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Replace

func Replace(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ReplaceChecking

func ReplaceChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func SQLCover

func SQLCover(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func SQLCoverChecking

func SQLCoverChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Sample

func Sample(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func SampleChecking

func SampleChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func SetMeasurement

func SetMeasurement(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func SetMeasurementChecking

func SetMeasurementChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func SetTag

func SetTag(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func SetTagChecking

func SetTagChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Strfmt

func Strfmt(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func StrfmtChecking

func StrfmtChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Timestamp

func Timestamp(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func TimestampChecking

func TimestampChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func TimestampHandle

func TimestampHandle(value, tz string) (int64, error)

func Trim

func Trim(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func TrimChecking

func TrimChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func URLDecode

func URLDecode(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func URLDecodeChecking

func URLDecodeChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func URLParse

func URLParse(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func URLParseChecking

func URLParseChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func Uppercase

func Uppercase(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func UppercaseChecking

func UppercaseChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func UrldecodeHandle

func UrldecodeHandle(path string) (string, error)

func Use

func Use(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func UseChecking

func UseChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func UserAgent

func UserAgent(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func UserAgentChecking

func UserAgentChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func UserAgentHandle

func UserAgentHandle(str string) (map[string]interface{}, map[string]ast.DType)

func ValidJSON

func ValidJSON(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ValidJSONChecking

func ValidJSONChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ValueType

func ValueType(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func ValueTypeChecking

func ValueTypeChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func VarPDefaultVal added in v1.1.21

func VarPDefaultVal() (any, ast.DType)

func WrapFnCall added in v1.1.21

func WrapFnCall(fn FnCall, paramDesc []*Param) runtime.FuncCall

func WrapFnCheck added in v1.1.21

func WrapFnCheck(paramDesc []*Param) runtime.FuncCheck

func XML

func XML(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

func XMLChecking

func XMLChecking(ctx *runtime.Task, funcExpr *ast.CallExpr) *errchain.PlError

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(enc string) (*Decoder, error)

type FnCall added in v1.1.21

type FnCall func(ctx *runtime.Task, funcExpr *ast.CallExpr, vals ...any) *errchain.PlError

type Function added in v1.1.21

type Function struct {
	Name string
	Args []*Param

	Call  runtime.FuncCall
	Check runtime.FuncCheck

	Doc [2]*PLDoc // zh, en

	Deprecated bool
}

func NewFunc added in v1.1.21

func NewFunc(name string, params []*Param, ret []ast.DType, doc [2]*PLDoc, run FnCall) *Function

type PLDoc

type PLDoc struct {
	Language        string              `json:"language"`
	Doc             string              `json:"doc"`
	Prototype       string              `json:"prototype"`
	Description     string              `json:"description"`
	Deprecated      bool                `json:"deprecated"`
	RequiredVersion string              `json:"required_version"`
	FnCategory      map[string][]string `json:"fn_category"`
}

type Param added in v1.1.21

type Param struct {
	Name string
	Type []ast.DType

	DefaultVal func() (any, ast.DType)
	Optional   bool
	VariableP  bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL