Developing new storage backends
One advantage of the zarr data model is that it can be used in combiantion with a variety of storage backends. Currently in this package there is support for a DictStore (keeping data in memory), DirectoryStore (writing data to a local disk) and an S3Store for S3-compatible object store which is currently read-only. In oder to implement a new storage backend, you would have to create a subtype of Zarr.AbstractStore and implement the following methods:
Zarr.storagesize — Functionstoragesize(d::AbstractStore)
This function shall return the size of all data files in a store.
Zarr.zname — Functionzname(d::AbstractStore)Returns the name of the current variable.
Base.getindex — MethodBase.getindex(d::AbstractStore,i::String)Returns the data stored in the given key as a Vector{UInt8}
Base.setindex! — MethodBase.setindex!(d::AbstractStore,v,i::String)Writes the values in v to the given store and key.
Zarr.subdirs — Functionsubdirs(d::AbstractStore)Returns a list of keys for children stores in the given store.
Base.keys — MethodBase.keys(d::AbstractStore)Returns the keys of files in the given store.
Zarr.newsub — Functionnewsub(d::AbstractStore, name::String)Create a new Store as a child of the given store d with given name. Returns the new created substore.
Zarr.getsub — Functiongetsub(d::AbstractStore, name::String)Returns the child store of name name.
You can get some inspiration on how to implement this by looking at the source code of existing storage backends.