PublicShow sourcestorage.pl -- Store files on behalve of web clients

The file store needs to deal with versioning and meta-data. This is achieved using gitty.pl, a git-like content-base store that lacks git's notion of a tree. I.e., all files are considered individual and have their own version.

Source storage_file(?File) is nondet
! storage_file_extension(?File, ?Extension) is nondet. % storage_file(+File, -Data, -Meta) is semidet. % storage_meta_data(+File, -Meta) is semidet.
True if File is known in the store.

@arg Data is a string holding the content of the file
@arg Meta is a dict holding the meta data about the file.
Source storage_meta_property(+Meta, -Property)
True when Meta has Property. Defined properties are:
peer(Atom)
Peer address that last saved the file -
Source storage_store_term(+Term, -Hash) is det
Source storage_load_term(+Hash, -Term) is det
Add/retrieve terms from the gitty store. This is used to create permanent links to arbitrary objects.
Source use_gitty_file(+File) is det
Source use_gitty_file(+File, +Options) is det
Load a file from the Gitty store. Options are passed to load_files/2. Additional options are:
watch(+Boolean)
If true (default), reload the file if the user saves it.
Source storage_fsck
Enumerate and check the consistency of the entire store.
Source storage_repack is det
Source storage_repack(+Options) is det
Repack the storage directory. Currently only supports the files driver. For database drivers this is supposed to be handled by the database.
Source storage_unpack
Unpack all packed objects of the store. Currently only supports the files driver. For database drivers this is supposed to be handled by the database.
Source swish_search:typeahead(+Set, +Query, -Match, +Options) is nondet[multifile]
Find files using typeahead from the SWISH search box. This version defines the following sets:
  • file: Search the store for matching file names, matching tag or title.
  • store_content: Search the content of the store for matching lines.
To be done
- caching?
- We should only demand public on public servers.

Re-exported predicates

The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.

Source storage_store_term(+Term, -Hash) is det
Source storage_load_term(+Hash, -Term) is det
Add/retrieve terms from the gitty store. This is used to create permanent links to arbitrary objects.
Source use_gitty_file(+File) is det
Source use_gitty_file(+File, +Options) is det
Load a file from the Gitty store. Options are passed to load_files/2. Additional options are:
watch(+Boolean)
If true (default), reload the file if the user saves it.
Source storage_repack is det
Source storage_repack(+Options) is det
Repack the storage directory. Currently only supports the files driver. For database drivers this is supposed to be handled by the database.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Source storage_meta_data(Arg1, Arg2)
Source storage_file_extension(Arg1, Arg2)
Source storage_file(Arg1, Arg2, Arg3)