File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
package websocket
2
2
3
3
// DataType represents the Opcode of a WebSocket data frame.
4
- //go:generate go run golang.org/x/tools/cmd/stringer -type=DataType
5
4
type DataType int
5
+ //go:generate go run golang.org/x/tools/cmd/stringer -type=DataType
6
6
7
7
// DataType constants.
8
8
const (
Original file line number Diff line number Diff line change 1
1
package websocket
2
2
3
3
// opcode represents a WebSocket Opcode.
4
- //go:generate go run golang.org/x/tools/cmd/stringer -type=opcode
5
4
type opcode int
5
+ //go:generate go run golang.org/x/tools/cmd/stringer -type=opcode
6
6
7
7
// opcode constants.
8
8
const (
9
9
opContinuation opcode = iota
10
10
opText
11
11
opBinary
12
12
// 3 - 7 are reserved for further non-control frames.
13
- opClose opcode = 8 + iota - 3
13
+ _
14
+ _
15
+ _
16
+ _
17
+ _
18
+ opClose
14
19
opPing
15
20
opPong
16
21
// 11-16 are reserved for further control frames.
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ import (
11
11
)
12
12
13
13
// StatusCode represents a WebSocket status code.
14
- //go:generate go run golang.org/x/tools/cmd/stringer -type=StatusCode
15
14
type StatusCode int
15
+ //go:generate go run golang.org/x/tools/cmd/stringer -type=StatusCode
16
16
17
17
// These codes were retrieved from:
18
18
// https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number
@@ -21,8 +21,8 @@ const (
21
21
StatusGoingAway
22
22
StatusProtocolError
23
23
StatusUnsupportedData
24
- // 1004 is reserved.
25
- StatusNoStatusRcvd StatusCode = 1005 + iota - 4
24
+ _ // 1004 is reserved.
25
+ StatusNoStatusRcvd
26
26
StatusAbnormalClosure
27
27
StatusInvalidFramePayloadData
28
28
StatusPolicyViolation
You can’t perform that action at this time.
0 commit comments