Chris Bannister 10 rokov pred
rodič
commit
bbe3d93b83
3 zmenil súbory, kde vykonal 26 pridanie a 26 odobranie
  1. 23 23
      frame.go
  2. 1 1
      frame_test.go
  3. 2 2
      session.go

+ 23 - 23
frame.go

@@ -55,21 +55,21 @@ type frameOp byte
 const (
 	// header ops
 	opError         frameOp = 0x00
-	opStartup               = 0x01
-	opReady                 = 0x02
-	opAuthenticate          = 0x03
-	opOptions               = 0x05
-	opSupported             = 0x06
-	opQuery                 = 0x07
-	opResult                = 0x08
-	opPrepare               = 0x09
-	opExecute               = 0x0A
-	opRegister              = 0x0B
-	opEvent                 = 0x0C
-	opBatch                 = 0x0D
-	opAuthChallenge         = 0x0E
-	opAuthResponse          = 0x0F
-	opAuthSuccess           = 0x10
+	opStartup       frameOp = 0x01
+	opReady         frameOp = 0x02
+	opAuthenticate  frameOp = 0x03
+	opOptions       frameOp = 0x05
+	opSupported     frameOp = 0x06
+	opQuery         frameOp = 0x07
+	opResult        frameOp = 0x08
+	opPrepare       frameOp = 0x09
+	opExecute       frameOp = 0x0A
+	opRegister      frameOp = 0x0B
+	opEvent         frameOp = 0x0C
+	opBatch         frameOp = 0x0D
+	opAuthChallenge frameOp = 0x0E
+	opAuthResponse  frameOp = 0x0F
+	opAuthSuccess   frameOp = 0x10
 )
 
 func (f frameOp) String() string {
@@ -121,17 +121,17 @@ const (
 
 	// rows flags
 	flagGlobalTableSpec int = 0x01
-	flagHasMorePages        = 0x02
-	flagNoMetaData          = 0x04
+	flagHasMorePages    int = 0x02
+	flagNoMetaData      int = 0x04
 
 	// query flags
 	flagValues                byte = 0x01
-	flagSkipMetaData               = 0x02
-	flagPageSize                   = 0x04
-	flagWithPagingState            = 0x08
-	flagWithSerialConsistency      = 0x10
-	flagDefaultTimestamp           = 0x20
-	flagWithNameValues             = 0x40
+	flagSkipMetaData          byte = 0x02
+	flagPageSize              byte = 0x04
+	flagWithPagingState       byte = 0x08
+	flagWithSerialConsistency byte = 0x10
+	flagDefaultTimestamp      byte = 0x20
+	flagWithNameValues        byte = 0x40
 
 	// header flags
 	flagCompress      byte = 0x01

+ 1 - 1
frame_test.go

@@ -73,7 +73,7 @@ func TestFrameReadTooLong(t *testing.T) {
 	r := &bytes.Buffer{}
 	r.Write(make([]byte, maxFrameSize+1))
 	// write a new header right after this frame to verify that we can read it
-	r.Write([]byte{0x02, 0x00, 0x00, opReady, 0x00, 0x00, 0x00, 0x00})
+	r.Write([]byte{0x02, 0x00, 0x00, byte(opReady), 0x00, 0x00, 0x00, 0x00})
 
 	framer := newFramer(r, nil, nil, 2)
 

+ 2 - 2
session.go

@@ -917,8 +917,8 @@ type BatchType byte
 
 const (
 	LoggedBatch   BatchType = 0
-	UnloggedBatch           = 1
-	CounterBatch            = 2
+	UnloggedBatch BatchType = 1
+	CounterBatch  BatchType = 2
 )
 
 type BatchEntry struct {