-
Notifications
You must be signed in to change notification settings - Fork 4
/
api_drop.go
67 lines (53 loc) · 1.44 KB
/
api_drop.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
package dropbag
import (
"github.com/insolar/assured-ledger/ledger-core/network/consensus/gcpv2/api/census"
"github.com/insolar/assured-ledger/ledger-core/pulse"
"github.com/insolar/assured-ledger/ledger-core/vanilla/longbits"
)
type JetPulse interface {
GetOnlinePopulation() census.OnlinePopulation
GetPulseData() pulse.Range
}
type JetSectionId uint16
const (
DefaultSection JetSectionId = iota // MapSection
ControlSection // drop/dropbag lifecycle
DustSection // transient, general, stays for some time (e.g. log)
GasSection // transient, requests, stays until processed
)
type JetDrop interface {
PulseNumber() pulse.Number
GetGlobulaPulse() JetPulse
FindEntryByKey(longbits.ByteString) JetDropEntry
// GetSectionDirectory(JetSectionId) JetDropSection
GetSection(JetSectionId) JetDropSection
}
type JetSectionType uint8
const (
DirectorySection JetSectionType = 1 << iota //
TransientSection
CustomCryptographySection
//HeavyPayload
)
type JetSectionDeclaration interface {
HasDirectory() bool
//IsSorted
HasPayload() bool
}
type JetSectionDirectory interface {
FindByKey(longbits.ByteString) JetDropEntry
EnumKeys()
}
type JetDropSection interface {
EnumEntries()
}
type JetDropEntry interface {
Key() longbits.ByteString
Section() JetDropSection
IsAvailable() bool
Data() []byte
// ProjectionCache()
}
type KeySet interface {
// inclusive or exclusive
}