forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Metadata.go
165 lines (141 loc) · 3.81 KB
/
Metadata.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// automatically generated by the FlatBuffers compiler, do not modify
package schema
import (
flatbuffers "github.com/google/flatbuffers/go"
)
type Metadata struct {
_tab flatbuffers.Table
}
func GetRootAsMetadata(buf []byte, offset flatbuffers.UOffsetT) *Metadata {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &Metadata{}
x.Init(buf, n+offset)
return x
}
func (rcv *Metadata) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *Metadata) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *Metadata) Inode() uint64 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
return rcv._tab.GetUint64(o + rcv._tab.Pos)
}
return 0
}
func (rcv *Metadata) MutateInode(n uint64) bool {
return rcv._tab.MutateUint64Slot(4, n)
}
func (rcv *Metadata) Uid() uint32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
return rcv._tab.GetUint32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *Metadata) MutateUid(n uint32) bool {
return rcv._tab.MutateUint32Slot(6, n)
}
func (rcv *Metadata) Gid() uint32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
if o != 0 {
return rcv._tab.GetUint32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *Metadata) MutateGid(n uint32) bool {
return rcv._tab.MutateUint32Slot(8, n)
}
func (rcv *Metadata) Sid() []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
if o != 0 {
return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
return nil
}
func (rcv *Metadata) Mode() uint32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
if o != 0 {
return rcv._tab.GetUint32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *Metadata) MutateMode(n uint32) bool {
return rcv._tab.MutateUint32Slot(12, n)
}
func (rcv *Metadata) Size() uint64 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
if o != 0 {
return rcv._tab.GetUint64(o + rcv._tab.Pos)
}
return 0
}
func (rcv *Metadata) MutateSize(n uint64) bool {
return rcv._tab.MutateUint64Slot(14, n)
}
func (rcv *Metadata) MtimeNs() int64 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
if o != 0 {
return rcv._tab.GetInt64(o + rcv._tab.Pos)
}
return 0
}
func (rcv *Metadata) MutateMtimeNs(n int64) bool {
return rcv._tab.MutateInt64Slot(16, n)
}
func (rcv *Metadata) CtimeNs() int64 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(18))
if o != 0 {
return rcv._tab.GetInt64(o + rcv._tab.Pos)
}
return 0
}
func (rcv *Metadata) MutateCtimeNs(n int64) bool {
return rcv._tab.MutateInt64Slot(18, n)
}
func (rcv *Metadata) Type() byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(20))
if o != 0 {
return rcv._tab.GetByte(o + rcv._tab.Pos)
}
return 1
}
func (rcv *Metadata) MutateType(n byte) bool {
return rcv._tab.MutateByteSlot(20, n)
}
func MetadataStart(builder *flatbuffers.Builder) {
builder.StartObject(9)
}
func MetadataAddInode(builder *flatbuffers.Builder, inode uint64) {
builder.PrependUint64Slot(0, inode, 0)
}
func MetadataAddUid(builder *flatbuffers.Builder, uid uint32) {
builder.PrependUint32Slot(1, uid, 0)
}
func MetadataAddGid(builder *flatbuffers.Builder, gid uint32) {
builder.PrependUint32Slot(2, gid, 0)
}
func MetadataAddSid(builder *flatbuffers.Builder, sid flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(sid), 0)
}
func MetadataAddMode(builder *flatbuffers.Builder, mode uint32) {
builder.PrependUint32Slot(4, mode, 0)
}
func MetadataAddSize(builder *flatbuffers.Builder, size uint64) {
builder.PrependUint64Slot(5, size, 0)
}
func MetadataAddMtimeNs(builder *flatbuffers.Builder, mtimeNs int64) {
builder.PrependInt64Slot(6, mtimeNs, 0)
}
func MetadataAddCtimeNs(builder *flatbuffers.Builder, ctimeNs int64) {
builder.PrependInt64Slot(7, ctimeNs, 0)
}
func MetadataAddType(builder *flatbuffers.Builder, type_ byte) {
builder.PrependByteSlot(8, type_, 1)
}
func MetadataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()
}