-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
162 lines (142 loc) · 3.4 KB
/
types.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
package main
import (
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
s3types "github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/hanwen/go-fuse/v2/fs"
"time"
)
// one for each type with only its info populated
type ec2Subdir struct {
fs.Inode
Name string
instances instanceinfo
volumes volumeinfo
vpcs vpcinfo
snapshots snapshotinfo
loadTime time.Time
}
type volumeinfo struct {
Volumes map[string]ec2types.Volume
Ctime time.Time
Mtime time.Time
populated bool
}
type vpcinfo struct {
Vpcs map[string]ec2types.Vpc
Ctime time.Time
Mtime time.Time
populated bool
}
type snapshotinfo struct {
Snapshots map[string]ec2types.Snapshot
Ctime time.Time
Mtime time.Time
populated bool
}
type FileHandle struct {
}
type AwsRoot struct {
fs.Inode
}
type rootSubdir struct {
fs.Inode
Name string
s3 s3info
ec2 ec2info
loadTime time.Time
}
type bucketDir struct {
fs.Inode
Name string
Bucket s3types.Bucket
objects map[string]s3types.Object
subprefixes map[string]bool
populated bool
loadTime time.Time
}
type instanceDir struct {
fs.Inode
Name string
Instance ec2types.Instance
populated bool
loadTime time.Time
}
type volumeDir struct {
fs.Inode
Name string
Volume ec2types.Volume
populated bool
loadTime time.Time
}
type s3object struct {
fs.Inode
Name string
Bucket s3types.Bucket
Object s3types.Object
loadTime time.Time
}
type s3info struct {
Buckets map[string]s3types.Bucket
Ctime time.Time
Mtime time.Time
}
type ec2info struct {
instances ec2Subdir
volumes ec2Subdir
vpcs ec2Subdir
snapshots ec2Subdir
Ctime time.Time
Mtime time.Time
}
type instanceinfo struct {
Instances map[string]ec2types.Instance
Ctime time.Time
Mtime time.Time
populated bool
}
type Ec2AttributeNode struct {
Ec2InstanceSubnode
Value string
}
type Ec2VolumesNode struct {
Ec2InstanceSubnode
populated bool
}
type ec2TagsDir struct {
fs.Inode
tags []ec2types.Tag
populated bool
loadTime time.Time
}
type Ec2InstanceSubnode struct {
fs.Inode
Instance ec2types.Instance
}
// Ensure we implement interfaces
var _ = (fs.NodeLookuper)((*rootSubdir)(nil))
var _ = (fs.NodeReaddirer)((*ec2TagsDir)(nil))
var _ = (fs.NodeGetattrer)((*ec2TagsDir)(nil))
var _ = (fs.NodeLookuper)((*ec2TagsDir)(nil))
var _ = (fs.NodeReaddirer)((*rootSubdir)(nil))
var _ = (fs.NodeLookuper)((*instanceDir)(nil))
var _ = (fs.NodeReaddirer)((*instanceDir)(nil))
var _ = (fs.NodeLookuper)((*volumeDir)(nil))
var _ = (fs.NodeReaddirer)((*volumeDir)(nil))
var _ = (fs.NodeLookuper)((*Ec2VolumesNode)(nil))
var _ = (fs.NodeReaddirer)((*Ec2VolumesNode)(nil))
var _ = (fs.NodeLookuper)((*bucketDir)(nil))
var _ = (fs.NodeReaddirer)((*bucketDir)(nil))
var _ = (fs.NodeGetattrer)((*rootSubdir)(nil))
var _ = (fs.NodeGetattrer)((*s3object)(nil))
var _ = (fs.NodeGetattrer)((*Ec2AttributeNode)(nil))
var _ = (fs.NodeOpener)((*Ec2AttributeNode)(nil))
var _ = (fs.NodeReader)((*Ec2AttributeNode)(nil))
var _ = (fs.NodeOpener)((*s3object)(nil))
var _ = (fs.NodeReader)((*s3object)(nil))
var _ = (fs.NodeGetattrer)((*bucketDir)(nil))
var _ = (fs.NodeGetattrer)((*instanceDir)(nil))
var _ = (fs.NodeGetattrer)((*volumeDir)(nil))
var _ = (fs.NodeGetattrer)((*AwsRoot)(nil))
var _ = (fs.NodeGetattrer)((*rootSubdir)(nil))
var _ = (fs.NodeOnAdder)((*AwsRoot)(nil))
var _ = (fs.NodeOnAdder)((*rootSubdir)(nil))