@@ -14,14 +14,19 @@ getTimestamp(entry::AbstractDataEntry) = entry.timestamp
14
14
# #==============================================================================
15
15
# # BlobStoreEntry
16
16
# #==============================================================================
17
- export BlobStoreEntry
17
+ export BlobEntry
18
18
19
19
"""
20
20
$(TYPEDEF)
21
21
General Data Store Entry.
22
22
"""
23
- @Base . kwdef struct BlobStoreEntry <: AbstractDataEntry
24
- id:: Union{UUID, Nothing} = nothing
23
+ @Base . kwdef struct BlobEntry <: AbstractDataEntry
24
+ """ This is created by server-side GraphQL """
25
+ id:: Union{UUID, Nothing} = nothing
26
+ """ This is the forced server generated blobId, or the filesystem blobId. """
27
+ blobId:: Union{UUID, Nothing} = nothing
28
+ """ This is the ID at creation at the edge, do whatever you want with this, but make sure you populate it. """
29
+ originId:: UUID
25
30
label:: Symbol
26
31
blobstore:: Symbol
27
32
hash:: String # Probably https://docs.julialang.org/en/v1/stdlib/SHA
@@ -30,99 +35,77 @@ General Data Store Entry.
30
35
mimeType:: String
31
36
metadata:: String = " "
32
37
timestamp:: ZonedDateTime = now (localzone ())
33
- _type:: String = " BlobStoreEntry "
38
+ _type:: String = " BlobEntry "
34
39
_version:: String = string (_getDFGVersion ()) # TBD consider upgrading to ::VersionNumber
35
40
end
36
41
42
+ # should be deprecated by v0.21
43
+ export BlobStoreEntry
44
+ const BlobStoreEntry = BlobEntry
45
+
37
46
_fixtimezone (cts:: NamedTuple ) = ZonedDateTime (cts. utc_datetime* " +00" )
38
47
39
- # # needed for deserialization from JSON during DFG v0.19 transition, see #867
40
- # # TODO this function can likely be removed, since julia automatically tries type conversion on constructors.
41
- # function BlobStoreEntry(;
42
- # id,
43
- # label,
44
- # blobstore,
45
- # hash,
46
- # origin,
47
- # description,
48
- # mimeType,
49
- # timestamp,
50
- # kwargs... # drop excessive fields
51
- # )
52
- # #
53
- # BlobStoreEntry(;
54
- # id=UUID(id),
55
- # label=Symbol(label),
56
- # blobstore=Symbol(blobstore),
57
- # hash,
58
- # origin,
59
- # description,
60
- # mimeType,
61
- # timestamp=_fixtimezone(timestamp),
62
- # )
48
+ # # TODO
49
+ # """
50
+ # $(TYPEDEF)
51
+ # Data Entry in MongoDB.
52
+ # """
53
+ # struct MongodbDataEntry <: AbstractDataEntry
54
+ # label::Symbol
55
+ # id::UUID
56
+ # oid::NTuple{12, UInt8} #mongodb object id - TODO Not needed with id::UUID unique, but perhaps usefull
57
+ # hash::String
58
+ # createdTimestamp::ZonedDateTime
59
+ # # mongodb
60
+ # # mongoConfig::MongoConfig
61
+ # #maybe other fields such as:
62
+ # #flags::Bool ready, valid, locked, permissions
63
+ # #MIMEType::String
63
64
# end
64
65
65
- # TODO
66
- """
67
- $(TYPEDEF)
68
- Data Entry in MongoDB.
69
- """
70
- struct MongodbDataEntry <: AbstractDataEntry
71
- label:: Symbol
72
- id:: UUID
73
- oid:: NTuple{12, UInt8} # mongodb object id - TODO Not needed with id::UUID unique, but perhaps usefull
74
- hash:: String
75
- createdTimestamp:: ZonedDateTime
76
- # mongodb
77
- # mongoConfig::MongoConfig
78
- # maybe other fields such as:
79
- # flags::Bool ready, valid, locked, permissions
80
- # MIMEType::String
81
- end
82
66
67
+ # ##==============================================================================
68
+ # ## FileDataEntryBlob Types
69
+ # ##==============================================================================
70
+ # export FileDataEntry
71
+ # """
72
+ # $(TYPEDEF)
73
+ # Data Entry in a file.
74
+ # """
75
+ # struct FileDataEntry <: AbstractDataEntry
76
+ # label::Symbol
77
+ # id::UUID
78
+ # folder::String
79
+ # hash::String #using bytes2hex or perhaps Vector{Uint8}?
80
+ # createdTimestamp::ZonedDateTime
83
81
84
- # #==============================================================================
85
- # # FileDataEntryBlob Types
86
- # #==============================================================================
87
- export FileDataEntry
88
- """
89
- $(TYPEDEF)
90
- Data Entry in a file.
91
- """
92
- struct FileDataEntry <: AbstractDataEntry
93
- label:: Symbol
94
- id:: UUID
95
- folder:: String
96
- hash:: String # using bytes2hex or perhaps Vector{Uint8}?
97
- createdTimestamp:: ZonedDateTime
98
-
99
- function FileDataEntry (label, id, folder, hash, timestamp)
100
- if ! isdir (folder)
101
- @info " Folder '$folder ' doesn't exist - creating."
102
- # create new folder
103
- mkpath (folder)
104
- end
105
- return new (label, id, folder, hash, timestamp)
106
- end
107
- end
82
+ # function FileDataEntry(label, id, folder, hash, timestamp)
83
+ # if !isdir(folder)
84
+ # @info "Folder '$folder' doesn't exist - creating."
85
+ # # create new folder
86
+ # mkpath(folder)
87
+ # end
88
+ # return new(label, id, folder, hash, timestamp)
89
+ # end
90
+ # end
108
91
109
92
110
- # #==============================================================================
111
- # # InMemoryDataEntry Types
112
- # #==============================================================================
113
- export InMemoryDataEntry
114
- """
115
- $(TYPEDEF)
116
- Store data temporary in memory.
117
- NOTE: Neither Entry nor Blob will be persisted.
118
- """
119
- struct InMemoryDataEntry{T} <: AbstractDataEntry
120
- label:: Symbol
121
- id:: UUID
122
- # hash::String #Is this needed?
123
- createdTimestamp:: ZonedDateTime
124
- data:: T
125
- end
93
+ # # #==============================================================================
94
+ # # # InMemoryDataEntry Types
95
+ # # #==============================================================================
96
+ # export InMemoryDataEntry
97
+ # """
98
+ # $(TYPEDEF)
99
+ # Store data temporary in memory.
100
+ # NOTE: Neither Entry nor Blob will be persisted.
101
+ # """
102
+ # struct InMemoryDataEntry{T} <: AbstractDataEntry
103
+ # label::Symbol
104
+ # id::UUID
105
+ # #hash::String #Is this needed?
106
+ # createdTimestamp::ZonedDateTime
107
+ # data::T
108
+ # end
126
109
127
110
# getHash(::InMemoryDataEntry) = UInt8[]
128
111
assertHash (de:: InMemoryDataEntry , db; hashfunction = sha256) = true
0 commit comments