1 | // Code generated by "stringer -type=opcode,MessageType,StatusCode -output=stringer.go"; DO NOT EDIT.
|
---|
2 |
|
---|
3 | package websocket
|
---|
4 |
|
---|
5 | import "strconv"
|
---|
6 |
|
---|
7 | func _() {
|
---|
8 | // An "invalid array index" compiler error signifies that the constant values have changed.
|
---|
9 | // Re-run the stringer command to generate them again.
|
---|
10 | var x [1]struct{}
|
---|
11 | _ = x[opContinuation-0]
|
---|
12 | _ = x[opText-1]
|
---|
13 | _ = x[opBinary-2]
|
---|
14 | _ = x[opClose-8]
|
---|
15 | _ = x[opPing-9]
|
---|
16 | _ = x[opPong-10]
|
---|
17 | }
|
---|
18 |
|
---|
19 | const (
|
---|
20 | _opcode_name_0 = "opContinuationopTextopBinary"
|
---|
21 | _opcode_name_1 = "opCloseopPingopPong"
|
---|
22 | )
|
---|
23 |
|
---|
24 | var (
|
---|
25 | _opcode_index_0 = [...]uint8{0, 14, 20, 28}
|
---|
26 | _opcode_index_1 = [...]uint8{0, 7, 13, 19}
|
---|
27 | )
|
---|
28 |
|
---|
29 | func (i opcode) String() string {
|
---|
30 | switch {
|
---|
31 | case 0 <= i && i <= 2:
|
---|
32 | return _opcode_name_0[_opcode_index_0[i]:_opcode_index_0[i+1]]
|
---|
33 | case 8 <= i && i <= 10:
|
---|
34 | i -= 8
|
---|
35 | return _opcode_name_1[_opcode_index_1[i]:_opcode_index_1[i+1]]
|
---|
36 | default:
|
---|
37 | return "opcode(" + strconv.FormatInt(int64(i), 10) + ")"
|
---|
38 | }
|
---|
39 | }
|
---|
40 | func _() {
|
---|
41 | // An "invalid array index" compiler error signifies that the constant values have changed.
|
---|
42 | // Re-run the stringer command to generate them again.
|
---|
43 | var x [1]struct{}
|
---|
44 | _ = x[MessageText-1]
|
---|
45 | _ = x[MessageBinary-2]
|
---|
46 | }
|
---|
47 |
|
---|
48 | const _MessageType_name = "MessageTextMessageBinary"
|
---|
49 |
|
---|
50 | var _MessageType_index = [...]uint8{0, 11, 24}
|
---|
51 |
|
---|
52 | func (i MessageType) String() string {
|
---|
53 | i -= 1
|
---|
54 | if i < 0 || i >= MessageType(len(_MessageType_index)-1) {
|
---|
55 | return "MessageType(" + strconv.FormatInt(int64(i+1), 10) + ")"
|
---|
56 | }
|
---|
57 | return _MessageType_name[_MessageType_index[i]:_MessageType_index[i+1]]
|
---|
58 | }
|
---|
59 | func _() {
|
---|
60 | // An "invalid array index" compiler error signifies that the constant values have changed.
|
---|
61 | // Re-run the stringer command to generate them again.
|
---|
62 | var x [1]struct{}
|
---|
63 | _ = x[StatusNormalClosure-1000]
|
---|
64 | _ = x[StatusGoingAway-1001]
|
---|
65 | _ = x[StatusProtocolError-1002]
|
---|
66 | _ = x[StatusUnsupportedData-1003]
|
---|
67 | _ = x[statusReserved-1004]
|
---|
68 | _ = x[StatusNoStatusRcvd-1005]
|
---|
69 | _ = x[StatusAbnormalClosure-1006]
|
---|
70 | _ = x[StatusInvalidFramePayloadData-1007]
|
---|
71 | _ = x[StatusPolicyViolation-1008]
|
---|
72 | _ = x[StatusMessageTooBig-1009]
|
---|
73 | _ = x[StatusMandatoryExtension-1010]
|
---|
74 | _ = x[StatusInternalError-1011]
|
---|
75 | _ = x[StatusServiceRestart-1012]
|
---|
76 | _ = x[StatusTryAgainLater-1013]
|
---|
77 | _ = x[StatusBadGateway-1014]
|
---|
78 | _ = x[StatusTLSHandshake-1015]
|
---|
79 | }
|
---|
80 |
|
---|
81 | const _StatusCode_name = "StatusNormalClosureStatusGoingAwayStatusProtocolErrorStatusUnsupportedDatastatusReservedStatusNoStatusRcvdStatusAbnormalClosureStatusInvalidFramePayloadDataStatusPolicyViolationStatusMessageTooBigStatusMandatoryExtensionStatusInternalErrorStatusServiceRestartStatusTryAgainLaterStatusBadGatewayStatusTLSHandshake"
|
---|
82 |
|
---|
83 | var _StatusCode_index = [...]uint16{0, 19, 34, 53, 74, 88, 106, 127, 156, 177, 196, 220, 239, 259, 278, 294, 312}
|
---|
84 |
|
---|
85 | func (i StatusCode) String() string {
|
---|
86 | i -= 1000
|
---|
87 | if i < 0 || i >= StatusCode(len(_StatusCode_index)-1) {
|
---|
88 | return "StatusCode(" + strconv.FormatInt(int64(i+1000), 10) + ")"
|
---|
89 | }
|
---|
90 | return _StatusCode_name[_StatusCode_index[i]:_StatusCode_index[i+1]]
|
---|
91 | }
|
---|