
storage.pl -- Store files on behalve of web clientsThe 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.
web_storage(+Request) is det[private]GET, POST, PUT and DELETE.
update_error(+Error, +Storage, +Data, +File, +URL)[private]409
Conflict page
follow(+Commit, +SaveDict) is det[private]follow(DocID, ProfileID, [update,chat]) if the user
wishes to follow the file associated with Commit.
request_file(+Request, +GittyDir, -File) is det[private]
meta_data(+Dict, -Meta, +Options) is det[private]
meta_data(+Store, +Dict, -PrevMeta, -Meta, +Options) is det[private]The meta_data/5 version is used to add information about a fork.
storage_get(+Request, +Format, +Options) is det[private]
gitty_data_or_default(+Dir, +Type, +FileOrHash, -Code, -Meta)[private]gitty/File in the config directory.
chat_count(+Meta, -ChatCount) is det[private]
random_filename(-Name) is det[private]
swish_show(+Options, +Request)[private]
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
storage_commit(+Hash, -Meta) is semidetHEAD or not.
storage_meta_property(+Meta, -Property)
storage_store_term(+Term, -Hash) is det
storage_load_term(+Hash, -Term) is det
use_gitty_file(+File) is det
use_gitty_file(+File, +Options) is dettrue (default), reload the file if the user saves it.
collect_messages_as_json(+Goal, -Messages)[private]
storage_fsck
storage_repack is det
storage_repack(+Options) is detfiles driver. For database drivers this is supposed to be
handled by the database.
storage_unpackfiles driver. For database drivers this is supposed to be
handled by the database.
swish_search:typeahead(+Set, +Query, -Match, +Options) is nondet[multifile]
source_list(+Request)[private]pl, swinb or lnkme must be
owned by current usertime (default), name, author or type
Reply is a JSON object containing count (total matches),
cpu (CPU time) and matches (list of matching sources)
search_sources(+Query, -Results) is det[private]word(Word),
regex(String, Flags) or string(String) (quoted search). The
Value is either a string or regex(String, Flags).desc (@>=) or asc (@=<))Result is a dict holding
This predicate can be hooked using search_sources_hook/2 that uses the same signature. If the hook fails, naive search is performed. The naive algorithm is fine for local installations with a couple of hundreds of files. Public installations need to hook this predicate using a proper full text database.
visible(+FileMeta, +Auth, +MetaConstraints) is semidet[private]
owns(+Auth, +Meta, ?How) is semidet[private]
matches_meta(+Source, +Auth, +Query) is semidet[private]
type_constraint(+Query0, -Query, -Type) is det[private]
parse_query(+String, -Query) is det[private]tag, user, type, string or regex. Value is one of a
string, string(String) (quoted), regex(String, Flags) or
word(String).
source_modified(+Request)[private]This is a poor men's solution to keep the client cache consistent. Need to think about a better way to cache searches client and/or server side.