forked from QUIC-Tracker/quic-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson.go
More file actions
82 lines (73 loc) · 3.86 KB
/
json.go
File metadata and controls
82 lines (73 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package quictracker
//go:generate jsonenums -type=JSONType
type JSONType int
const (
InitialPacketJSON JSONType = iota
RetryPacketJSON
StatelessResetPacketJSON
VersionNegotiationPacketJSON
HandshakePacketJSON
ProtectedPacketJSON
ZeroRTTProtectedPacketJSON
ShortHeaderJSON
LongHeaderJSON
PaddingFrameJSON
PingFrameJSON
AckFrameJSON
AckECNFrameJSON
ResetStreamJSON
StopSendingFrameJSON
CryptoFrameJSON
NewTokenFrameJSON
StreamFrameJSON
MaxDataFrameJSON
MaxStreamsFrameJSON
MaxStreamDataFrameJSON
DataBlockedFrameJSON
StreamDataBlockedFrameJSON
StreamsBlockedFrameJSON
NewConnectionIdFrameJSON
RetireConnectionIdJSON
PathChallengeJSON
PathResponseJSON
ConnectionCloseFrameJSON
ApplicationCloseFrameJSON
HandshakeDoneFrameJSON
)
var JSONTypeHandlers = map[JSONType]func() interface{} {
InitialPacketJSON: func() interface{} { type local InitialPacket; return new(local) },
RetryPacketJSON: func() interface{} { type local RetryPacket; return new(local) },
StatelessResetPacketJSON: func() interface{} { type local StatelessResetPacket; return new(local) },
VersionNegotiationPacketJSON: func() interface{} { type local VersionNegotiationPacket; return new(local) },
HandshakePacketJSON: func() interface{} { type local HandshakePacket; return new(local) },
ProtectedPacketJSON: func() interface{} { type local ProtectedPacket; return new(local) },
ZeroRTTProtectedPacketJSON: func() interface{} { type local ZeroRTTProtectedPacket; return new(local) },
ShortHeaderJSON: func() interface{} { type local ShortHeader; return new(local) },
LongHeaderJSON: func() interface{} { type local LongHeader; return new(local) },
PaddingFrameJSON: func() interface{} { type local PaddingFrame; return new(local) },
PingFrameJSON: func() interface{} { type local PingFrame; return new(local) },
AckFrameJSON: func() interface{} { type local AckFrame; return new(local) },
AckECNFrameJSON: func() interface{} { type local AckECNFrame; return new(local) },
ResetStreamJSON: func() interface{} { type local ResetStream; return new(local) },
StopSendingFrameJSON: func() interface{} { type local StopSendingFrame; return new(local) },
CryptoFrameJSON: func() interface{} { type local CryptoFrame; return new(local) },
NewTokenFrameJSON: func() interface{} { type local NewTokenFrame; return new(local) },
StreamFrameJSON: func() interface{} { type local StreamFrame; return new(local) },
MaxDataFrameJSON: func() interface{} { type local MaxDataFrame; return new(local) },
MaxStreamsFrameJSON: func() interface{} { type local MaxStreamsFrame; return new(local) },
MaxStreamDataFrameJSON: func() interface{} { type local MaxStreamDataFrame; return new(local) },
DataBlockedFrameJSON: func() interface{} { type local DataBlockedFrame; return new(local) },
StreamDataBlockedFrameJSON: func() interface{} { type local StreamDataBlockedFrame; return new(local) },
StreamsBlockedFrameJSON: func() interface{} { type local StreamsBlockedFrame; return new(local) },
NewConnectionIdFrameJSON: func() interface{} { type local NewConnectionIdFrame; return new(local) },
RetireConnectionIdJSON: func() interface{} { type local RetireConnectionId; return new(local) },
PathChallengeJSON: func() interface{} { type local PathChallenge; return new(local) },
PathResponseJSON: func() interface{} { type local PathResponse; return new(local) },
ConnectionCloseFrameJSON: func() interface{} { type local ConnectionCloseFrame; return new(local) },
ApplicationCloseFrameJSON: func() interface{} { type local ApplicationCloseFrame; return new(local) },
HandshakeDoneFrameJSON: func() interface{} { type local HandshakeDoneFrame; return new(local) },
}
type Envelope struct {
Type JSONType
Message interface{}
}