-
Notifications
You must be signed in to change notification settings - Fork 4
/
draft_api.go
70 lines (52 loc) · 1.74 KB
/
draft_api.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
package dropbag
import (
"github.com/insolar/assured-ledger/ledger-core/drafts/dropbag/dbcommon"
)
type DropStorageBuilder interface {
}
type DropLifeline interface {
// consists of 1xDropOpening, 1xDropClosing, 1+ DropRevisions
// DropRevision keeps info on rearrangements
// TODO appending summary info updates - needs something simple and cheap
}
// ==================
type EntryStorageCabinet interface {
// Has ControlSection that keeps DropLifelines etc
// Jet trees
// Node lists
}
type EntryStorageShelf interface {
// one per section type per EntryStorageCabinet
// Consists of EntryCollections:
// - directory (keys + brief info) partitioned by drops // can have one storage file per partition when is written, can be combined later
// - alt_directory (keys + brief info but by using an alternative cryptography scheme)
// - content (record data) // one per shelf, accessed by index+ofs+len
// hides differences for read-only collections and collections being written
}
type EntryCollection interface {
// index-based access
// hides differences:
// - lazy and non-lazy read implementation of an indexed set
// - set being built
}
type EntryStorageAdapter interface {
// provides support lazy / packed / open-read-close access to physical storage
}
// ================== file specific implementation
type StorageFileFolder interface {
}
type StorageFile interface {
}
type StorageFileReader interface {
}
type StorageFormatAdapter interface {
// checks individual entry CRC
// checks file on reopening
// facilitates read of lazy entries -> need to know format
}
type StorageURI string
type StorageReadAdapter interface {
GetURI() StorageURI
OpenForSeqRead() dbcommon.StorageSeqReader
OpenForBlockRead() dbcommon.StorageBlockReader
}