mod_admin_telnet: Identify native bidi sessions
[prosody.git] / doc / storage.tld
blob057649a401e939a8946b95e5be73f5df1ef2f966
1 -- Storage Interface API Description
2 --
3 -- This is written as a TypedLua description
5 -- Key-Value stores (the default)
7 interface keyval_store
8 get : ( self, string? ) -> (any) | (nil, string)
9 set : ( self, string?, any ) -> (boolean) | (nil, string)
10 end
12 -- Map stores (key-key-value stores)
14 interface map_store
15 get : ( self, string?, any ) -> (any) | (nil, string)
16 set : ( self, string?, any, any ) -> (boolean) | (nil, string)
17 set_keys : ( self, string?, { any : any }) -> (boolean) | (nil, string)
18 remove : {}
19 end
21 -- Archive stores
23 typealias archive_query = {
24 "start" : number?, -- timestamp
25 "end" : number?, -- timestamp
26 "with" : string?,
27 "after" : string?, -- archive id
28 "before" : string?, -- archive id
29 "total" : boolean?,
32 interface archive_store
33 -- Optional set of capabilities
34 caps : {
35 -- Optional total count of matching items returned as second return value from :find()
36 "total" : boolean?,
39 -- Add to the archive
40 append : ( self, string?, string?, any, number?, string? ) -> (string) | (nil, string)
42 -- Iterate over archive
43 find : ( self, string?, archive_query? ) -> ( () -> ( string, any, number?, string? ), integer? )
45 -- Removal of items. API like find. Optional?
46 delete : ( self, string?, archive_query? ) -> (boolean) | (number) | (nil, string)
48 -- Array of dates which do have messages (Optional?)
49 dates : ( self, string? ) -> ({ string }) | (nil, string)
51 -- Map of counts per "with" field
52 summary : ( self, string?, archive_query? ) -> ( { string : integer } ) | (nil, string)
53 end
55 -- This represents moduleapi
56 interface module
57 -- If the first string is omitted then the name of the module is used
58 -- The second string is one of "keyval" (default), "map" or "archive"
59 open_store : (self, string?, string?) -> (keyval_store) | (map_store) | (archive_store) | (nil, string)
61 -- Other module methods omitted
62 end
64 module : module