
storage.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.
storage_file(?File) is nondet
storage_file_extension(?File, ?Extension) is nondet
storage_file_extension_head(?File, ?Extension, -Head) is nondet
storage_file(+File, -Data, -Meta) is semidet
storage_meta_data(+File, -Meta) is semidet- True if File is known in the store.
- Arguments:
-
Data | - is a string holding the content of the file |
Meta | - is a dict holding the meta data about the file. |
storage_commit(+Hash, -Meta) is semidet- Load the commit data for Hash. This version does not tell us
whether Hash is the
HEAD
or not.
storage_meta_property(+Meta, -Property)- True when Meta has Property. Defined properties are:
- peer(Atom)
- Peer address that last saved the file
-
storage_store_term(+Term, -Hash) is det
storage_load_term(+Hash, -Term) is det- Add/retrieve terms from the gitty store. This is used to create
permanent links to arbitrary objects.
use_gitty_file(+File) is det
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.
storage_fsck- Enumerate and check the consistency of the entire store.
storage_repack is det
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.
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.
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.