aboutsummaryrefslogtreecommitdiff
path: root/lib/websocket/opcode.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2019-03-12 14:18:06 +0700
committerShulhan <ms@kilabit.info>2019-03-12 14:18:06 +0700
commitd7367ec27c04920fc5cb9ef0b1aad140ceac3080 (patch)
tree92433cad5cd34025b9d0a979ce0dca80cfbcef09 /lib/websocket/opcode.go
parent7233d915b3051ffc996d755dc446563bc94f3a7c (diff)
downloadpakakeh.go-d7367ec27c04920fc5cb9ef0b1aad140ceac3080.tar.xz
websocket: export the opcode type
The opcode type is required to create new frame and to get the opcode in continous frames.
Diffstat (limited to 'lib/websocket/opcode.go')
-rw-r--r--lib/websocket/opcode.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/websocket/opcode.go b/lib/websocket/opcode.go
index 3e49cf79..635285f2 100644
--- a/lib/websocket/opcode.go
+++ b/lib/websocket/opcode.go
@@ -4,26 +4,26 @@
package websocket
-type opcode byte
+type Opcode byte
//
// List of valid operation code in frame.
//
const (
- opcodeCont opcode = 0x0
- opcodeText opcode = 0x1
- opcodeBin opcode = 0x2
- opcodeDataRsv3 opcode = 0x3 // %x3-7 are reserved for further non-control frames
- opcodeDataRsv4 opcode = 0x4
- opcodeDataRsv5 opcode = 0x5
- opcodeDataRsv6 opcode = 0x6
- opcodeDataRsv7 opcode = 0x7
- opcodeClose opcode = 0x8
- opcodePing opcode = 0x9
- opcodePong opcode = 0xA
- opcodeControlRsvB opcode = 0xB // %xB-F are reserved for further control frames
- opcodeControlRsvC opcode = 0xC
- opcodeControlRsvD opcode = 0xD
- opcodeControlRsvE opcode = 0xE
- opcodeControlRsvF opcode = 0xF
+ OpcodeCont Opcode = 0x0
+ OpcodeText Opcode = 0x1
+ OpcodeBin Opcode = 0x2
+ OpcodeDataRsv3 Opcode = 0x3 // %x3-7 are reserved for further non-control frames
+ OpcodeDataRsv4 Opcode = 0x4
+ OpcodeDataRsv5 Opcode = 0x5
+ OpcodeDataRsv6 Opcode = 0x6
+ OpcodeDataRsv7 Opcode = 0x7
+ OpcodeClose Opcode = 0x8
+ OpcodePing Opcode = 0x9
+ OpcodePong Opcode = 0xA
+ OpcodeControlRsvB Opcode = 0xB // %xB-F are reserved for further control frames
+ OpcodeControlRsvC Opcode = 0xC
+ OpcodeControlRsvD Opcode = 0xD
+ OpcodeControlRsvE Opcode = 0xE
+ OpcodeControlRsvF Opcode = 0xF
)