forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tablet_type_bson.go
35 lines (29 loc) · 874 Bytes
/
tablet_type_bson.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
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package topo
import (
"bytes"
"github.com/youtube/vitess/go/bson"
"github.com/youtube/vitess/go/bytes2"
)
// DO NOT EDIT.
// FILE GENERATED BY BSONGEN.
// MarshalBson bson-encodes TabletType.
func (tabletType TabletType) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
if key == "" {
lenWriter := bson.NewLenWriter(buf)
defer lenWriter.Close()
key = bson.MAGICTAG
}
bson.EncodeString(buf, key, string(tabletType))
}
// UnmarshalBson bson-decodes into TabletType.
func (tabletType *TabletType) UnmarshalBson(buf *bytes.Buffer, kind byte) {
if kind == bson.EOO {
bson.Next(buf, 4)
kind = bson.NextByte(buf)
bson.ReadCString(buf)
}
*tabletType = TabletType(bson.DecodeString(buf, kind))
}