Skip to content

Commit 0d59087

Browse files
authored
Merge pull request #20 from oldduckruirui/main
add l7_protocol_str for ZMTP demo
2 parents 7137f45 + 4f287e8 commit 0d59087

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

example/zmtp/zmtp.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@ func (p ZrpcParser) onZMTPMessage(payload []byte) sdk.Action {
4545
jsonData = nil
4646
}
4747
jsonStr := string(jsonData)
48-
return sdk.CustomMessageActionAbortWithResult([]sdk.KeyVal{
49-
{
50-
Key: "json_payload",
51-
Val: jsonStr,
48+
return sdk.ParseActionAbortWithL7Info([]*sdk.L7ProtocolInfo{{
49+
Resp: &sdk.Response{},
50+
Req: &sdk.Request{},
51+
Trace: nil,
52+
Kv: []sdk.KeyVal{
53+
{
54+
Key: "json_payload",
55+
Val: jsonStr,
56+
},
5257
},
53-
})
58+
L7ProtocolStr: "Protobuf",
59+
}})
5460
}
5561

5662
func (p ZrpcParser) OnCustomMessage(ctx *sdk.CustomMessageCtx) sdk.Action {

0 commit comments

Comments
 (0)