Debian Codegraph @

cmd/influx-tools/internal/format/binary/common.go

raw symbols SCIP
1 package binary
2
3 //go:generate protoc -I$GOPATH/src/github.com/influxdata/influxdb/vendor -I. --gogofaster_out=Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types:. binary.proto
4 //go:generate stringer -type=MessageType
5
6 import "errors"
7
8 var (
9 ErrWriteAfterClose = errors.New("format/binary: write after close")
10 ErrWriteBucketAfterClose = errors.New("format/binary: write to closed bucket")
11 )
12
13 var (
14 Magic = [...]byte{0x49, 0x46, 0x4c, 0x58, 0x44, 0x55, 0x4d, 0x50} // IFLXDUMP
15 )
16
17 type MessageType byte
18
19 const (
20 HeaderType MessageType = iota + 1
21 BucketHeaderType
22 BucketFooterType
23 SeriesHeaderType
24 FloatPointsType
25 IntegerPointsType
26 UnsignedPointsType
27 BooleanPointsType
28 StringPointsType
29 SeriesFooterType
30 )
31
32 type message interface {
33 Size() int
34 MarshalTo(dAtA []byte) (int, error)
35 }
36
37 /*
38 Stream format
39
40 FILE:
41 ┌─────────────────┬────────────────────┬─────────────────┐
42 │ │ │ │
43 │ IFLXDUMP (8) │ Header │ BUCKET 0..n │
44 │ │ │ │
45 └─────────────────┴────────────────────┴─────────────────┘
46
47 BUCKET:
48 ┌─────────────────┬────────────────────┬─────────────────┐
49 │ │ │ │
50 │ Bucket Header │ SERIES DATA 0..n │ Bucket Footer │
51 │ │ │ │
52 └─────────────────┴────────────────────┴─────────────────┘
53
54 SERIES DATA:
55 ┌─────────────────┬────────────────────┬─────────────────┐
56 │ │ │ │
57 │ Series Header │ POINTS 0..n │ Series Footer │
58 │ │ │ │
59 └─────────────────┴────────────────────┴─────────────────┘
60 */