-
Notifications
You must be signed in to change notification settings - Fork 2
/
disk.go
45 lines (32 loc) · 954 Bytes
/
disk.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
package unused
import "time"
// Disk represents an unused disk on a given cloud provider.
type Disk interface {
// ID should return a unique ID for a disk within each cloud
// provider.
ID() string
// Provider returns a reference to the provider used to instantiate
// this disk
Provider() Provider
// Name returns the disk name.
Name() string
// SizeGB returns the disk size in GB (Azure/GCP) and GiB for AWS.
SizeGB() int
// SizeBytes returns the disk size in bytes.
SizeBytes() float64
// CreatedAt returns the time when the disk was created.
CreatedAt() time.Time
// LastUsedAt returns the date when the disk was last used.
LastUsedAt() time.Time
// Meta returns the disk metadata.
Meta() Meta
// DiskType returns the normalized type of disk.
DiskType() DiskType
}
type DiskType string
const (
SSD DiskType = "ssd"
HDD DiskType = "hdd"
Unknown DiskType = "unknown"
)
const GiBbytes = 1_073_741_824 // 2^30