Skip to content

Commit

Permalink
Add pipeline functions
Browse files Browse the repository at this point in the history
  • Loading branch information
zwj authored and 谭彪 committed Aug 21, 2024
1 parent 5e1edaf commit b395593
Show file tree
Hide file tree
Showing 107 changed files with 2,366 additions and 1,504 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/DataDog/gopsutil v1.2.1
github.com/GuanceCloud/confd v0.1.101
github.com/GuanceCloud/grok v1.1.4
github.com/GuanceCloud/platypus v0.2.9
github.com/GuanceCloud/platypus v0.2.10-0.20240815092339-21f3924850ee
github.com/GuanceCloud/timeout v0.0.0-20230216045952-48442c6fb747
github.com/IBM/sarama v1.41.2
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
Expand Down Expand Up @@ -349,7 +349,7 @@ require (

require (
github.com/DataDog/ebpf-manager v0.2.16
github.com/GuanceCloud/cliutils v1.1.21-0.20240820061659-b3501c0f2e71
github.com/GuanceCloud/cliutils v1.1.21-0.20240821062850-3079bb7ed98d
github.com/andrewkroh/sys v0.0.0-20151128191922-287798fe3e43
github.com/brianvoe/gofakeit/v6 v6.28.0
github.com/cilium/ebpf v0.11.0
Expand Down
15 changes: 4 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,8 @@ github.com/DataDog/sketches-go v1.4.1 h1:j5G6as+9FASM2qC36lvpvQAj9qsv/jUs3FtO8Cw
github.com/DataDog/sketches-go v1.4.1/go.mod h1:xJIXldczJyyjnbDop7ZZcLxJdV3+7Kra7H1KMgpgkLk=
github.com/GuanceCloud/client_model v0.0.0-20230418154757-93bd4e878a5e h1:i34dA4kiRTfG+KdvkIXCLPDduarVeFlQhGDD3TefgS4=
github.com/GuanceCloud/client_model v0.0.0-20230418154757-93bd4e878a5e/go.mod h1:PMnE48aPzuRu83FmWZugC0O3d54ZupJd/MmiaYxz8sM=
github.com/GuanceCloud/cliutils v1.1.21-0.20240724044511-a592422e3402 h1:14RV/0zUQEuBDVveaQjDdYP67cxaEO+roOCCCcpWrBA=
github.com/GuanceCloud/cliutils v1.1.21-0.20240724044511-a592422e3402/go.mod h1:JOSrgcF3LbVmicqC7gz2RDZ/U6hmJCKcfUhIQYTTeMQ=
github.com/GuanceCloud/cliutils v1.1.21-0.20240820061659-b3501c0f2e71 h1:2y+LooXu02ThgiANst2j/pjXapyVif+nw1NiUv1P8Z4=
github.com/GuanceCloud/cliutils v1.1.21-0.20240820061659-b3501c0f2e71/go.mod h1:JOSrgcF3LbVmicqC7gz2RDZ/U6hmJCKcfUhIQYTTeMQ=
github.com/GuanceCloud/cliutils v1.1.21-0.20240821062850-3079bb7ed98d h1:dM5YEBXuFuwiZ5roAzxfA8RK2VwE0TnHAl5zAsHSKFg=
github.com/GuanceCloud/cliutils v1.1.21-0.20240821062850-3079bb7ed98d/go.mod h1:Qbeedf/Ji3immd8Ka01NDQG6SP6j8JBnbZwsHTtxyqs=
github.com/GuanceCloud/confd v0.1.101 h1:yjHgfl6YzAlTbFOFMTE4ERpFJzIyovOW7ZFc2/ZssL0=
github.com/GuanceCloud/confd v0.1.101/go.mod h1:o0opIwOX+yNwV9nh56x5ymFMJ+YBD8JuPxBJ7a1mEmo=
github.com/GuanceCloud/dockertest/v3 v3.9.4 h1:ScSNhfA2HSNLfrYoNd1KSRxkrymlKiBE60g4f6eUoOk=
Expand All @@ -163,8 +161,8 @@ github.com/GuanceCloud/kubernetes v0.0.0-20230801080916-ca299820872b h1:9pkl38Cr
github.com/GuanceCloud/kubernetes v0.0.0-20230801080916-ca299820872b/go.mod h1:Acv+3eRHxCb4Qvs1YQcZ17X/D0H7DArQrew+WJtsLiE=
github.com/GuanceCloud/mdcheck v0.0.0-20230718065937-44c6728c995f h1:0+A0eeT48LSlnDpVOQ/sqoW/lbYmerKKF7NVNBlgnww=
github.com/GuanceCloud/mdcheck v0.0.0-20230718065937-44c6728c995f/go.mod h1:xrC7I8mMBOD93+A7fLJXU1lBaej49hZj7DaaFXFdSBE=
github.com/GuanceCloud/platypus v0.2.9 h1:ZQNlg/r2HKFBUn5Yrzb0fmB15zhLBkiuQbe+yX6CBr4=
github.com/GuanceCloud/platypus v0.2.9/go.mod h1:H9Sol/SI+A9ppJUohdn9m/UA0aiNvh+G0/GnY6IVDnI=
github.com/GuanceCloud/platypus v0.2.10-0.20240815092339-21f3924850ee h1:UHnR2IVFcwCCqLp6iSsh4Xn6fX93hujzDOx6RdCwM9c=
github.com/GuanceCloud/platypus v0.2.10-0.20240815092339-21f3924850ee/go.mod h1:H9Sol/SI+A9ppJUohdn9m/UA0aiNvh+G0/GnY6IVDnI=
github.com/GuanceCloud/promcommon v0.0.0-20230828165048-8a8ac696e616 h1:l2/OF8jg2mcvAv5OzJWyooCEEcL2b0yATSl/iXUrvQ8=
github.com/GuanceCloud/promcommon v0.0.0-20230828165048-8a8ac696e616/go.mod h1:zuawsU7vK4z3rZC2qaOYnhJO2rHD0CIUAgbyJxpjIf0=
github.com/GuanceCloud/pyroscope v0.36.3 h1:3ni9asu1zsxzT/Y8WdoqcTN3LiAuFbCqAUk4foz2EvM=
Expand Down Expand Up @@ -1511,7 +1509,6 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE=
github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74=
github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
Expand Down Expand Up @@ -1645,7 +1642,6 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20180717111219-efc7eb8984d6/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
Expand Down Expand Up @@ -1936,7 +1932,6 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9
github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
Expand Down Expand Up @@ -2180,7 +2175,6 @@ github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
Expand All @@ -2190,7 +2184,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/streadway/amqp v0.0.0-20180528204448-e5adc2ada8b8/go.mod h1:1WNBiOZtZQLpVAyu0iTduoJL9hEsMloAK5XWrtW0xdY=
Expand Down
26 changes: 13 additions & 13 deletions internal/plugins/externals/ebpf/internal/l4log/filter_blacklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (g *filterRuntime) runNetFilterDrop(stmts ast.Stmts, elem netElem) bool {
func (g *filterRuntime) _runStmt(node *ast.Node, elem netElem) (ast.DType, any, error) {
switch node.NodeType { //nolint:exhaustive
case ast.TypeConditionalExpr:
expr := node.ConditionalExpr
expr := node.ConditionalExpr()
typL, valL, err := g._runStmt(expr.LHS, elem)
if err != nil {
return ast.Invalid, nil, err
Expand Down Expand Up @@ -276,14 +276,14 @@ func (g *filterRuntime) _runStmt(node *ast.Node, elem netElem) (ast.DType, any,

return ast.Bool, false, nil
case ast.TypeUnaryExpr:
expr := node.UnaryExpr
expr := node.UnaryExpr()
_, val, err := g._runStmt(expr.RHS, elem)
if err != nil {
return ast.Invalid, nil, err
}
return ast.Bool, !val.(bool), nil
case ast.TypeCallExpr:
expr := node.CallExpr
expr := node.CallExpr()

if g.fnG == nil {
return ast.Invalid, nil, fmt.Errorf("no function group")
Expand All @@ -300,17 +300,17 @@ func (g *filterRuntime) _runStmt(node *ast.Node, elem netElem) (ast.DType, any,
}
return fnD.ret, fnD.fn(p...), nil
case ast.TypeParenExpr:
return g._runStmt(node.ParenExpr.Param, elem)
return g._runStmt(node.ParenExpr().Param, elem)
case ast.TypeIdentifier:
expr := node.Identifier
expr := node.Identifier()
dtyp, val := elem.get(expr.Name)
return dtyp, val, nil
case ast.TypeStringLiteral:
return ast.String, node.StringLiteral.Val, nil
return ast.String, node.StringLiteral().Val, nil
case ast.TypeIntegerLiteral:
return ast.Int, node.IntegerLiteral.Val, nil
return ast.Int, node.IntegerLiteral().Val, nil
case ast.TypeBoolLiteral:
return ast.Bool, node.BoolLiteral.Val, nil
return ast.Bool, node.BoolLiteral().Val, nil
default:
return ast.Invalid, nil, fmt.Errorf("unsupport type: %s", node.NodeType)
}
Expand All @@ -319,7 +319,7 @@ func (g *filterRuntime) _runStmt(node *ast.Node, elem netElem) (ast.DType, any,
func (g *filterRuntime) _checkStmt(node *ast.Node, elem netElem) (ast.DType, error) {
switch node.NodeType { //nolint:exhaustive
case ast.TypeConditionalExpr:
expr := node.ConditionalExpr
expr := node.ConditionalExpr()
switch expr.Op { //nolint:exhaustive
case ast.AND, ast.OR,
ast.EQEQ, ast.NEQ,
Expand Down Expand Up @@ -361,7 +361,7 @@ func (g *filterRuntime) _checkStmt(node *ast.Node, elem netElem) (ast.DType, err
}
return ast.Bool, nil
case ast.TypeUnaryExpr:
expr := node.UnaryExpr
expr := node.UnaryExpr()
if expr.Op != ast.NOT {
return ast.Invalid, fmt.Errorf("%d%d: unsupport operator: %s", expr.OpPos.Ln, expr.OpPos.Col, expr.Op)
}
Expand All @@ -374,7 +374,7 @@ func (g *filterRuntime) _checkStmt(node *ast.Node, elem netElem) (ast.DType, err
}
return ast.Bool, nil
case ast.TypeCallExpr:
expr := node.CallExpr
expr := node.CallExpr()
if g.fnG == nil {
return ast.Invalid, fmt.Errorf("%d%d: unsupport function: %s", expr.NamePos.Ln, expr.NamePos.Col, expr.Name)
}
Expand Down Expand Up @@ -406,9 +406,9 @@ func (g *filterRuntime) _checkStmt(node *ast.Node, elem netElem) (ast.DType, err
}
return fnD.ret, nil
case ast.TypeParenExpr:
return g._checkStmt(node.ParenExpr.Param, elem)
return g._checkStmt(node.ParenExpr().Param, elem)
case ast.TypeIdentifier:
expr := node.Identifier
expr := node.Identifier()
if v, _ := elem.get(expr.Name); v != ast.Invalid {
switch v { //nolint:exhaustive
case ast.Int, ast.Bool, ast.String:
Expand Down
1 change: 0 additions & 1 deletion internal/plugins/inputs/dialtesting/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ func (ipt *Input) dispatchTasks(j []byte) error {
} else if k == "name_en" {
ipt.regionNameEn = v_
}

}
default:
l.Warnf("ignore key `%s' of type %s", k, reflect.TypeOf(v).String())
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b395593

Please sign in to comment.