-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage.go
50 lines (41 loc) · 1.29 KB
/
storage.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
// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package storage
import "github.com/juju/names/v4"
// StorageKind defines the type of the datastore: whether it
// is a raw block device, or a filesystem.
type StorageKind int
const (
StorageKindUnknown StorageKind = iota
StorageKindBlock
StorageKindFilesystem
)
func (k StorageKind) String() string {
switch k {
case StorageKindBlock:
return "block"
case StorageKindFilesystem:
return "filesystem"
default:
return "unknown"
}
}
// StorageInstance describes a storage instance, assigned to an application or
// unit.
type StorageInstance struct {
// Tag is a unique tag assigned by Juju to the storage instance.
Tag names.StorageTag
// Kind is the kind of the datastore (block device, filesystem).
Kind StorageKind
}
// StorageAttachmentInfo provides unit-specific information about a storage
// instance. StorageAttachmentInfo is based on either a volume attachment
// or a filesystem attachment, depending on its kind.
type StorageAttachmentInfo struct {
// Kind is the kind of the storage attachment.
Kind StorageKind
// Location is the storage attachment's location: the mount point
// for a filesystem-kind storage attachment, and the device path
// for a block-kind.
Location string
}