forked from dropbox/godropbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.go
107 lines (97 loc) · 1.95 KB
/
constants.go
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package memcache
//
// Magic Byte
//
const (
reqMagicByte uint8 = 0x80
respMagicByte uint8 = 0x81
)
//
// Response Status
//
type ResponseStatus uint16
const (
StatusNoError ResponseStatus = iota
StatusKeyNotFound
StatusKeyExists
StatusValueTooLarge
StatusInvalidArguments
StatusItemNotStored
StatusIncrDecrOnNonNumericValue
StatusVbucketBelongsToAnotherServer // Not used
StatusAuthenticationError // Not used
StatusAuthenticationContinue // Not used
)
const (
StatusUnknownCommand ResponseStatus = 0x81 + iota
StatusOutOfMemory
StatusNotSupported
StatusInternalError
StatusBusy
StatusTempFailure
)
//
// Command Opcodes
//
type opCode uint8
const (
opGet opCode = iota
opSet
opAdd
opReplace
opDelete
opIncrement
opDecrement
opQuit // Unsupported
opFlush
opGetQ // Unsupported
opNoOp // Unsupported
opVersion
opGetK
opGetKQ // Unsupported
opAppend
opPrepend
opStat
opSetQ // Unsupported
opAddQ // Unsupported
opReplaceQ // Unsupported
opDeleteQ // Unsupported
opIncrementQ // Unsupported
opDecrementQ // Unsupported
opQuitQ // Unsupported
opFlushQ // Unsupported
opAppendQ // Unsupported
opPrependQ // Unsupported
opVerbosity
opTouch // Unsupported
opGAT // Unsupported
opGATQ // Unsupported
)
// More unsupported opcodes:
// 0x20 SASL list mechs
// 0x21 SASL Auth
// 0x22 SASL Step
// 0x30 RGet
// 0x31 RSet
// 0x32 RSetQ
// 0x33 RAppend
// 0x34 RAppendQ
// 0x35 RPrepend
// 0x36 RPrependQ
// 0x37 RDelete
// 0x38 RDeleteQ
// 0x39 RIncr
// 0x3a RIncrQ
// 0x3b RDecr
// 0x3c RDecrQ
// 0x3d Set VBucket
// 0x3e Get VBucket
// 0x3f Del VBucket
// 0x40 TAP Connect
// 0x41 TAP Mutation
// 0x42 TAP Delete
// 0x43 TAP Flush
// 0x44 TAP Opaque
// 0x45 TAP VBucket Set
// 0x46 TAP Checkpoint Start
// 0x47 TAP Checkpoint End