Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alavrik/1776902 to your computer and use it in GitHub Desktop.
Save alavrik/1776902 to your computer and use it in GitHub Desktop.
Compiling riakclient.proto for OCaml using Piqi
$ diff -u riakclient.proto.piqi riakclient.proto.piqi.edited
--- riakclient.proto.piqi 2012-02-08 20:55:35.000000000 -0600
+++ riakclient.proto.piqi.edited 2012-02-08 20:55:25.000000000 -0600
@@ -299,6 +299,7 @@
]
.field [
.name done
+ .ocaml-name "ocaml_done"
.type bool
.optional
.code 2
@@ -367,6 +368,7 @@
]
.field [
.name done
+ .ocaml-name "ocaml_done"
.type bool
.optional
.code 3
  1. run piqi of-proto riakclient.proto
  2. edit riakclient.proto.piqi as shown above
  3. run piqic ocaml --pp riakclient.proto.piqi; it produces riakclient_piqi.ml
module rec Riakclient_piqi :
sig
type binary = string
type uint32 = int32
type rpb_error_resp = Rpb_error_resp.t
type rpb_get_client_id_resp = Rpb_get_client_id_resp.t
type rpb_set_client_id_req = Rpb_set_client_id_req.t
type rpb_get_server_info_resp = Rpb_get_server_info_resp.t
type rpb_get_req = Rpb_get_req.t
type rpb_get_resp = Rpb_get_resp.t
type rpb_put_req = Rpb_put_req.t
type rpb_put_resp = Rpb_put_resp.t
type rpb_del_req = Rpb_del_req.t
type rpb_list_buckets_resp = Rpb_list_buckets_resp.t
type rpb_list_keys_req = Rpb_list_keys_req.t
type rpb_list_keys_resp = Rpb_list_keys_resp.t
type rpb_get_bucket_req = Rpb_get_bucket_req.t
type rpb_get_bucket_resp = Rpb_get_bucket_resp.t
type rpb_set_bucket_req = Rpb_set_bucket_req.t
type rpb_map_red_req = Rpb_map_red_req.t
type rpb_map_red_resp = Rpb_map_red_resp.t
type rpb_content = Rpb_content.t
type rpb_pair = Rpb_pair.t
type rpb_link = Rpb_link.t
type rpb_bucket_props = Rpb_bucket_props.t
end = Riakclient_piqi
and
Rpb_error_resp :
sig
type t =
{ mutable errmsg : Riakclient_piqi.binary;
mutable errcode : Riakclient_piqi.uint32
}
end = Rpb_error_resp
and
Rpb_get_client_id_resp :
sig type t = { mutable client_id : Riakclient_piqi.binary }
end =
Rpb_get_client_id_resp
and
Rpb_set_client_id_req :
sig type t = { mutable client_id : Riakclient_piqi.binary }
end =
Rpb_set_client_id_req
and
Rpb_get_server_info_resp :
sig
type t =
{ mutable node : Riakclient_piqi.binary option;
mutable server_version : Riakclient_piqi.binary option
}
end = Rpb_get_server_info_resp
and
Rpb_get_req :
sig
type t =
{ mutable bucket : Riakclient_piqi.binary;
mutable key : Riakclient_piqi.binary;
mutable r : Riakclient_piqi.uint32 option;
mutable pr : Riakclient_piqi.uint32 option;
mutable basic_quorum : bool option;
mutable notfound_ok : bool option;
mutable if_modified : Riakclient_piqi.binary option;
mutable head : bool option; mutable deletedvclock : bool option
}
end = Rpb_get_req
and
Rpb_get_resp :
sig
type t =
{ mutable content : Riakclient_piqi.rpb_content list;
mutable vclock : Riakclient_piqi.binary option;
mutable unchanged : bool option
}
end = Rpb_get_resp
and
Rpb_put_req :
sig
type t =
{ mutable bucket : Riakclient_piqi.binary;
mutable key : Riakclient_piqi.binary option;
mutable vclock : Riakclient_piqi.binary option;
mutable content : Riakclient_piqi.rpb_content;
mutable w : Riakclient_piqi.uint32 option;
mutable dw : Riakclient_piqi.uint32 option;
mutable return_body : bool option;
mutable pw : Riakclient_piqi.uint32 option;
mutable if_not_modified : bool option;
mutable if_none_match : bool option;
mutable return_head : bool option
}
end = Rpb_put_req
and
Rpb_put_resp :
sig
type t =
{ mutable content : Riakclient_piqi.rpb_content list;
mutable vclock : Riakclient_piqi.binary option;
mutable key : Riakclient_piqi.binary option
}
end = Rpb_put_resp
and
Rpb_del_req :
sig
type t =
{ mutable bucket : Riakclient_piqi.binary;
mutable key : Riakclient_piqi.binary;
mutable rw : Riakclient_piqi.uint32 option;
mutable vclock : Riakclient_piqi.binary option;
mutable r : Riakclient_piqi.uint32 option;
mutable w : Riakclient_piqi.uint32 option;
mutable pr : Riakclient_piqi.uint32 option;
mutable pw : Riakclient_piqi.uint32 option;
mutable dw : Riakclient_piqi.uint32 option
}
end = Rpb_del_req
and
Rpb_list_buckets_resp :
sig type t = { mutable buckets : Riakclient_piqi.binary list }
end =
Rpb_list_buckets_resp
and
Rpb_list_keys_req :
sig type t = { mutable bucket : Riakclient_piqi.binary }
end =
Rpb_list_keys_req
and
Rpb_list_keys_resp :
sig
type t =
{ mutable keys : Riakclient_piqi.binary list;
mutable ocaml_done : bool option
}
end = Rpb_list_keys_resp
and
Rpb_get_bucket_req :
sig type t = { mutable bucket : Riakclient_piqi.binary }
end =
Rpb_get_bucket_req
and
Rpb_get_bucket_resp :
sig type t = { mutable props : Riakclient_piqi.rpb_bucket_props }
end =
Rpb_get_bucket_resp
and
Rpb_set_bucket_req :
sig
type t =
{ mutable bucket : Riakclient_piqi.binary;
mutable props : Riakclient_piqi.rpb_bucket_props
}
end = Rpb_set_bucket_req
and
Rpb_map_red_req :
sig
type t =
{ mutable request : Riakclient_piqi.binary;
mutable content_type : Riakclient_piqi.binary
}
end = Rpb_map_red_req
and
Rpb_map_red_resp :
sig
type t =
{ mutable phase : Riakclient_piqi.uint32 option;
mutable response : Riakclient_piqi.binary option;
mutable ocaml_done : bool option
}
end = Rpb_map_red_resp
and
Rpb_content :
sig
type t =
{ mutable value : Riakclient_piqi.binary;
mutable content_type : Riakclient_piqi.binary option;
mutable charset : Riakclient_piqi.binary option;
mutable content_encoding : Riakclient_piqi.binary option;
mutable vtag : Riakclient_piqi.binary option;
mutable links : Riakclient_piqi.rpb_link list;
mutable last_mod : Riakclient_piqi.uint32 option;
mutable last_mod_usecs : Riakclient_piqi.uint32 option;
mutable usermeta : Riakclient_piqi.rpb_pair list;
mutable indexes : Riakclient_piqi.rpb_pair list
}
end = Rpb_content
and
Rpb_pair :
sig
type t =
{ mutable key : Riakclient_piqi.binary;
mutable value : Riakclient_piqi.binary option
}
end = Rpb_pair
and
Rpb_link :
sig
type t =
{ mutable bucket : Riakclient_piqi.binary option;
mutable key : Riakclient_piqi.binary option;
mutable tag : Riakclient_piqi.binary option
}
end = Rpb_link
and
Rpb_bucket_props :
sig
type t =
{ mutable n_val : Riakclient_piqi.uint32 option;
mutable allow_mult : bool option
}
end = Rpb_bucket_props
include Riakclient_piqi
let rec parse_binary x = Piqirun.string_of_block x
and parse_uint32 x = Piqirun.int32_of_varint x
and packed_parse_uint32 x = Piqirun.int32_of_packed_varint x
and parse_bool x = Piqirun.bool_of_varint x
and packed_parse_bool x = Piqirun.bool_of_packed_varint x
and parse_rpb_error_resp x =
let x = Piqirun.parse_record x in
let (_errmsg, x) = Piqirun.parse_required_field 1 parse_binary x in
let (_errcode, x) = Piqirun.parse_required_field 2 parse_uint32 x
in
(Piqirun.check_unparsed_fields x;
{ Rpb_error_resp.errmsg = _errmsg; Rpb_error_resp.errcode = _errcode; })
and parse_rpb_get_client_id_resp x =
let x = Piqirun.parse_record x in
let (_client_id, x) = Piqirun.parse_required_field 1 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{ Rpb_get_client_id_resp.client_id = _client_id; })
and parse_rpb_set_client_id_req x =
let x = Piqirun.parse_record x in
let (_client_id, x) = Piqirun.parse_required_field 1 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{ Rpb_set_client_id_req.client_id = _client_id; })
and parse_rpb_get_server_info_resp x =
let x = Piqirun.parse_record x in
let (_node, x) = Piqirun.parse_optional_field 1 parse_binary x in
let (_server_version, x) = Piqirun.parse_optional_field 2 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_get_server_info_resp.node = _node;
Rpb_get_server_info_resp.server_version = _server_version;
})
and parse_rpb_get_req x =
let x = Piqirun.parse_record x in
let (_bucket, x) = Piqirun.parse_required_field 1 parse_binary x in
let (_key, x) = Piqirun.parse_required_field 2 parse_binary x in
let (_r, x) = Piqirun.parse_optional_field 3 parse_uint32 x in
let (_pr, x) = Piqirun.parse_optional_field 4 parse_uint32 x in
let (_basic_quorum, x) = Piqirun.parse_optional_field 5 parse_bool x in
let (_notfound_ok, x) = Piqirun.parse_optional_field 6 parse_bool x in
let (_if_modified, x) = Piqirun.parse_optional_field 7 parse_binary x in
let (_head, x) = Piqirun.parse_optional_field 8 parse_bool x in
let (_deletedvclock, x) = Piqirun.parse_optional_field 9 parse_bool x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_get_req.bucket = _bucket;
Rpb_get_req.key = _key;
Rpb_get_req.r = _r;
Rpb_get_req.pr = _pr;
Rpb_get_req.basic_quorum = _basic_quorum;
Rpb_get_req.notfound_ok = _notfound_ok;
Rpb_get_req.if_modified = _if_modified;
Rpb_get_req.head = _head;
Rpb_get_req.deletedvclock = _deletedvclock;
})
and parse_rpb_get_resp x =
let x = Piqirun.parse_record x in
let (_content, x) = Piqirun.parse_repeated_field 1 parse_rpb_content x in
let (_vclock, x) = Piqirun.parse_optional_field 2 parse_binary x in
let (_unchanged, x) = Piqirun.parse_optional_field 3 parse_bool x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_get_resp.content = _content;
Rpb_get_resp.vclock = _vclock;
Rpb_get_resp.unchanged = _unchanged;
})
and parse_rpb_put_req x =
let x = Piqirun.parse_record x in
let (_bucket, x) = Piqirun.parse_required_field 1 parse_binary x in
let (_key, x) = Piqirun.parse_optional_field 2 parse_binary x in
let (_vclock, x) = Piqirun.parse_optional_field 3 parse_binary x in
let (_content, x) = Piqirun.parse_required_field 4 parse_rpb_content x in
let (_w, x) = Piqirun.parse_optional_field 5 parse_uint32 x in
let (_dw, x) = Piqirun.parse_optional_field 6 parse_uint32 x in
let (_return_body, x) = Piqirun.parse_optional_field 7 parse_bool x in
let (_pw, x) = Piqirun.parse_optional_field 8 parse_uint32 x in
let (_if_not_modified, x) = Piqirun.parse_optional_field 9 parse_bool x in
let (_if_none_match, x) = Piqirun.parse_optional_field 10 parse_bool x in
let (_return_head, x) = Piqirun.parse_optional_field 11 parse_bool x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_put_req.bucket = _bucket;
Rpb_put_req.key = _key;
Rpb_put_req.vclock = _vclock;
Rpb_put_req.content = _content;
Rpb_put_req.w = _w;
Rpb_put_req.dw = _dw;
Rpb_put_req.return_body = _return_body;
Rpb_put_req.pw = _pw;
Rpb_put_req.if_not_modified = _if_not_modified;
Rpb_put_req.if_none_match = _if_none_match;
Rpb_put_req.return_head = _return_head;
})
and parse_rpb_put_resp x =
let x = Piqirun.parse_record x in
let (_content, x) = Piqirun.parse_repeated_field 1 parse_rpb_content x in
let (_vclock, x) = Piqirun.parse_optional_field 2 parse_binary x in
let (_key, x) = Piqirun.parse_optional_field 3 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_put_resp.content = _content;
Rpb_put_resp.vclock = _vclock;
Rpb_put_resp.key = _key;
})
and parse_rpb_del_req x =
let x = Piqirun.parse_record x in
let (_bucket, x) = Piqirun.parse_required_field 1 parse_binary x in
let (_key, x) = Piqirun.parse_required_field 2 parse_binary x in
let (_rw, x) = Piqirun.parse_optional_field 3 parse_uint32 x in
let (_vclock, x) = Piqirun.parse_optional_field 4 parse_binary x in
let (_r, x) = Piqirun.parse_optional_field 5 parse_uint32 x in
let (_w, x) = Piqirun.parse_optional_field 6 parse_uint32 x in
let (_pr, x) = Piqirun.parse_optional_field 7 parse_uint32 x in
let (_pw, x) = Piqirun.parse_optional_field 8 parse_uint32 x in
let (_dw, x) = Piqirun.parse_optional_field 9 parse_uint32 x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_del_req.bucket = _bucket;
Rpb_del_req.key = _key;
Rpb_del_req.rw = _rw;
Rpb_del_req.vclock = _vclock;
Rpb_del_req.r = _r;
Rpb_del_req.w = _w;
Rpb_del_req.pr = _pr;
Rpb_del_req.pw = _pw;
Rpb_del_req.dw = _dw;
})
and parse_rpb_list_buckets_resp x =
let x = Piqirun.parse_record x in
let (_buckets, x) = Piqirun.parse_repeated_field 1 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{ Rpb_list_buckets_resp.buckets = _buckets; })
and parse_rpb_list_keys_req x =
let x = Piqirun.parse_record x in
let (_bucket, x) = Piqirun.parse_required_field 1 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{ Rpb_list_keys_req.bucket = _bucket; })
and parse_rpb_list_keys_resp x =
let x = Piqirun.parse_record x in
let (_keys, x) = Piqirun.parse_repeated_field 1 parse_binary x in
let (_ocaml_done, x) = Piqirun.parse_optional_field 2 parse_bool x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_list_keys_resp.keys = _keys;
Rpb_list_keys_resp.ocaml_done = _ocaml_done;
})
and parse_rpb_get_bucket_req x =
let x = Piqirun.parse_record x in
let (_bucket, x) = Piqirun.parse_required_field 1 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{ Rpb_get_bucket_req.bucket = _bucket; })
and parse_rpb_get_bucket_resp x =
let x = Piqirun.parse_record x in
let (_props, x) = Piqirun.parse_required_field 1 parse_rpb_bucket_props x
in
(Piqirun.check_unparsed_fields x;
{ Rpb_get_bucket_resp.props = _props; })
and parse_rpb_set_bucket_req x =
let x = Piqirun.parse_record x in
let (_bucket, x) = Piqirun.parse_required_field 1 parse_binary x in
let (_props, x) = Piqirun.parse_required_field 2 parse_rpb_bucket_props x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_set_bucket_req.bucket = _bucket;
Rpb_set_bucket_req.props = _props;
})
and parse_rpb_map_red_req x =
let x = Piqirun.parse_record x in
let (_request, x) = Piqirun.parse_required_field 1 parse_binary x in
let (_content_type, x) = Piqirun.parse_required_field 2 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_map_red_req.request = _request;
Rpb_map_red_req.content_type = _content_type;
})
and parse_rpb_map_red_resp x =
let x = Piqirun.parse_record x in
let (_phase, x) = Piqirun.parse_optional_field 1 parse_uint32 x in
let (_response, x) = Piqirun.parse_optional_field 2 parse_binary x in
let (_ocaml_done, x) = Piqirun.parse_optional_field 3 parse_bool x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_map_red_resp.phase = _phase;
Rpb_map_red_resp.response = _response;
Rpb_map_red_resp.ocaml_done = _ocaml_done;
})
and parse_rpb_content x =
let x = Piqirun.parse_record x in
let (_value, x) = Piqirun.parse_required_field 1 parse_binary x in
let (_content_type, x) = Piqirun.parse_optional_field 2 parse_binary x in
let (_charset, x) = Piqirun.parse_optional_field 3 parse_binary x in
let (_content_encoding, x) =
Piqirun.parse_optional_field 4 parse_binary x in
let (_vtag, x) = Piqirun.parse_optional_field 5 parse_binary x in
let (_links, x) = Piqirun.parse_repeated_field 6 parse_rpb_link x in
let (_last_mod, x) = Piqirun.parse_optional_field 7 parse_uint32 x in
let (_last_mod_usecs, x) = Piqirun.parse_optional_field 8 parse_uint32 x in
let (_usermeta, x) = Piqirun.parse_repeated_field 9 parse_rpb_pair x in
let (_indexes, x) = Piqirun.parse_repeated_field 10 parse_rpb_pair x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_content.value = _value;
Rpb_content.content_type = _content_type;
Rpb_content.charset = _charset;
Rpb_content.content_encoding = _content_encoding;
Rpb_content.vtag = _vtag;
Rpb_content.links = _links;
Rpb_content.last_mod = _last_mod;
Rpb_content.last_mod_usecs = _last_mod_usecs;
Rpb_content.usermeta = _usermeta;
Rpb_content.indexes = _indexes;
})
and parse_rpb_pair x =
let x = Piqirun.parse_record x in
let (_key, x) = Piqirun.parse_required_field 1 parse_binary x in
let (_value, x) = Piqirun.parse_optional_field 2 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{ Rpb_pair.key = _key; Rpb_pair.value = _value; })
and parse_rpb_link x =
let x = Piqirun.parse_record x in
let (_bucket, x) = Piqirun.parse_optional_field 1 parse_binary x in
let (_key, x) = Piqirun.parse_optional_field 2 parse_binary x in
let (_tag, x) = Piqirun.parse_optional_field 3 parse_binary x
in
(Piqirun.check_unparsed_fields x;
{ Rpb_link.bucket = _bucket; Rpb_link.key = _key; Rpb_link.tag = _tag; })
and parse_rpb_bucket_props x =
let x = Piqirun.parse_record x in
let (_n_val, x) = Piqirun.parse_optional_field 1 parse_uint32 x in
let (_allow_mult, x) = Piqirun.parse_optional_field 2 parse_bool x
in
(Piqirun.check_unparsed_fields x;
{
Rpb_bucket_props.n_val = _n_val;
Rpb_bucket_props.allow_mult = _allow_mult;
})
let rec gen__binary code x = Piqirun.string_to_block code x
and gen__uint32 code x = Piqirun.int32_to_varint code x
and packed_gen__uint32 x = Piqirun.int32_to_packed_varint x
and gen__bool code x = Piqirun.bool_to_varint code x
and packed_gen__bool x = Piqirun.bool_to_packed_varint x
and gen__rpb_error_resp code x =
let _errmsg =
Piqirun.gen_required_field 1 gen__binary x.Rpb_error_resp.errmsg in
let _errcode =
Piqirun.gen_required_field 2 gen__uint32 x.Rpb_error_resp.errcode
in Piqirun.gen_record code [ _errmsg; _errcode ]
and gen__rpb_get_client_id_resp code x =
let _client_id =
Piqirun.gen_required_field 1 gen__binary
x.Rpb_get_client_id_resp.client_id
in Piqirun.gen_record code [ _client_id ]
and gen__rpb_set_client_id_req code x =
let _client_id =
Piqirun.gen_required_field 1 gen__binary
x.Rpb_set_client_id_req.client_id
in Piqirun.gen_record code [ _client_id ]
and gen__rpb_get_server_info_resp code x =
let _node =
Piqirun.gen_optional_field 1 gen__binary x.Rpb_get_server_info_resp.node in
let _server_version =
Piqirun.gen_optional_field 2 gen__binary
x.Rpb_get_server_info_resp.server_version
in Piqirun.gen_record code [ _node; _server_version ]
and gen__rpb_get_req code x =
let _bucket =
Piqirun.gen_required_field 1 gen__binary x.Rpb_get_req.bucket in
let _key = Piqirun.gen_required_field 2 gen__binary x.Rpb_get_req.key in
let _r = Piqirun.gen_optional_field 3 gen__uint32 x.Rpb_get_req.r in
let _pr = Piqirun.gen_optional_field 4 gen__uint32 x.Rpb_get_req.pr in
let _basic_quorum =
Piqirun.gen_optional_field 5 gen__bool x.Rpb_get_req.basic_quorum in
let _notfound_ok =
Piqirun.gen_optional_field 6 gen__bool x.Rpb_get_req.notfound_ok in
let _if_modified =
Piqirun.gen_optional_field 7 gen__binary x.Rpb_get_req.if_modified in
let _head = Piqirun.gen_optional_field 8 gen__bool x.Rpb_get_req.head in
let _deletedvclock =
Piqirun.gen_optional_field 9 gen__bool x.Rpb_get_req.deletedvclock
in
Piqirun.gen_record code
[ _bucket; _key; _r; _pr; _basic_quorum; _notfound_ok; _if_modified;
_head; _deletedvclock ]
and gen__rpb_get_resp code x =
let _content =
Piqirun.gen_repeated_field 1 gen__rpb_content x.Rpb_get_resp.content in
let _vclock =
Piqirun.gen_optional_field 2 gen__binary x.Rpb_get_resp.vclock in
let _unchanged =
Piqirun.gen_optional_field 3 gen__bool x.Rpb_get_resp.unchanged
in Piqirun.gen_record code [ _content; _vclock; _unchanged ]
and gen__rpb_put_req code x =
let _bucket =
Piqirun.gen_required_field 1 gen__binary x.Rpb_put_req.bucket in
let _key = Piqirun.gen_optional_field 2 gen__binary x.Rpb_put_req.key in
let _vclock =
Piqirun.gen_optional_field 3 gen__binary x.Rpb_put_req.vclock in
let _content =
Piqirun.gen_required_field 4 gen__rpb_content x.Rpb_put_req.content in
let _w = Piqirun.gen_optional_field 5 gen__uint32 x.Rpb_put_req.w in
let _dw = Piqirun.gen_optional_field 6 gen__uint32 x.Rpb_put_req.dw in
let _return_body =
Piqirun.gen_optional_field 7 gen__bool x.Rpb_put_req.return_body in
let _pw = Piqirun.gen_optional_field 8 gen__uint32 x.Rpb_put_req.pw in
let _if_not_modified =
Piqirun.gen_optional_field 9 gen__bool x.Rpb_put_req.if_not_modified in
let _if_none_match =
Piqirun.gen_optional_field 10 gen__bool x.Rpb_put_req.if_none_match in
let _return_head =
Piqirun.gen_optional_field 11 gen__bool x.Rpb_put_req.return_head
in
Piqirun.gen_record code
[ _bucket; _key; _vclock; _content; _w; _dw; _return_body; _pw;
_if_not_modified; _if_none_match; _return_head ]
and gen__rpb_put_resp code x =
let _content =
Piqirun.gen_repeated_field 1 gen__rpb_content x.Rpb_put_resp.content in
let _vclock =
Piqirun.gen_optional_field 2 gen__binary x.Rpb_put_resp.vclock in
let _key = Piqirun.gen_optional_field 3 gen__binary x.Rpb_put_resp.key
in Piqirun.gen_record code [ _content; _vclock; _key ]
and gen__rpb_del_req code x =
let _bucket =
Piqirun.gen_required_field 1 gen__binary x.Rpb_del_req.bucket in
let _key = Piqirun.gen_required_field 2 gen__binary x.Rpb_del_req.key in
let _rw = Piqirun.gen_optional_field 3 gen__uint32 x.Rpb_del_req.rw in
let _vclock =
Piqirun.gen_optional_field 4 gen__binary x.Rpb_del_req.vclock in
let _r = Piqirun.gen_optional_field 5 gen__uint32 x.Rpb_del_req.r in
let _w = Piqirun.gen_optional_field 6 gen__uint32 x.Rpb_del_req.w in
let _pr = Piqirun.gen_optional_field 7 gen__uint32 x.Rpb_del_req.pr in
let _pw = Piqirun.gen_optional_field 8 gen__uint32 x.Rpb_del_req.pw in
let _dw = Piqirun.gen_optional_field 9 gen__uint32 x.Rpb_del_req.dw
in
Piqirun.gen_record code
[ _bucket; _key; _rw; _vclock; _r; _w; _pr; _pw; _dw ]
and gen__rpb_list_buckets_resp code x =
let _buckets =
Piqirun.gen_repeated_field 1 gen__binary x.Rpb_list_buckets_resp.buckets
in Piqirun.gen_record code [ _buckets ]
and gen__rpb_list_keys_req code x =
let _bucket =
Piqirun.gen_required_field 1 gen__binary x.Rpb_list_keys_req.bucket
in Piqirun.gen_record code [ _bucket ]
and gen__rpb_list_keys_resp code x =
let _keys =
Piqirun.gen_repeated_field 1 gen__binary x.Rpb_list_keys_resp.keys in
let _ocaml_done =
Piqirun.gen_optional_field 2 gen__bool x.Rpb_list_keys_resp.ocaml_done
in Piqirun.gen_record code [ _keys; _ocaml_done ]
and gen__rpb_get_bucket_req code x =
let _bucket =
Piqirun.gen_required_field 1 gen__binary x.Rpb_get_bucket_req.bucket
in Piqirun.gen_record code [ _bucket ]
and gen__rpb_get_bucket_resp code x =
let _props =
Piqirun.gen_required_field 1 gen__rpb_bucket_props
x.Rpb_get_bucket_resp.props
in Piqirun.gen_record code [ _props ]
and gen__rpb_set_bucket_req code x =
let _bucket =
Piqirun.gen_required_field 1 gen__binary x.Rpb_set_bucket_req.bucket in
let _props =
Piqirun.gen_required_field 2 gen__rpb_bucket_props
x.Rpb_set_bucket_req.props
in Piqirun.gen_record code [ _bucket; _props ]
and gen__rpb_map_red_req code x =
let _request =
Piqirun.gen_required_field 1 gen__binary x.Rpb_map_red_req.request in
let _content_type =
Piqirun.gen_required_field 2 gen__binary x.Rpb_map_red_req.content_type
in Piqirun.gen_record code [ _request; _content_type ]
and gen__rpb_map_red_resp code x =
let _phase =
Piqirun.gen_optional_field 1 gen__uint32 x.Rpb_map_red_resp.phase in
let _response =
Piqirun.gen_optional_field 2 gen__binary x.Rpb_map_red_resp.response in
let _ocaml_done =
Piqirun.gen_optional_field 3 gen__bool x.Rpb_map_red_resp.ocaml_done
in Piqirun.gen_record code [ _phase; _response; _ocaml_done ]
and gen__rpb_content code x =
let _value =
Piqirun.gen_required_field 1 gen__binary x.Rpb_content.value in
let _content_type =
Piqirun.gen_optional_field 2 gen__binary x.Rpb_content.content_type in
let _charset =
Piqirun.gen_optional_field 3 gen__binary x.Rpb_content.charset in
let _content_encoding =
Piqirun.gen_optional_field 4 gen__binary x.Rpb_content.content_encoding in
let _vtag = Piqirun.gen_optional_field 5 gen__binary x.Rpb_content.vtag in
let _links =
Piqirun.gen_repeated_field 6 gen__rpb_link x.Rpb_content.links in
let _last_mod =
Piqirun.gen_optional_field 7 gen__uint32 x.Rpb_content.last_mod in
let _last_mod_usecs =
Piqirun.gen_optional_field 8 gen__uint32 x.Rpb_content.last_mod_usecs in
let _usermeta =
Piqirun.gen_repeated_field 9 gen__rpb_pair x.Rpb_content.usermeta in
let _indexes =
Piqirun.gen_repeated_field 10 gen__rpb_pair x.Rpb_content.indexes
in
Piqirun.gen_record code
[ _value; _content_type; _charset; _content_encoding; _vtag; _links;
_last_mod; _last_mod_usecs; _usermeta; _indexes ]
and gen__rpb_pair code x =
let _key = Piqirun.gen_required_field 1 gen__binary x.Rpb_pair.key in
let _value = Piqirun.gen_optional_field 2 gen__binary x.Rpb_pair.value
in Piqirun.gen_record code [ _key; _value ]
and gen__rpb_link code x =
let _bucket = Piqirun.gen_optional_field 1 gen__binary x.Rpb_link.bucket in
let _key = Piqirun.gen_optional_field 2 gen__binary x.Rpb_link.key in
let _tag = Piqirun.gen_optional_field 3 gen__binary x.Rpb_link.tag
in Piqirun.gen_record code [ _bucket; _key; _tag ]
and gen__rpb_bucket_props code x =
let _n_val =
Piqirun.gen_optional_field 1 gen__uint32 x.Rpb_bucket_props.n_val in
let _allow_mult =
Piqirun.gen_optional_field 2 gen__bool x.Rpb_bucket_props.allow_mult
in Piqirun.gen_record code [ _n_val; _allow_mult ]
let gen_binary x = gen__binary (-1) x
let gen_uint32 x = gen__uint32 (-1) x
let gen_bool x = gen__bool (-1) x
let gen_rpb_error_resp x = gen__rpb_error_resp (-1) x
let gen_rpb_get_client_id_resp x = gen__rpb_get_client_id_resp (-1) x
let gen_rpb_set_client_id_req x = gen__rpb_set_client_id_req (-1) x
let gen_rpb_get_server_info_resp x = gen__rpb_get_server_info_resp (-1) x
let gen_rpb_get_req x = gen__rpb_get_req (-1) x
let gen_rpb_get_resp x = gen__rpb_get_resp (-1) x
let gen_rpb_put_req x = gen__rpb_put_req (-1) x
let gen_rpb_put_resp x = gen__rpb_put_resp (-1) x
let gen_rpb_del_req x = gen__rpb_del_req (-1) x
let gen_rpb_list_buckets_resp x = gen__rpb_list_buckets_resp (-1) x
let gen_rpb_list_keys_req x = gen__rpb_list_keys_req (-1) x
let gen_rpb_list_keys_resp x = gen__rpb_list_keys_resp (-1) x
let gen_rpb_get_bucket_req x = gen__rpb_get_bucket_req (-1) x
let gen_rpb_get_bucket_resp x = gen__rpb_get_bucket_resp (-1) x
let gen_rpb_set_bucket_req x = gen__rpb_set_bucket_req (-1) x
let gen_rpb_map_red_req x = gen__rpb_map_red_req (-1) x
let gen_rpb_map_red_resp x = gen__rpb_map_red_resp (-1) x
let gen_rpb_content x = gen__rpb_content (-1) x
let gen_rpb_pair x = gen__rpb_pair (-1) x
let gen_rpb_link x = gen__rpb_link (-1) x
let gen_rpb_bucket_props x = gen__rpb_bucket_props (-1) x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment