-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathindex.go
More file actions
138 lines (108 loc) · 2.9 KB
/
Copy pathindex.go
File metadata and controls
138 lines (108 loc) · 2.9 KB
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
package storiface
import (
"strings"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
)
// ID identifies sector storage by UUID. One sector storage should map to one
//
// filesystem, local or networked / shared by multiple machines
type ID string
const IDSep = "."
type IDList []ID
func (il IDList) String() string {
l := make([]string, len(il))
for i, id := range il {
l[i] = string(id)
}
return strings.Join(l, IDSep)
}
func ParseIDList(s string) IDList {
strs := strings.Split(s, IDSep)
out := make([]ID, len(strs))
for i, str := range strs {
out[i] = ID(str)
}
return out
}
type Group = string
type StorageInfo struct {
// ID is the UUID of the storage path
ID ID
// URLs for remote access
URLs []string // TODO: Support non-http transports
// Storage path weight; higher number means that the path will be preferred more often
Weight uint64
// MaxStorage is the number of bytes allowed to be used by files in the
// storage path
MaxStorage uint64
// CanStore is true when the path is allowed to be used for io-intensive
// sealing operations
CanSeal bool
// CanStore is true when the path is allowed to be used for long-term storage
CanStore bool
// Groups is the list of path groups this path belongs to
Groups []Group
// AllowTo is the list of paths to which data from this path can be moved to
AllowTo []Group
// AllowTypes lists sector file types which are allowed to be put into this
// path. If empty, all file types are allowed.
//
// Valid values:
// - "unsealed"
// - "sealed"
// - "cache"
// - "update"
// - "update-cache"
// - "piece" (parked pieces: PDP payloads and market piece parking)
// - "key" (unseal keys)
// Any other value will generate a warning and be ignored.
AllowTypes []string
// DenyTypes lists sector file types which aren't allowed to be put into this
// path.
//
// Valid values:
// - "unsealed"
// - "sealed"
// - "cache"
// - "update"
// - "update-cache"
// - "piece" (parked pieces: PDP payloads and market piece parking)
// - "key" (unseal keys)
// Any other value will generate a warning and be ignored.
DenyTypes []string
// AllowMiners lists miner IDs which are allowed to store their sector data into
// this path. If empty, all miner IDs are allowed
AllowMiners []string
// DenyMiners lists miner IDs which are denied to store their sector data into
// this path
DenyMiners []string
}
type HealthReport struct {
Stat fsutil.FsStat
Err string
}
type SectorStorageInfo struct {
ID ID
URLs []string // TODO: Support non-http transports
BaseURLs []string
Weight uint64
CanSeal bool
CanStore bool
Primary bool
AllowTypes []string
DenyTypes []string
AllowMiners []string
DenyMiners []string
}
type Decl struct {
abi.SectorID
SectorFileType
}
type StoragePath struct {
ID ID
Weight uint64
LocalPath string
CanSeal bool
CanStore bool
}