functor (Event : EVENT) ->
sig
module Events :
sig
type t
val from_protobuf : Protobuf.Decoder.t -> t
val to_protobuf : t -> Protobuf.Encoder.t -> unit
module Event :
sig
type t = Event.t
val from_protobuf : Protobuf.Decoder.t -> t
val to_protobuf : t -> Protobuf.Encoder.t -> unit
val compare : t -> t -> int
val pp : Format.formatter -> t -> unit
val show : t -> string
end
val pp : Format.formatter -> t -> unit
val show : t -> string
val is_empty : t -> bool
val join : t -> t -> t
val empty : t
val of_list : Event.t list -> t
val to_list : t -> Event.t list
val subsets : t -> t list
end
module Event : Model_intf.EVENT
module Cache :
sig
module Key :
sig
type t = Events.t
val from_protobuf : Protobuf_capable.D.t -> t
val to_protobuf : t -> Protobuf_capable.E.t -> unit
end
module Value :
sig
type t = Model_intf.Data.t
val from_protobuf : Protobuf_capable.D.t -> t
val to_protobuf : t -> Protobuf_capable.E.t -> unit
end
module Usermeta_value :
sig
type t = Cache.Default_usermeta.t
val from_protobuf : Protobuf_capable.D.t -> t
val to_protobuf : t -> Protobuf_capable.E.t -> unit
end
module Index_value :
sig
type t = Cache.Default_index.t
val from_protobuf : Protobuf_capable.D.t -> t
val to_protobuf : t -> Protobuf_capable.E.t -> unit
end
type conn = Conn.t
type t =
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).t = {
conn : conn;
bucket : string;
}
val get_conn : t -> conn
val get_bucket : t -> string
module Unsafe_Robj :
sig
module Link :
sig
type t =
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Unsafe_Robj.Link.t = {
bucket : string option;
key : string option;
tag : string option;
}
val bucket : t -> string option
val key : t -> string option
val tag : t -> string option
val from_protobuf : Protobuf_capable.D.t -> t
val to_protobuf : t -> Protobuf_capable.E.t -> unit
end
module Pair :
sig
type t =
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Unsafe_Robj.Pair.t = {
key : string;
value : string option;
}
val create : k:string -> v:string option -> t
val key : t -> string
val value : t -> string option
val set_key : string -> t -> t
val set_value : string option -> t -> t
val from_protobuf : Protobuf_capable.D.t -> t
val to_protobuf : t -> Protobuf_capable.E.t -> unit
end
module Usermeta :
sig
type t =
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Unsafe_Robj.Usermeta.t = {
key : string;
value : string option;
}
val create : k:string -> v:string option -> t
val key : t -> string
val value : t -> string option
val set_key : string -> t -> t
val set_value : string option -> t -> t
val from_protobuf : Protobuf_capable.D.t -> t
val to_protobuf : t -> Protobuf_capable.E.t -> unit
end
module Index :
sig
type t =
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Unsafe_Robj.Index.t = {
key : string;
value : string option;
}
val create : k:string -> v:string option -> t
val key : t -> string
val value : t -> string option
val set_key : string -> t -> t
val set_value : string option -> t -> t
val from_protobuf : Protobuf_capable.D.t -> t
val to_protobuf : t -> Protobuf_capable.E.t -> unit
end
module Content :
sig
type t =
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Unsafe_Robj.Content.t = {
value : string;
content_type : string option;
charset : string option;
content_encoding : string option;
vtag : string option;
links : Link.t list;
last_mod : Int32.t option;
last_mod_usec : Int32.t option;
usermeta : Usermeta.t list;
indices : Index.t list;
deleted : bool option;
}
val create : string -> t
val value : t -> string
val content_type : t -> string option
val charset : t -> string option
val content_encoding : t -> string option
val vtag : t -> string option
val links : t -> Link.t list
val last_mod : t -> Int32.t option
val last_mod_usec : t -> Int32.t option
val usermeta : t -> Usermeta.t list
val indices : t -> Index.t list
val deleted : t -> bool
val set_value : string -> t -> t
val set_content_type : string option -> t -> t
val set_charset : string option -> t -> t
val set_content_encoding : string option -> t -> t
val set_vtag : string option -> t -> t
val set_links : Link.t list -> t -> t
val set_last_mod : Int32.t option -> t -> t
val set_last_mod_usec : Int32.t option -> t -> t
val set_usermeta : Usermeta.t list -> t -> t
val set_indices : Index.t list -> t -> t
val from_protobuf : Protobuf_capable.D.t -> t
val to_protobuf : t -> Protobuf_capable.E.t -> unit
end
type 'a t =
'a
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Unsafe_Robj.t
val of_pb :
Content.t list ->
string option -> bool option -> [ `Maybe_siblings ] t
val create : Content.t -> [ `No_siblings ] t
val of_value : string -> [ `No_siblings ] t
val contents : 'a t -> Content.t list
val content : [ `No_siblings ] t -> Content.t
val vclock : 'a t -> string option
val unchanged : 'a t -> bool
val set_contents :
Content.t list -> 'a t -> [ `Maybe_siblings ] t
val set_content : Content.t -> 'a t -> [ `No_siblings ] t
val set_vclock : string option -> 'a t -> 'a t
end
module Robj :
sig
module Link :
sig
type t =
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Robj.Link.t = {
bucket : string option;
key : Key.t option;
tag : string option;
}
val bucket : t -> string option
val key : t -> Key.t option
val tag : t -> string option
val set_bucket : string option -> t -> t
val set_key : Key.t option -> t -> t
val set_tag : string option -> t -> t
val to_unsafe : t -> Unsafe_Robj.Link.t
val from_unsafe : Unsafe_Robj.Link.t -> t
end
module type Unsafe_Pair =
sig
type t = { key : string; value : string option; }
val value : t -> string option
val key : t -> string
end
module Pair :
functor (Unsafe : Unsafe_Pair) (V : Protobuf_capable.S) ->
sig
type t =
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Robj.Pair(Unsafe)(V).t = {
key : Key.t;
value : V.t option;
}
val create : k:Key.t -> v:V.t option -> t
val key : t -> Key.t
val value : t -> V.t option
val set_key : Key.t -> t -> t
val set_value : V.t option -> t -> t
val to_unsafe : t -> Unsafe.t
val from_unsafe : Unsafe.t -> t
end
module Usermeta :
sig
type t =
Pair(Unsafe_Robj.Usermeta)(Usermeta_value).t = {
key : Key.t;
value : Usermeta_value.t option;
}
val create : k:Key.t -> v:Usermeta_value.t option -> t
val key : t -> Key.t
val value : t -> Usermeta_value.t option
val set_key : Key.t -> t -> t
val set_value : Usermeta_value.t option -> t -> t
val to_unsafe : t -> Unsafe_Robj.Usermeta.t
val from_unsafe : Unsafe_Robj.Usermeta.t -> t
end
module Index :
sig
type t =
Pair(Unsafe_Robj.Index)(Index_value).t = {
key : Key.t;
value : Index_value.t option;
}
val create : k:Key.t -> v:Index_value.t option -> t
val key : t -> Key.t
val value : t -> Index_value.t option
val set_key : Key.t -> t -> t
val set_value : Index_value.t option -> t -> t
val to_unsafe : t -> Unsafe_Robj.Index.t
val from_unsafe : Unsafe_Robj.Index.t -> t
end
module Content :
sig
type t =
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Robj.Content.t = {
value : Value.t;
content_type : string option;
charset : string option;
content_encoding : string option;
vtag : string option;
links : Link.t list;
last_mod : Int32.t option;
last_mod_usec : Int32.t option;
usermeta : Usermeta.t list;
indices : Index.t list;
deleted : bool option;
}
val value : t -> Value.t
val content_type : t -> string option
val charset : t -> string option
val content_encoding : t -> string option
val vtag : t -> string option
val links : t -> Link.t list
val last_mod : t -> Int32.t option
val last_mod_usec : t -> Int32.t option
val usermeta : t -> Usermeta.t list
val indices : t -> Index.t list
val deleted : t -> bool
val create : Value.t -> t
val to_unsafe : t -> Unsafe_Robj.Content.t
val from_unsafe : Unsafe_Robj.Content.t -> t
val set_value : Value.t -> t -> t
val set_content_type : string option -> t -> t
val set_charset : string option -> t -> t
val set_content_encoding : string option -> t -> t
val set_vtag : string option -> t -> t
val set_links : Link.t list -> t -> t
val set_last_mod : Int32.t option -> t -> t
val set_last_mod_usec : Int32.t option -> t -> t
val set_usermeta : Usermeta.t list -> t -> t
val set_indices : Index.t list -> t -> t
end
type 'a t =
'a
Cache.Make_with_usermeta_index(Events)(Model_intf.Data)(Cache.Default_usermeta)(Cache.Default_index).Robj.t = {
contents : Content.t list;
vclock : string option;
unchanged : bool;
}
val create : Content.t -> 'a t
val of_value : Value.t -> 'a t
val create_siblings : Content.t list -> 'a t
val contents : 'a t -> Content.t list
val content : 'a t -> Content.t
val vclock : 'a t -> string option
val unchanged : 'a t -> bool
val set_contents : Content.t list -> 'a t -> 'b t
val set_content : Content.t -> 'a t -> 'b t
val set_vclock : string option -> 'a t -> 'b t
val to_unsafe : 'a t -> [ `No_siblings ] Unsafe_Robj.t
val from_unsafe : 'a Unsafe_Robj.t -> 'b t
end
val create : conn:conn -> bucket:string -> t
val list_keys_stream :
t ->
(Key.t list -> unit Cache.Deferred.t) ->
(unit,
[> `Bad_conn
| `Bad_payload
| `Incomplete_payload
| `Overflow
| `Protobuf_encoder_error
| `Unknown_type
| `Wrong_type ])
Cache.Deferred.Result.t
val with_cache :
host:string ->
port:int ->
bucket:string ->
(t -> ('a, [> Conn.error ] as 'e) Cache.Deferred.Result.t) ->
('a, 'e) Cache.Deferred.Result.t
val list_keys :
t ->
(Key.t list,
[> `Bad_conn
| `Bad_payload
| `Incomplete_payload
| `Overflow
| `Protobuf_encoder_error
| `Unknown_type
| `Wrong_type ])
Cache.Result.t Async_kernel.Deferred.t
val get :
t ->
?opts:Opts.Get.t list ->
Key.t ->
('a Robj.t, [> Opts.Get.error ]) Cache.Result.t Cache.Deferred.t
val put :
t ->
?opts:Opts.Put.t list ->
?k:Key.t ->
'a Robj.t ->
('b Robj.t * Key.t Cache.Option.t, [> Opts.Put.error ])
Cache.Result.t Cache.Deferred.t
val delete :
t ->
?opts:Opts.Delete.t list ->
Key.t ->
(unit, [> Opts.Delete.error ]) Cache.Result.t Cache.Deferred.t
val index_search :
t ->
?opts:Opts.Index_search.t list ->
index:Index_value.t ->
Opts.Index_search.Query.t ->
(Response.Index_search.t, [> Opts.Index_search.error ])
Cache.Result.t Cache.Deferred.t
val bucket_props :
t ->
(Response.Props.t,
[> `Bad_conn
| `Bad_payload
| `Incomplete_payload
| `Overflow
| `Protobuf_encoder_error
| `Unknown_type
| `Wrong_type ])
Cache.Deferred.Result.t
end
type update_rule = Prob_cache_common.Update_rules.Update_fn.t
type prior_count = Events.t -> int
type prior_exp = Events.t -> float
type t
val count :
Events.t -> t -> (int, [> Opts.Get.error ]) Async.Std.Deferred.Result.t
val observe :
?cnt:int ->
?exp:float ->
Events.t ->
t ->
(t,
[> `Bad_conn
| `Bad_payload
| `Incomplete_payload
| `Notfound
| `Overflow
| `Protobuf_encoder_error
| `Unknown_type
| `Wrong_type ])
Async.Std.Deferred.Result.t
val prob :
?cond:Events.t ->
Events.t ->
t -> (float, [> Opts.Get.error ]) Async.Std.Deferred.Result.t
val exp :
?cond:Events.t ->
Events.t ->
t -> (float, [> Opts.Get.error ]) Async.Std.Deferred.Result.t
val name : t -> string
val with_model :
?update_rule:update_rule ->
?prior_count:prior_count ->
?prior_exp:prior_exp ->
host:string ->
port:int ->
name:string ->
(t -> ('a, [> Conn.error ] as 'e) Async.Std.Deferred.Result.t) ->
('a, 'e) Async.Std.Deferred.Result.t
end