From 41fbdf886b44d545143a31ea6fd0087cce4b2807 Mon Sep 17 00:00:00 2001 From: torque Date: Sat, 14 Oct 2023 12:24:01 -0700 Subject: [PATCH] git subrepo pull --branch=v3.7.0 deps/nats.c subrepo: subdir: "deps/nats.c" merged: "5d057f6" upstream: origin: "https://github.com/nats-io/nats.c.git" branch: "v3.7.0" commit: "5d057f6" git-subrepo: version: "0.4.6" commit: "affc4c01a" --- deps/nats.c/.github/ISSUE_TEMPLATE/config.yml | 8 + deps/nats.c/.github/ISSUE_TEMPLATE/defect.yml | 41 + .../.github/ISSUE_TEMPLATE/proposal.yml | 34 + deps/nats.c/.gitignore | 2 + deps/nats.c/.gitrepo | 6 +- deps/nats.c/.travis.yml | 36 +- deps/nats.c/CMakeLists.txt | 6 +- deps/nats.c/README.md | 2 +- deps/nats.c/buildOnTravis.sh | 21 +- deps/nats.c/doc/DoxyFile.NATS.Client | 2 +- deps/nats.c/doc/html/annotated.html | 47 +- deps/nats.c/doc/html/annotated_dup.js | 9 + deps/nats.c/doc/html/classes.html | 15 +- deps/nats.c/doc/html/customdoxygen.css | 0 deps/nats.c/doc/html/deprecated.html | 8 +- .../dir_085924db4bed469054a9264cf96b0d5e.html | 10 +- .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 12 +- deps/nats.c/doc/html/doc.svg | 12 + deps/nats.c/doc/html/docd.svg | 12 + deps/nats.c/doc/html/doxygen.svg | 4 +- deps/nats.c/doc/html/dynsections.js | 69 + deps/nats.c/doc/html/files.html | 6 +- deps/nats.c/doc/html/folderclosed.svg | 11 + deps/nats.c/doc/html/folderclosedd.svg | 11 + deps/nats.c/doc/html/folderopen.svg | 17 + deps/nats.c/doc/html/folderopend.svg | 12 + deps/nats.c/doc/html/functions.html | 7 +- deps/nats.c/doc/html/functions_b.html | 6 +- deps/nats.c/doc/html/functions_c.html | 10 +- deps/nats.c/doc/html/functions_d.html | 11 +- deps/nats.c/doc/html/functions_dup.js | 1 + deps/nats.c/doc/html/functions_e.html | 11 +- deps/nats.c/doc/html/functions_f.html | 12 +- deps/nats.c/doc/html/functions_h.html | 7 +- deps/nats.c/doc/html/functions_i.html | 9 +- deps/nats.c/doc/html/functions_k.html | 6 +- deps/nats.c/doc/html/functions_l.html | 9 +- deps/nats.c/doc/html/functions_m.html | 9 +- deps/nats.c/doc/html/functions_n.html | 10 +- deps/nats.c/doc/html/functions_o.html | 6 +- deps/nats.c/doc/html/functions_p.html | 8 +- deps/nats.c/doc/html/functions_q.html | 6 +- deps/nats.c/doc/html/functions_r.html | 6 +- deps/nats.c/doc/html/functions_s.html | 17 +- deps/nats.c/doc/html/functions_t.html | 7 +- deps/nats.c/doc/html/functions_v.html | 111 + deps/nats.c/doc/html/functions_vars.html | 9 +- deps/nats.c/doc/html/functions_vars.js | 1 + deps/nats.c/doc/html/functions_vars_b.html | 8 +- deps/nats.c/doc/html/functions_vars_c.html | 12 +- deps/nats.c/doc/html/functions_vars_d.html | 13 +- deps/nats.c/doc/html/functions_vars_e.html | 13 +- deps/nats.c/doc/html/functions_vars_f.html | 14 +- deps/nats.c/doc/html/functions_vars_h.html | 9 +- deps/nats.c/doc/html/functions_vars_i.html | 11 +- deps/nats.c/doc/html/functions_vars_k.html | 8 +- deps/nats.c/doc/html/functions_vars_l.html | 11 +- deps/nats.c/doc/html/functions_vars_m.html | 11 +- deps/nats.c/doc/html/functions_vars_n.html | 12 +- deps/nats.c/doc/html/functions_vars_o.html | 8 +- deps/nats.c/doc/html/functions_vars_p.html | 10 +- deps/nats.c/doc/html/functions_vars_q.html | 8 +- deps/nats.c/doc/html/functions_vars_r.html | 8 +- deps/nats.c/doc/html/functions_vars_s.html | 19 +- deps/nats.c/doc/html/functions_vars_t.html | 9 +- deps/nats.c/doc/html/functions_vars_v.html | 111 + deps/nats.c/doc/html/functions_vars_w.html | 8 +- deps/nats.c/doc/html/functions_w.html | 6 +- deps/nats.c/doc/html/globals.html | 11 +- deps/nats.c/doc/html/globals_defs.html | 19 +- deps/nats.c/doc/html/globals_dup.js | 1 + deps/nats.c/doc/html/globals_enum.html | 9 +- deps/nats.c/doc/html/globals_eval.html | 10 +- deps/nats.c/doc/html/globals_func.html | 8 +- deps/nats.c/doc/html/globals_func.js | 1 + deps/nats.c/doc/html/globals_func_k.html | 8 +- deps/nats.c/doc/html/globals_func_m.html | 154 + deps/nats.c/doc/html/globals_func_n.html | 8 +- deps/nats.c/doc/html/globals_func_s.html | 8 +- deps/nats.c/doc/html/globals_k.html | 6 +- deps/nats.c/doc/html/globals_m.html | 181 + deps/nats.c/doc/html/globals_n.html | 7 +- deps/nats.c/doc/html/globals_s.html | 6 +- deps/nats.c/doc/html/globals_type.html | 31 +- .../doc/html/group__callbacks_group.html | 40 +- deps/nats.c/doc/html/group__conn_group.html | 12 +- .../doc/html/group__conn_mgt_group.html | 62 +- .../doc/html/group__conn_pub_group.html | 22 +- .../doc/html/group__conn_sub_group.html | 18 +- .../doc/html/group__env_variables_group.html | 6 +- deps/nats.c/doc/html/group__func_group.html | 36 +- deps/nats.c/doc/html/group__inbox_group.html | 10 +- .../doc/html/group__js_assets_group.html | 72 +- deps/nats.c/doc/html/group__js_group.html | 20 +- deps/nats.c/doc/html/group__js_msg.html | 26 +- deps/nats.c/doc/html/group__js_pub_group.html | 22 +- deps/nats.c/doc/html/group__js_sub_group.html | 24 +- deps/nats.c/doc/html/group__kv_entry.html | 26 +- deps/nats.c/doc/html/group__kv_group.html | 56 +- deps/nats.c/doc/html/group__kv_group_mgt.html | 16 +- deps/nats.c/doc/html/group__kv_status.html | 20 +- deps/nats.c/doc/html/group__kv_watcher.html | 12 +- .../doc/html/group__libevent_functions.html | 16 +- .../nats.c/doc/html/group__library_group.html | 36 +- .../doc/html/group__libuv_functions.html | 18 +- .../doc/html/group__micro_callbacks.html | 197 + .../nats.c/doc/html/group__micro_callbacks.js | 6 + .../html/group__micro_cleanup_functions.html | 172 + .../html/group__micro_cleanup_functions.js | 5 + .../html/group__micro_client_functions.html | 250 + .../doc/html/group__micro_client_functions.js | 6 + .../doc/html/group__micro_constants.html | 289 + .../nats.c/doc/html/group__micro_constants.js | 13 + .../html/group__micro_error_functions.html | 433 ++ .../doc/html/group__micro_error_functions.js | 12 + .../doc/html/group__micro_functions.html | 129 + .../nats.c/doc/html/group__micro_functions.js | 9 + deps/nats.c/doc/html/group__micro_group.html | 133 + deps/nats.c/doc/html/group__micro_group.js | 8 + .../html/group__micro_group_functions.html | 207 + .../doc/html/group__micro_group_functions.js | 5 + .../html/group__micro_request_functions.html | 820 +++ .../html/group__micro_request_functions.js | 21 + .../html/group__micro_service_functions.html | 514 ++ .../html/group__micro_service_functions.js | 14 + .../nats.c/doc/html/group__micro_structs.html | 130 + deps/nats.c/doc/html/group__micro_structs.js | 55 + deps/nats.c/doc/html/group__micro_types.html | 359 ++ deps/nats.c/doc/html/group__micro_types.js | 16 + deps/nats.c/doc/html/group__msg_group.html | 36 +- deps/nats.c/doc/html/group__opts_group.html | 116 +- .../doc/html/group__stan_conn_group.html | 12 +- .../doc/html/group__stan_conn_mgt_group.html | 16 +- .../doc/html/group__stan_conn_opts_group.html | 26 +- .../doc/html/group__stan_conn_pub_group.html | 10 +- .../doc/html/group__stan_conn_sub_group.html | 10 +- .../doc/html/group__stan_msg_group.html | 18 +- .../doc/html/group__stan_sub_group.html | 16 +- .../doc/html/group__stan_sub_opts_group.html | 28 +- deps/nats.c/doc/html/group__stats_group.html | 12 +- deps/nats.c/doc/html/group__status_group.html | 8 +- deps/nats.c/doc/html/group__sub_group.html | 50 +- deps/nats.c/doc/html/group__types_group.html | 228 +- deps/nats.c/doc/html/group__types_group.js | 36 +- .../doc/html/group__wildcards_group.html | 6 +- deps/nats.c/doc/html/index.html | 6 +- deps/nats.c/doc/html/libevent_8h.html | 16 +- deps/nats.c/doc/html/libevent_8h_source.html | 47 +- deps/nats.c/doc/html/libuv_8h.html | 18 +- deps/nats.c/doc/html/libuv_8h_source.html | 61 +- deps/nats.c/doc/html/menudata.js | 7 +- deps/nats.c/doc/html/minus.svg | 8 + deps/nats.c/doc/html/minusd.svg | 8 + deps/nats.c/doc/html/modules.html | 26 +- deps/nats.c/doc/html/modules.js | 1 + deps/nats.c/doc/html/nats_8h.html | 1043 ++-- deps/nats.c/doc/html/nats_8h.js | 80 +- deps/nats.c/doc/html/nats_8h_source.html | 4658 ++++++++++------- deps/nats.c/doc/html/navtree.css | 1 - deps/nats.c/doc/html/navtree.js | 28 +- deps/nats.c/doc/html/navtreedata.js | 10 +- deps/nats.c/doc/html/navtreeindex0.js | 24 +- deps/nats.c/doc/html/navtreeindex1.js | 198 +- deps/nats.c/doc/html/navtreeindex2.js | 220 +- deps/nats.c/doc/html/navtreeindex3.js | 500 +- deps/nats.c/doc/html/navtreeindex4.js | 179 +- deps/nats.c/doc/html/pages.html | 6 +- deps/nats.c/doc/html/plus.svg | 9 + deps/nats.c/doc/html/plusd.svg | 9 + deps/nats.c/doc/html/search/all_0.js | 17 +- deps/nats.c/doc/html/search/all_1.js | 17 +- deps/nats.c/doc/html/search/all_10.js | 7 +- deps/nats.c/doc/html/search/all_11.js | 94 +- deps/nats.c/doc/html/search/all_12.js | 88 +- deps/nats.c/doc/html/search/all_13.js | 12 +- deps/nats.c/doc/html/search/all_14.js | 3 +- deps/nats.c/doc/html/search/all_15.js | 5 + deps/nats.c/doc/html/search/all_2.js | 22 +- deps/nats.c/doc/html/search/all_3.js | 33 +- deps/nats.c/doc/html/search/all_4.js | 39 +- deps/nats.c/doc/html/search/all_5.js | 23 +- deps/nats.c/doc/html/search/all_6.js | 9 +- deps/nats.c/doc/html/search/all_7.js | 11 +- deps/nats.c/doc/html/search/all_8.js | 271 +- deps/nats.c/doc/html/search/all_9.js | 325 +- deps/nats.c/doc/html/search/all_a.js | 79 +- deps/nats.c/doc/html/search/all_b.js | 127 +- deps/nats.c/doc/html/search/all_c.js | 297 +- deps/nats.c/doc/html/search/all_d.js | 265 +- deps/nats.c/doc/html/search/all_e.js | 15 +- deps/nats.c/doc/html/search/all_f.js | 8 +- deps/nats.c/doc/html/search/classes_0.js | 22 +- deps/nats.c/doc/html/search/classes_2.js | 7 +- deps/nats.c/doc/html/search/classes_3.js | 5 + deps/nats.c/doc/html/search/close.svg | 19 +- deps/nats.c/doc/html/search/enums_0.js | 3 +- deps/nats.c/doc/html/search/enumvalues_0.js | 266 +- deps/nats.c/doc/html/search/functions_2.js | 223 +- deps/nats.c/doc/html/search/functions_3.js | 220 +- deps/nats.c/doc/html/search/functions_4.js | 44 + deps/nats.c/doc/html/search/groups_0.js | 4 +- deps/nats.c/doc/html/search/groups_1.js | 5 +- deps/nats.c/doc/html/search/groups_2.js | 4 +- deps/nats.c/doc/html/search/groups_3.js | 2 +- deps/nats.c/doc/html/search/groups_4.js | 3 +- deps/nats.c/doc/html/search/groups_5.js | 7 +- deps/nats.c/doc/html/search/groups_6.js | 8 +- deps/nats.c/doc/html/search/groups_7.js | 6 +- deps/nats.c/doc/html/search/groups_8.js | 11 +- deps/nats.c/doc/html/search/groups_9.js | 2 +- deps/nats.c/doc/html/search/groups_a.js | 12 +- deps/nats.c/doc/html/search/groups_b.js | 17 +- deps/nats.c/doc/html/search/groups_c.js | 2 +- deps/nats.c/doc/html/search/groups_d.js | 4 + deps/nats.c/doc/html/search/groups_e.js | 5 + deps/nats.c/doc/html/search/mag.svg | 19 +- deps/nats.c/doc/html/search/mag_d.svg | 19 +- deps/nats.c/doc/html/search/mag_sel.svg | 53 +- deps/nats.c/doc/html/search/mag_seld.svg | 59 +- deps/nats.c/doc/html/search/pages_0.js | 3 +- deps/nats.c/doc/html/search/pages_2.js | 4 + deps/nats.c/doc/html/search/pages_3.js | 4 + deps/nats.c/doc/html/search/search.js | 30 +- deps/nats.c/doc/html/search/searchdata.js | 14 +- deps/nats.c/doc/html/search/typedefs_0.js | 22 +- deps/nats.c/doc/html/search/typedefs_2.js | 36 +- deps/nats.c/doc/html/search/typedefs_3.js | 29 +- deps/nats.c/doc/html/search/typedefs_4.js | 11 + deps/nats.c/doc/html/search/variables_0.js | 5 +- deps/nats.c/doc/html/search/variables_1.js | 2 +- deps/nats.c/doc/html/search/variables_10.js | 35 +- deps/nats.c/doc/html/search/variables_11.js | 5 +- deps/nats.c/doc/html/search/variables_12.js | 2 +- deps/nats.c/doc/html/search/variables_13.js | 4 + deps/nats.c/doc/html/search/variables_2.js | 20 +- deps/nats.c/doc/html/search/variables_3.js | 13 +- deps/nats.c/doc/html/search/variables_4.js | 31 +- deps/nats.c/doc/html/search/variables_5.js | 10 +- deps/nats.c/doc/html/search/variables_6.js | 7 +- deps/nats.c/doc/html/search/variables_7.js | 9 +- deps/nats.c/doc/html/search/variables_9.js | 15 +- deps/nats.c/doc/html/search/variables_a.js | 23 +- deps/nats.c/doc/html/search/variables_b.js | 12 +- deps/nats.c/doc/html/search/variables_c.js | 4 +- deps/nats.c/doc/html/search/variables_d.js | 8 +- deps/nats.c/doc/html/search/variables_f.js | 4 +- deps/nats.c/doc/html/status_8h.html | 12 +- deps/nats.c/doc/html/status_8h_source.html | 373 +- .../html/structjs_a_p_i_stats-members.html | 6 +- .../nats.c/doc/html/structjs_a_p_i_stats.html | 10 +- .../html/structjs_account_info-members.html | 6 +- .../doc/html/structjs_account_info.html | 24 +- .../html/structjs_account_limits-members.html | 6 +- .../doc/html/structjs_account_limits.html | 22 +- .../html/structjs_cluster_info-members.html | 6 +- .../doc/html/structjs_cluster_info.html | 14 +- .../structjs_consumer_config-members.html | 23 +- .../doc/html/structjs_consumer_config.html | 116 +- .../doc/html/structjs_consumer_config.js | 5 +- .../html/structjs_consumer_info-members.html | 6 +- .../doc/html/structjs_consumer_info.html | 30 +- .../structjs_consumer_info_list-members.html | 6 +- .../doc/html/structjs_consumer_info_list.html | 10 +- .../structjs_consumer_names_list-members.html | 6 +- .../html/structjs_consumer_names_list.html | 10 +- ...js_consumer_sequence_mismatch-members.html | 6 +- .../structjs_consumer_sequence_mismatch.html | 12 +- ...ructjs_direct_get_msg_options-members.html | 6 +- .../html/structjs_direct_get_msg_options.html | 12 +- .../structjs_external_stream-members.html | 6 +- .../doc/html/structjs_external_stream.html | 10 +- .../html/structjs_fetch_request-members.html | 6 +- .../doc/html/structjs_fetch_request.html | 16 +- .../structjs_lost_stream_data-members.html | 6 +- .../doc/html/structjs_lost_stream_data.html | 12 +- .../html/structjs_msg_meta_data-members.html | 6 +- .../doc/html/structjs_msg_meta_data.html | 20 +- .../doc/html/structjs_options-members.html | 6 +- deps/nats.c/doc/html/structjs_options.html | 16 +- ...s_1_1js_options_publish_async-members.html | 6 +- ...s_options_1_1js_options_publish_async.html | 18 +- ..._options_1_1js_options_stream-members.html | 6 +- ...structjs_options_1_1js_options_stream.html | 10 +- ...eam_1_1js_options_stream_info-members.html | 6 +- ...ions_stream_1_1js_options_stream_info.html | 10 +- ...am_1_1js_options_stream_purge-members.html | 6 +- ...ons_stream_1_1js_options_stream_purge.html | 12 +- .../doc/html/structjs_peer_info-members.html | 6 +- deps/nats.c/doc/html/structjs_peer_info.html | 16 +- .../doc/html/structjs_placement-members.html | 6 +- deps/nats.c/doc/html/structjs_placement.html | 12 +- .../doc/html/structjs_pub_ack-members.html | 6 +- deps/nats.c/doc/html/structjs_pub_ack.html | 14 +- .../html/structjs_pub_ack_err-members.html | 6 +- .../nats.c/doc/html/structjs_pub_ack_err.html | 14 +- .../html/structjs_pub_options-members.html | 6 +- .../nats.c/doc/html/structjs_pub_options.html | 20 +- .../doc/html/structjs_re_publish-members.html | 6 +- deps/nats.c/doc/html/structjs_re_publish.html | 12 +- .../html/structjs_sequence_info-members.html | 6 +- .../doc/html/structjs_sequence_info.html | 12 +- .../html/structjs_sequence_pair-members.html | 6 +- .../doc/html/structjs_sequence_pair.html | 10 +- .../structjs_stream_alternate-members.html | 6 +- .../doc/html/structjs_stream_alternate.html | 12 +- .../html/structjs_stream_config-members.html | 25 +- .../doc/html/structjs_stream_config.html | 156 +- .../nats.c/doc/html/structjs_stream_config.js | 7 +- ...ructjs_stream_consumer_limits-members.html | 114 + .../html/structjs_stream_consumer_limits.html | 157 + .../html/structjs_stream_consumer_limits.js | 5 + .../html/structjs_stream_info-members.html | 6 +- .../nats.c/doc/html/structjs_stream_info.html | 24 +- .../structjs_stream_info_list-members.html | 6 +- .../doc/html/structjs_stream_info_list.html | 10 +- .../structjs_stream_names_list-members.html | 6 +- .../doc/html/structjs_stream_names_list.html | 10 +- .../html/structjs_stream_source-members.html | 6 +- .../doc/html/structjs_stream_source.html | 18 +- .../structjs_stream_source_info-members.html | 13 +- .../doc/html/structjs_stream_source_info.html | 62 +- .../doc/html/structjs_stream_source_info.js | 5 +- .../html/structjs_stream_state-members.html | 6 +- .../doc/html/structjs_stream_state.html | 32 +- ...structjs_stream_state_subject-members.html | 6 +- .../html/structjs_stream_state_subject.html | 10 +- ...tructjs_stream_state_subjects-members.html | 6 +- .../html/structjs_stream_state_subjects.html | 10 +- .../html/structjs_sub_options-members.html | 6 +- .../nats.c/doc/html/structjs_sub_options.html | 18 +- ...ctjs_subject_transform_config-members.html | 114 + .../structjs_subject_transform_config.html | 157 + .../html/structjs_subject_transform_config.js | 5 + .../doc/html/structjs_tier-members.html | 6 +- deps/nats.c/doc/html/structjs_tier.html | 18 +- .../doc/html/structkv_config-members.html | 6 +- deps/nats.c/doc/html/structkv_config.html | 30 +- .../doc/html/structkv_entry_list-members.html | 6 +- deps/nats.c/doc/html/structkv_entry_list.html | 10 +- .../doc/html/structkv_keys_list-members.html | 6 +- deps/nats.c/doc/html/structkv_keys_list.html | 10 +- .../html/structkv_purge_options-members.html | 6 +- .../doc/html/structkv_purge_options.html | 10 +- .../html/structkv_watch_options-members.html | 6 +- .../doc/html/structkv_watch_options.html | 14 +- ...uctmicro__endpoint__config__s-members.html | 117 + .../structmicro__endpoint__config__s.html | 213 + .../html/structmicro__endpoint__config__s.js | 8 + ...tructmicro__endpoint__info__s-members.html | 115 + .../html/structmicro__endpoint__info__s.html | 176 + .../html/structmicro__endpoint__info__s.js | 6 + ...ructmicro__endpoint__stats__s-members.html | 120 + .../html/structmicro__endpoint__stats__s.html | 259 + .../html/structmicro__endpoint__stats__s.js | 11 + ...ructmicro__service__config__s-members.html | 121 + .../html/structmicro__service__config__s.html | 287 + .../html/structmicro__service__config__s.js | 12 + ...structmicro__service__info__s-members.html | 120 + .../html/structmicro__service__info__s.html | 261 + .../doc/html/structmicro__service__info__s.js | 11 + ...tructmicro__service__stats__s-members.html | 119 + .../html/structmicro__service__stats__s.html | 244 + .../html/structmicro__service__stats__s.js | 10 + .../doc/html/structnats_metadata-members.html | 114 + deps/nats.c/doc/html/structnats_metadata.html | 160 + deps/nats.c/doc/html/structnats_metadata.js | 5 + .../doc/html/structnats_msg_list-members.html | 6 +- deps/nats.c/doc/html/structnats_msg_list.html | 10 +- deps/nats.c/doc/html/topics.html | 161 + deps/nats.c/doc/html/topics.js | 11 + deps/nats.c/examples/examples.h | 3 +- deps/nats.c/examples/micro-arithmetics.c | 147 + deps/nats.c/examples/micro-func.c | 229 + deps/nats.c/examples/micro-hello.c | 93 + deps/nats.c/examples/micro-sequence.c | 191 + deps/nats.c/examples/micro-stats.c | 152 + deps/nats.c/src/asynccb.c | 14 +- deps/nats.c/src/conn.c | 70 +- deps/nats.c/src/crypto.c | 6 +- deps/nats.c/src/include/n-unix.h | 2 + deps/nats.c/src/include/n-win.h | 2 + deps/nats.c/src/js.c | 28 +- deps/nats.c/src/js.h | 3 + deps/nats.c/src/jsm.c | 238 +- deps/nats.c/src/micro.c | 912 ++++ deps/nats.c/src/micro_args.c | 355 ++ deps/nats.c/src/micro_args.h | 43 + deps/nats.c/src/micro_client.c | 66 + deps/nats.c/src/micro_endpoint.c | 432 ++ deps/nats.c/src/micro_error.c | 233 + deps/nats.c/src/micro_monitoring.c | 352 ++ deps/nats.c/src/micro_request.c | 201 + deps/nats.c/src/microp.h | 185 + deps/nats.c/src/nats.c | 62 +- deps/nats.c/src/nats.h | 1332 ++++- deps/nats.c/src/natsp.h | 26 + deps/nats.c/src/opts.c | 13 + deps/nats.c/src/opts.h | 13 + deps/nats.c/src/pub.c | 6 +- deps/nats.c/src/util.c | 279 +- deps/nats.c/src/util.h | 19 +- deps/nats.c/src/version.h | 8 +- deps/nats.c/test/list.txt | 9 + deps/nats.c/test/test.c | 1603 +++++- 404 files changed, 22910 insertions(+), 6116 deletions(-) create mode 100644 deps/nats.c/.github/ISSUE_TEMPLATE/config.yml create mode 100644 deps/nats.c/.github/ISSUE_TEMPLATE/defect.yml create mode 100644 deps/nats.c/.github/ISSUE_TEMPLATE/proposal.yml mode change 100644 => 100755 deps/nats.c/doc/html/customdoxygen.css create mode 100644 deps/nats.c/doc/html/doc.svg create mode 100644 deps/nats.c/doc/html/docd.svg create mode 100644 deps/nats.c/doc/html/folderclosed.svg create mode 100644 deps/nats.c/doc/html/folderclosedd.svg create mode 100644 deps/nats.c/doc/html/folderopen.svg create mode 100644 deps/nats.c/doc/html/folderopend.svg create mode 100644 deps/nats.c/doc/html/functions_v.html create mode 100644 deps/nats.c/doc/html/functions_vars_v.html create mode 100644 deps/nats.c/doc/html/globals_func_m.html create mode 100644 deps/nats.c/doc/html/globals_m.html create mode 100644 deps/nats.c/doc/html/group__micro_callbacks.html create mode 100644 deps/nats.c/doc/html/group__micro_callbacks.js create mode 100644 deps/nats.c/doc/html/group__micro_cleanup_functions.html create mode 100644 deps/nats.c/doc/html/group__micro_cleanup_functions.js create mode 100644 deps/nats.c/doc/html/group__micro_client_functions.html create mode 100644 deps/nats.c/doc/html/group__micro_client_functions.js create mode 100644 deps/nats.c/doc/html/group__micro_constants.html create mode 100644 deps/nats.c/doc/html/group__micro_constants.js create mode 100644 deps/nats.c/doc/html/group__micro_error_functions.html create mode 100644 deps/nats.c/doc/html/group__micro_error_functions.js create mode 100644 deps/nats.c/doc/html/group__micro_functions.html create mode 100644 deps/nats.c/doc/html/group__micro_functions.js create mode 100644 deps/nats.c/doc/html/group__micro_group.html create mode 100644 deps/nats.c/doc/html/group__micro_group.js create mode 100644 deps/nats.c/doc/html/group__micro_group_functions.html create mode 100644 deps/nats.c/doc/html/group__micro_group_functions.js create mode 100644 deps/nats.c/doc/html/group__micro_request_functions.html create mode 100644 deps/nats.c/doc/html/group__micro_request_functions.js create mode 100644 deps/nats.c/doc/html/group__micro_service_functions.html create mode 100644 deps/nats.c/doc/html/group__micro_service_functions.js create mode 100644 deps/nats.c/doc/html/group__micro_structs.html create mode 100644 deps/nats.c/doc/html/group__micro_structs.js create mode 100644 deps/nats.c/doc/html/group__micro_types.html create mode 100644 deps/nats.c/doc/html/group__micro_types.js create mode 100644 deps/nats.c/doc/html/minus.svg create mode 100644 deps/nats.c/doc/html/minusd.svg create mode 100644 deps/nats.c/doc/html/plus.svg create mode 100644 deps/nats.c/doc/html/plusd.svg create mode 100644 deps/nats.c/doc/html/search/all_15.js create mode 100644 deps/nats.c/doc/html/search/classes_3.js create mode 100644 deps/nats.c/doc/html/search/functions_4.js create mode 100644 deps/nats.c/doc/html/search/groups_d.js create mode 100644 deps/nats.c/doc/html/search/groups_e.js create mode 100644 deps/nats.c/doc/html/search/pages_2.js create mode 100644 deps/nats.c/doc/html/search/pages_3.js create mode 100644 deps/nats.c/doc/html/search/typedefs_4.js create mode 100644 deps/nats.c/doc/html/search/variables_13.js create mode 100644 deps/nats.c/doc/html/structjs_stream_consumer_limits-members.html create mode 100644 deps/nats.c/doc/html/structjs_stream_consumer_limits.html create mode 100644 deps/nats.c/doc/html/structjs_stream_consumer_limits.js create mode 100644 deps/nats.c/doc/html/structjs_subject_transform_config-members.html create mode 100644 deps/nats.c/doc/html/structjs_subject_transform_config.html create mode 100644 deps/nats.c/doc/html/structjs_subject_transform_config.js create mode 100644 deps/nats.c/doc/html/structmicro__endpoint__config__s-members.html create mode 100644 deps/nats.c/doc/html/structmicro__endpoint__config__s.html create mode 100644 deps/nats.c/doc/html/structmicro__endpoint__config__s.js create mode 100644 deps/nats.c/doc/html/structmicro__endpoint__info__s-members.html create mode 100644 deps/nats.c/doc/html/structmicro__endpoint__info__s.html create mode 100644 deps/nats.c/doc/html/structmicro__endpoint__info__s.js create mode 100644 deps/nats.c/doc/html/structmicro__endpoint__stats__s-members.html create mode 100644 deps/nats.c/doc/html/structmicro__endpoint__stats__s.html create mode 100644 deps/nats.c/doc/html/structmicro__endpoint__stats__s.js create mode 100644 deps/nats.c/doc/html/structmicro__service__config__s-members.html create mode 100644 deps/nats.c/doc/html/structmicro__service__config__s.html create mode 100644 deps/nats.c/doc/html/structmicro__service__config__s.js create mode 100644 deps/nats.c/doc/html/structmicro__service__info__s-members.html create mode 100644 deps/nats.c/doc/html/structmicro__service__info__s.html create mode 100644 deps/nats.c/doc/html/structmicro__service__info__s.js create mode 100644 deps/nats.c/doc/html/structmicro__service__stats__s-members.html create mode 100644 deps/nats.c/doc/html/structmicro__service__stats__s.html create mode 100644 deps/nats.c/doc/html/structmicro__service__stats__s.js create mode 100644 deps/nats.c/doc/html/structnats_metadata-members.html create mode 100644 deps/nats.c/doc/html/structnats_metadata.html create mode 100644 deps/nats.c/doc/html/structnats_metadata.js create mode 100644 deps/nats.c/doc/html/topics.html create mode 100644 deps/nats.c/doc/html/topics.js create mode 100644 deps/nats.c/examples/micro-arithmetics.c create mode 100644 deps/nats.c/examples/micro-func.c create mode 100644 deps/nats.c/examples/micro-hello.c create mode 100644 deps/nats.c/examples/micro-sequence.c create mode 100644 deps/nats.c/examples/micro-stats.c create mode 100644 deps/nats.c/src/micro.c create mode 100644 deps/nats.c/src/micro_args.c create mode 100644 deps/nats.c/src/micro_args.h create mode 100644 deps/nats.c/src/micro_client.c create mode 100644 deps/nats.c/src/micro_endpoint.c create mode 100644 deps/nats.c/src/micro_error.c create mode 100644 deps/nats.c/src/micro_monitoring.c create mode 100644 deps/nats.c/src/micro_request.c create mode 100644 deps/nats.c/src/microp.h diff --git a/deps/nats.c/.github/ISSUE_TEMPLATE/config.yml b/deps/nats.c/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..c6c4224 --- /dev/null +++ b/deps/nats.c/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Discussion + url: https://github.com/nats-io/nats.c/discussions + about: Ideal for ideas, feedback, or longer form questions. + - name: Chat + url: https://slack.nats.io + about: Ideal for short, one-off questions, general conversation, and meeting other NATS users! diff --git a/deps/nats.c/.github/ISSUE_TEMPLATE/defect.yml b/deps/nats.c/.github/ISSUE_TEMPLATE/defect.yml new file mode 100644 index 0000000..99b4800 --- /dev/null +++ b/deps/nats.c/.github/ISSUE_TEMPLATE/defect.yml @@ -0,0 +1,41 @@ +--- +name: Defect +description: Report a defect, such as a bug or regression. +labels: + - defect +body: + - type: textarea + id: versions + attributes: + label: What version were you using? + description: Include the server version (`nats-server --version`) and any client versions when observing the issue. + validations: + required: true + - type: textarea + id: environment + attributes: + label: What environment was the server running in? + description: This pertains to the operating system, CPU architecture, and/or Docker image that was used. + validations: + required: true + - type: textarea + id: steps + attributes: + label: Is this defect reproducible? + description: Provide best-effort steps to showcase the defect. + validations: + required: true + - type: textarea + id: expected + attributes: + label: Given the capability you are leveraging, describe your expectation? + description: This may be the expected behavior or performance characteristics. + validations: + required: true + - type: textarea + id: actual + attributes: + label: Given the expectation, what is the defect you are observing? + description: This may be an unexpected behavior or regression in performance. + validations: + required: true diff --git a/deps/nats.c/.github/ISSUE_TEMPLATE/proposal.yml b/deps/nats.c/.github/ISSUE_TEMPLATE/proposal.yml new file mode 100644 index 0000000..d7da0ca --- /dev/null +++ b/deps/nats.c/.github/ISSUE_TEMPLATE/proposal.yml @@ -0,0 +1,34 @@ +--- +name: Proposal +description: Propose an enhancement or new feature. +labels: + - proposal +body: + - type: textarea + id: usecase + attributes: + label: What motivated this proposal? + description: Describe the use case justifying this request. + validations: + required: true + - type: textarea + id: change + attributes: + label: What is the proposed change? + description: This could be a behavior change, enhanced API, or a branch new feature. + validations: + required: true + - type: textarea + id: benefits + attributes: + label: Who benefits from this change? + description: Describe how this not only benefits you. + validations: + required: false + - type: textarea + id: alternates + attributes: + label: What alternatives have you evaluated? + description: This could be using existing features or relying on an external dependency. + validations: + required: false diff --git a/deps/nats.c/.gitignore b/deps/nats.c/.gitignore index f452f0d..fdedaff 100644 --- a/deps/nats.c/.gitignore +++ b/deps/nats.c/.gitignore @@ -10,6 +10,8 @@ cmake-build*/ install/ html/ !doc/html/ +test/datastore_*/ +test/conf_* # Emacs *~ diff --git a/deps/nats.c/.gitrepo b/deps/nats.c/.gitrepo index 3ba9c21..3fe6bed 100644 --- a/deps/nats.c/.gitrepo +++ b/deps/nats.c/.gitrepo @@ -5,8 +5,8 @@ ; [subrepo] remote = https://github.com/nats-io/nats.c.git - branch = v3.6.1 - commit = 66cec7fce9a64f911015f0c516a086c1a74cd22a - parent = 5bc936a09f065123793cfc741a08d2129f691d48 + branch = v3.7.0 + commit = 5d057f66f897279975f1c8eb61c1ccaaf1a7ae01 + parent = 136ef10775a087317c20d6c78fbb6f5c072d1308 method = merge cmdver = 0.4.6 diff --git a/deps/nats.c/.travis.yml b/deps/nats.c/.travis.yml index 2bfb188..999d017 100644 --- a/deps/nats.c/.travis.yml +++ b/deps/nats.c/.travis.yml @@ -1,5 +1,5 @@ language: cpp -dist: bionic +dist: focal os: linux cache: @@ -25,6 +25,34 @@ env: jobs: include: + - name: "NATS server - latest release" + compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - sourceline: ppa:ubuntu-toolchain-r/test + packages: + - g++-9 + env: + - NATS_TEST_SERVER_VERSION=latest + - MATRIX_EVAL="CC=gcc-9" + - BUILD_OPT="-DNATS_BUILD_ARCH=64 -DCMAKE_BUILD_TYPE=Release" DO_COVERAGE="no" + + - name: "NATS server - main" + compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - sourceline: ppa:ubuntu-toolchain-r/test + packages: + - g++-9 + env: + - NATS_TEST_SERVER_VERSION=main + - MATRIX_EVAL="CC=gcc-9" + - BUILD_OPT="-DNATS_BUILD_ARCH=64 -DCMAKE_BUILD_TYPE=Release" DO_COVERAGE="no" + - name: "gcc-9 - TLS OFF" compiler: gcc addons: @@ -62,7 +90,7 @@ jobs: - g++-9 env: - MATRIX_EVAL="CC=gcc-9" - - BUILD_OPT="-DNATS_BUILD_ARCH=64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fsanitize=address" NATS_TEST_VALGRIND=yes DO_COVERAGE="no" + - BUILD_OPT="-DNATS_BUILD_ARCH=64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-fsanitize=address" NATS_TEST_VALGRIND=yes DO_COVERAGE="no" - name: "gcc-9 - Lib msg delivery - sanitize address" compiler: gcc @@ -75,7 +103,7 @@ jobs: - g++-9 env: - MATRIX_EVAL="CC=gcc-9" - - NATS_DEFAULT_TO_LIB_MSG_DELIVERY=yes BUILD_OPT="-DNATS_BUILD_ARCH=64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fsanitize=address" NATS_TEST_VALGRIND=yes DO_COVERAGE="no" + - NATS_DEFAULT_TO_LIB_MSG_DELIVERY=yes BUILD_OPT="-DNATS_BUILD_ARCH=64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-fsanitize=address" NATS_TEST_VALGRIND=yes DO_COVERAGE="no" - name: "gcc-9 - Write deadline - sanitize address" compiler: gcc @@ -101,7 +129,7 @@ jobs: - g++-9 env: - MATRIX_EVAL="CC=gcc-9" - - BUILD_OPT="-DNATS_BUILD_ARCH=64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fsanitize=thread" DO_COVERAGE="no" + - BUILD_OPT="-DNATS_BUILD_ARCH=64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fsanitize=thread" NATS_TEST_VALGRIND=yes DO_COVERAGE="no" - name: "clang-8 - TLS OFF" compiler: clang diff --git a/deps/nats.c/CMakeLists.txt b/deps/nats.c/CMakeLists.txt index d2a5d22..a3d7ff6 100644 --- a/deps/nats.c/CMakeLists.txt +++ b/deps/nats.c/CMakeLists.txt @@ -236,11 +236,11 @@ endif(NATS_BUILD_WITH_TLS) # Versionning and Doc set(NATS_VERSION_MAJOR 3) -set(NATS_VERSION_MINOR 6) -set(NATS_VERSION_PATCH 1) +set(NATS_VERSION_MINOR 7) +set(NATS_VERSION_PATCH 0) set(NATS_VERSION_SUFFIX "") -set(NATS_VERSION_REQUIRED_NUMBER 0x030600) +set(NATS_VERSION_REQUIRED_NUMBER 0x030700) if(NATS_UPDATE_VERSION OR NATS_UPDATE_DOC) configure_file( diff --git a/deps/nats.c/README.md b/deps/nats.c/README.md index a236102..c96fd8a 100644 --- a/deps/nats.c/README.md +++ b/deps/nats.c/README.md @@ -9,7 +9,7 @@ This NATS Client implementation is heavily based on the [NATS GO Client](https:/ [![License Apache 2](https://img.shields.io/badge/License-Apache2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Build Status](https://travis-ci.com/nats-io/nats.c.svg?branch=main)](https://travis-ci.com/github/nats-io/nats.c) [![Coverage Status](https://coveralls.io/repos/github/nats-io/nats.c/badge.svg?branch=main)](https://coveralls.io/github/nats-io/nats.c?branch=main) -[![Release](https://img.shields.io/badge/release-v3.6.1-blue.svg?style=flat)](https://github.com/nats-io/nats.c/releases/tag/v3.6.1) +[![Release](https://img.shields.io/badge/release-v3.7.0-blue.svg?style=flat)](https://github.com/nats-io/nats.c/releases/tag/v3.7.0) [![Documentation](https://img.shields.io/badge/doc-Doxygen-brightgreen.svg?style=flat)](http://nats-io.github.io/nats.c) # Table of Contents diff --git a/deps/nats.c/buildOnTravis.sh b/deps/nats.c/buildOnTravis.sh index afe4912..fbfe5e2 100755 --- a/deps/nats.c/buildOnTravis.sh +++ b/deps/nats.c/buildOnTravis.sh @@ -10,6 +10,23 @@ echo "coverage = " $2 echo "build opts = " $3 echo "test opts = " $4 +if [ "$NATS_TEST_SERVER_VERSION" != "" ]; then + rel=$NATS_TEST_SERVER_VERSION + mkdir -p $HOME/nats-server-$rel + if [ "$rel" = "latest" ]; then + rel=$(curl -s https://api.github.com/repos/nats-io/nats-server/releases/latest | jq -r '.tag_name') + fi + + if [ "$rel" != "${rel#v}" ] && wget https://github.com/nats-io/nats-server/releases/download/$rel/nats-server-$rel-linux-amd64.tar.gz; then + tar -xzf nats-server-$rel-linux-amd64.tar.gz + mv nats-server-$rel-linux-amd64 $HOME/nats-server-$rel + else + curl -sf "https://binaries.nats.dev/nats-io/nats-server/v2@$rel" | PREFIX=. sh + mv nats-server $HOME/nats-server-$rel + fi + PATH=$HOME/nats-server-$rel:$PATH +fi + if [ "$1" != "gcc" ]; then if [ "$2" = "coverage" ]; then # only coverage for gcc compiler @@ -35,8 +52,10 @@ res=$? if [ $res -ne 0 ]; then exit $res fi -export NATS_TEST_SERVER_VERSION="$(nats-server -v)" + export NATS_TEST_TRAVIS=yes +export NATS_TEST_SERVER_VERSION="$(nats-server -v)" +echo "Using NATS server version: $NATS_TEST_SERVER_VERSION" ctest --timeout 60 --output-on-failure $4 res=$? if [ $res -ne 0 ]; then diff --git a/deps/nats.c/doc/DoxyFile.NATS.Client b/deps/nats.c/doc/DoxyFile.NATS.Client index f8dd88b..e562556 100644 --- a/deps/nats.c/doc/DoxyFile.NATS.Client +++ b/deps/nats.c/doc/DoxyFile.NATS.Client @@ -48,7 +48,7 @@ PROJECT_NAME = NATS C Client with JetStream and Streaming support # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 3.6.1 +PROJECT_NUMBER = 3.7.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/deps/nats.c/doc/html/annotated.html b/deps/nats.c/doc/html/annotated.html index 8f689aa..819944b 100644 --- a/deps/nats.c/doc/html/annotated.html +++ b/deps/nats.c/doc/html/annotated.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Class List @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- v -

+
+
+ + + + + diff --git a/deps/nats.c/doc/html/functions_vars.html b/deps/nats.c/doc/html/functions_vars.html index 2ba2345..e6cbc8f 100644 --- a/deps/nats.c/doc/html/functions_vars.html +++ b/deps/nats.c/doc/html/functions_vars.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Class Members - Variables @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- v -

+
+
+ + + + + diff --git a/deps/nats.c/doc/html/functions_vars_w.html b/deps/nats.c/doc/html/functions_vars_w.html index d94a189..0745732 100644 --- a/deps/nats.c/doc/html/functions_vars_w.html +++ b/deps/nats.c/doc/html/functions_vars_w.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Class Members - Variables @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the files they belong to:
+ +

- m -

    +
  • micro_AddService() : nats.h
  • +
  • micro_Errorf() : nats.h
  • +
  • micro_ErrorfCode() : nats.h
  • +
  • micro_ErrorFromStatus() : nats.h
  • +
  • micro_NewClient() : nats.h
  • +
  • microClient_Destroy() : nats.h
  • +
  • microClient_DoRequest() : nats.h
  • +
  • microError_Code() : nats.h
  • +
  • microError_Destroy() : nats.h
  • +
  • microError_Status() : nats.h
  • +
  • microError_String() : nats.h
  • +
  • microError_Wrapf() : nats.h
  • +
  • microGroup_AddEndpoint() : nats.h
  • +
  • microGroup_AddGroup() : nats.h
  • +
  • microRequest_AddHeader() : nats.h
  • +
  • microRequest_DeleteHeader() : nats.h
  • +
  • microRequest_GetConnection() : nats.h
  • +
  • microRequest_GetData() : nats.h
  • +
  • microRequest_GetDataLength() : nats.h
  • +
  • microRequest_GetEndpointState() : nats.h
  • +
  • microRequest_GetHeaderKeys() : nats.h
  • +
  • microRequest_GetHeaderValue() : nats.h
  • +
  • microRequest_GetHeaderValues() : nats.h
  • +
  • microRequest_GetMsg() : nats.h
  • +
  • microRequest_GetReply() : nats.h
  • +
  • microRequest_GetService() : nats.h
  • +
  • microRequest_GetServiceState() : nats.h
  • +
  • microRequest_GetSubject() : nats.h
  • +
  • microRequest_Respond() : nats.h
  • +
  • microRequest_RespondCustom() : nats.h
  • +
  • microRequest_RespondError() : nats.h
  • +
  • microRequest_SetHeader() : nats.h
  • +
  • microService_AddEndpoint() : nats.h
  • +
  • microService_AddGroup() : nats.h
  • +
  • microService_Destroy() : nats.h
  • +
  • microService_GetConnection() : nats.h
  • +
  • microService_GetInfo() : nats.h
  • +
  • microService_GetState() : nats.h
  • +
  • microService_GetStats() : nats.h
  • +
  • microService_IsStopped() : nats.h
  • +
  • microService_Run() : nats.h
  • +
  • microService_Stop() : nats.h
  • +
  • microServiceInfo_Destroy() : nats.h
  • +
  • microServiceStats_Destroy() : nats.h
  • +
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/globals_func_n.html b/deps/nats.c/doc/html/globals_func_n.html index e5be09d..6141ffb 100644 --- a/deps/nats.c/doc/html/globals_func_n.html +++ b/deps/nats.c/doc/html/globals_func_n.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: File Members @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all file members with links to the files they belong to:
+ +

- m -

    +
  • micro_AddService() : nats.h
  • +
  • MICRO_API_PREFIX : nats.h
  • +
  • MICRO_ERROR_CODE_HDR : nats.h
  • +
  • MICRO_ERROR_HDR : nats.h
  • +
  • micro_Errorf() : nats.h
  • +
  • micro_ErrorfCode() : nats.h
  • +
  • micro_ErrorFromStatus() : nats.h
  • +
  • MICRO_INFO_RESPONSE_TYPE : nats.h
  • +
  • MICRO_INFO_VERB : nats.h
  • +
  • micro_NewClient() : nats.h
  • +
  • MICRO_PING_RESPONSE_TYPE : nats.h
  • +
  • MICRO_PING_VERB : nats.h
  • +
  • MICRO_STATS_RESPONSE_TYPE : nats.h
  • +
  • MICRO_STATS_VERB : nats.h
  • +
  • MICRO_STATUS_HDR : nats.h
  • +
  • microClient : nats.h
  • +
  • microClient_Destroy() : nats.h
  • +
  • microClient_DoRequest() : nats.h
  • +
  • microClientConfig : nats.h
  • +
  • microDoneHandler : nats.h
  • +
  • microEndpoint : nats.h
  • +
  • microEndpointConfig : nats.h
  • +
  • microEndpointInfo : nats.h
  • +
  • microEndpointStats : nats.h
  • +
  • microError : nats.h
  • +
  • microError_Code() : nats.h
  • +
  • microError_Destroy() : nats.h
  • +
  • microError_Ignore : nats.h
  • +
  • microError_Status() : nats.h
  • +
  • microError_String() : nats.h
  • +
  • microError_Wrapf() : nats.h
  • +
  • microErrorHandler : nats.h
  • +
  • microGroup : nats.h
  • +
  • microGroup_AddEndpoint() : nats.h
  • +
  • microGroup_AddGroup() : nats.h
  • +
  • microRequest : nats.h
  • +
  • microRequest_AddHeader() : nats.h
  • +
  • microRequest_DeleteHeader() : nats.h
  • +
  • microRequest_GetConnection() : nats.h
  • +
  • microRequest_GetData() : nats.h
  • +
  • microRequest_GetDataLength() : nats.h
  • +
  • microRequest_GetEndpointState() : nats.h
  • +
  • microRequest_GetHeaderKeys() : nats.h
  • +
  • microRequest_GetHeaderValue() : nats.h
  • +
  • microRequest_GetHeaderValues() : nats.h
  • +
  • microRequest_GetMsg() : nats.h
  • +
  • microRequest_GetReply() : nats.h
  • +
  • microRequest_GetService() : nats.h
  • +
  • microRequest_GetServiceState() : nats.h
  • +
  • microRequest_GetSubject() : nats.h
  • +
  • microRequest_Respond() : nats.h
  • +
  • microRequest_RespondCustom() : nats.h
  • +
  • microRequest_RespondError() : nats.h
  • +
  • microRequest_SetHeader() : nats.h
  • +
  • microRequestHandler : nats.h
  • +
  • microService : nats.h
  • +
  • microService_AddEndpoint() : nats.h
  • +
  • microService_AddGroup() : nats.h
  • +
  • microService_Destroy() : nats.h
  • +
  • microService_GetConnection() : nats.h
  • +
  • microService_GetInfo() : nats.h
  • +
  • microService_GetState() : nats.h
  • +
  • microService_GetStats() : nats.h
  • +
  • microService_IsStopped() : nats.h
  • +
  • microService_Run() : nats.h
  • +
  • microService_Stop() : nats.h
  • +
  • microServiceConfig : nats.h
  • +
  • microServiceInfo : nats.h
  • +
  • microServiceInfo_Destroy() : nats.h
  • +
  • microServiceStats : nats.h
  • +
  • microServiceStats_Destroy() : nats.h
  • +
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/globals_n.html b/deps/nats.c/doc/html/globals_n.html index 97e23a6..972bc23 100644 --- a/deps/nats.c/doc/html/globals_n.html +++ b/deps/nats.c/doc/html/globals_n.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: File Members @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + +

+Typedefs

typedef microError *(* microRequestHandler) (microRequest *req)
 Callback type for request processing.
 
typedef void(* microErrorHandler) (microService *m, microEndpoint *ep, natsStatus s)
 Callback type for async error notifications.
 
typedef void(* microDoneHandler) (microService *m)
 Callback type for Done (service stopped) notifications.
 
+

Detailed Description

+

Microservice callbacks.

+

Typedef Documentation

+ +

◆ microRequestHandler

+ +
+
+ + + + +
typedef microError *(* microRequestHandler) (microRequest *req)
+
+

This is the callback that one provides when creating a microservice endpoint. The library will invoke this callback for each message arriving to the specified subject.

+
Parameters
+ + +
reqThe request object, containing the message and other relevant references.
+
+
+
See also
microEndpointConfig, micro_endpoint_config_s.
+ +
+
+ +

◆ microErrorHandler

+ +
+
+ + + + +
typedef void(* microErrorHandler) (microService *m, microEndpoint *ep, natsStatus s)
+
+

If specified in microServiceConfig, this callback is invoked for internal errors (e.g. message delivery failures) related to a microservice. If the error is associated with an endpoint, the ep parameter points at the endpoint. However, this handler may be invoked for errors happening in monitoring subjects, in which case ep is NULL.

+

The error handler is invoked asynchronously, in a separate theread.

+

The error handler is not invoked for microservice-level errors that are sent back to the client as responses. Note that the error counts in microEndpointStats include both internal and service-level errors.

+
Parameters
+ + + + +
mThe microservice object.
epThe endpoint object, or NULL if the error is not associated with an endpoint.
sThe NATS status for the error.
+
+
+
See also
microServiceConfig, micro_service_config_s.
+ +
+
+ +

◆ microDoneHandler

+ +
+
+ + + + +
typedef void(* microDoneHandler) (microService *m)
+
+

If specified in microServiceConfig, this callback is invoked right after the service stops. In the C client, this callback is invoked directly from the microService_Stop function, in whatever thread is executing it.

+
Parameters
+ + +
mThe microservice object.
+
+
+
See also
microServiceConfig, micro_service_config_s.
+ +
+
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_callbacks.js b/deps/nats.c/doc/html/group__micro_callbacks.js new file mode 100644 index 0000000..1fb6b9b --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_callbacks.js @@ -0,0 +1,6 @@ +var group__micro_callbacks = +[ + [ "microRequestHandler", "group__micro_callbacks.html#gab465a9b31672c63738e8f6b0a61c2e90", null ], + [ "microErrorHandler", "group__micro_callbacks.html#ga7a40fbbb9b1102f0a7679f9dfcf6c0d6", null ], + [ "microDoneHandler", "group__micro_callbacks.html#gae0341a98388ffd1094472d2ced36d840", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_cleanup_functions.html b/deps/nats.c/doc/html/group__micro_cleanup_functions.html new file mode 100644 index 0000000..9f7946c --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_cleanup_functions.html @@ -0,0 +1,172 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Miscellaneous + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + +

+Functions

NATS_EXTERN void microServiceInfo_Destroy (microServiceInfo *info)
 Destroys a microServiceInfo object.
 
NATS_EXTERN void microServiceStats_Destroy (microServiceStats *stats)
 Destroys a microServiceStats object.
 
+

Detailed Description

+

Functions to destroy miscellaneous objects.

+

Function Documentation

+ +

◆ microServiceInfo_Destroy()

+ +
+
+ + + + + + + + +
NATS_EXTERN void microServiceInfo_Destroy (microServiceInfoinfo)
+
+
Parameters
+ + +
infothe object to destroy.
+
+
+ +
+
+ +

◆ microServiceStats_Destroy()

+ +
+
+ + + + + + + + +
NATS_EXTERN void microServiceStats_Destroy (microServiceStatsstats)
+
+
Parameters
+ + +
statsthe object to destroy.
+
+
+ +
+
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_cleanup_functions.js b/deps/nats.c/doc/html/group__micro_cleanup_functions.js new file mode 100644 index 0000000..e93553e --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_cleanup_functions.js @@ -0,0 +1,5 @@ +var group__micro_cleanup_functions = +[ + [ "microServiceInfo_Destroy", "group__micro_cleanup_functions.html#ga9b4756ed693ce4fc0f06375aa0d3d54c", null ], + [ "microServiceStats_Destroy", "group__micro_cleanup_functions.html#gaabcbf8378e6221eea78493a26576c8ce", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_client_functions.html b/deps/nats.c/doc/html/group__micro_client_functions.html new file mode 100644 index 0000000..70b5c56 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_client_functions.html @@ -0,0 +1,250 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: microClient + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + +

+Functions

NATS_EXTERN microErrormicro_NewClient (microClient **new_client, natsConnection *nc, microClientConfig *cfg)
 Creates a new microservice client.
 
NATS_EXTERN void microClient_Destroy (microClient *client)
 Destroys a microservice client.
 
NATS_EXTERN microErrormicroClient_DoRequest (natsMsg **reply, microClient *client, const char *subject, const char *data, int data_len)
 Sends a request to a microservice and receives the response.
 
+

Detailed Description

+

Function Documentation

+ +

◆ micro_NewClient()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * micro_NewClient (microClient ** new_client,
natsConnectionnc,
microClientConfigcfg 
)
+
+
Parameters
+ + + + +
new_clientreceived the pointer to the new client.
nca NATS connection.
cfgfor future use, use NULL for now.
+
+
+
Returns
a microError if an error occurred.
+ +
+
+ +

◆ microClient_Destroy()

+ +
+
+ + + + + + + + +
NATS_EXTERN void microClient_Destroy (microClientclient)
+
+
Parameters
+ + +
clientthe client to destroy.
+
+
+ +
+
+ +

◆ microClient_DoRequest()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microClient_DoRequest (natsMsg ** reply,
microClientclient,
const char * subject,
const char * data,
int data_len 
)
+
+
Parameters
+ + + + + + +
replyreceives the pointer to the response NATS message. reply must be freed with natsMsg_Destroy.
clientthe client to use.
subjectthe subject to send the request on.
datathe request data.
data_lenthe request data length.
+
+
+
Returns
a microError if an error occurred.
+ +
+
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_client_functions.js b/deps/nats.c/doc/html/group__micro_client_functions.js new file mode 100644 index 0000000..cd30ea2 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_client_functions.js @@ -0,0 +1,6 @@ +var group__micro_client_functions = +[ + [ "micro_NewClient", "group__micro_client_functions.html#ga191be60c4f9bb88f83f73b5ce4e5e0bd", null ], + [ "microClient_Destroy", "group__micro_client_functions.html#ga62a528edb67328bd7c478b6338656e1a", null ], + [ "microClient_DoRequest", "group__micro_client_functions.html#gac3be6a03f5846ac1bb06f091bea36a99", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_constants.html b/deps/nats.c/doc/html/group__micro_constants.html new file mode 100644 index 0000000..06d2fa9 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_constants.html @@ -0,0 +1,289 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Public constants + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define MICRO_API_PREFIX   "$SRV"
 The prefix for all microservice monitoring subjects.
 
#define MICRO_INFO_RESPONSE_TYPE   "io.nats.micro.v1.info_response"
 The type set in the $SRV.INFO responses.
 
#define MICRO_INFO_VERB   "INFO"
 For $SRV.INFO.* subjects.
 
#define MICRO_PING_RESPONSE_TYPE   "io.nats.micro.v1.ping_response"
 The type set in the $SRV.PING response.
 
#define MICRO_PING_VERB   "PING"
 For $SRV.PING subjects.
 
#define MICRO_STATS_RESPONSE_TYPE   "io.nats.micro.v1.stats_response"
 The type set in the STATS response.
 
#define MICRO_STATS_VERB   "STATS"
 The "verb" used in $SRV.STATS subjects.
 
#define MICRO_STATUS_HDR   "Nats-Status"
 The response message header used to communicate an erroneous NATS status back to the requestor.
 
#define MICRO_ERROR_HDR   "Nats-Service-Error"
 The response message header used to communicate an error message back to the requestor.
 
#define MICRO_ERROR_CODE_HDR   "Nats-Service-Error-Code"
 The response message header used to communicate an integer error code back to the requestor.
 
+

Detailed Description

+

Microservice public constants.

+

Macro Definition Documentation

+ +

◆ MICRO_API_PREFIX

+ +
+
+ + + + +
#define MICRO_API_PREFIX   "$SRV"
+
+

For example, "$SRV.PING".

+ +
+
+ +

◆ MICRO_INFO_RESPONSE_TYPE

+ +
+
+ + + + +
#define MICRO_INFO_RESPONSE_TYPE   "io.nats.micro.v1.info_response"
+
+ +
+
+ +

◆ MICRO_INFO_VERB

+ +
+
+ + + + +
#define MICRO_INFO_VERB   "INFO"
+
+ +
+
+ +

◆ MICRO_PING_RESPONSE_TYPE

+ +
+
+ + + + +
#define MICRO_PING_RESPONSE_TYPE   "io.nats.micro.v1.ping_response"
+
+ +
+
+ +

◆ MICRO_PING_VERB

+ +
+
+ + + + +
#define MICRO_PING_VERB   "PING"
+
+ +
+
+ +

◆ MICRO_STATS_RESPONSE_TYPE

+ +
+
+ + + + +
#define MICRO_STATS_RESPONSE_TYPE   "io.nats.micro.v1.stats_response"
+
+ +
+
+ +

◆ MICRO_STATS_VERB

+ +
+
+ + + + +
#define MICRO_STATS_VERB   "STATS"
+
+ +
+
+ +

◆ MICRO_STATUS_HDR

+ +
+
+ + + + +
#define MICRO_STATUS_HDR   "Nats-Status"
+
+ +
+
+ +

◆ MICRO_ERROR_HDR

+ +
+
+ + + + +
#define MICRO_ERROR_HDR   "Nats-Service-Error"
+
+ +
+
+ +

◆ MICRO_ERROR_CODE_HDR

+ +
+
+ + + + +
#define MICRO_ERROR_CODE_HDR   "Nats-Service-Error-Code"
+
+ +
+
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_constants.js b/deps/nats.c/doc/html/group__micro_constants.js new file mode 100644 index 0000000..e6ac8da --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_constants.js @@ -0,0 +1,13 @@ +var group__micro_constants = +[ + [ "MICRO_API_PREFIX", "group__micro_constants.html#ga2ad15244b5f6541d0d30207bb71e2667", null ], + [ "MICRO_INFO_RESPONSE_TYPE", "group__micro_constants.html#ga50e5fc6d460c30bc851dc5d45e938208", null ], + [ "MICRO_INFO_VERB", "group__micro_constants.html#gaab340591dc3b52411f35f23c945b25f8", null ], + [ "MICRO_PING_RESPONSE_TYPE", "group__micro_constants.html#ga71f630d0974d85530e7d04a3718dfafc", null ], + [ "MICRO_PING_VERB", "group__micro_constants.html#ga27bccc83509da632aec126d97c320fbb", null ], + [ "MICRO_STATS_RESPONSE_TYPE", "group__micro_constants.html#gae1ba7c2a70df4daaeaba5fbebe9c0904", null ], + [ "MICRO_STATS_VERB", "group__micro_constants.html#ga4284e07f1991b9807a1dadea4b0f6a67", null ], + [ "MICRO_STATUS_HDR", "group__micro_constants.html#ga4f5f6337514aa735d486e9397bd9d0c0", null ], + [ "MICRO_ERROR_HDR", "group__micro_constants.html#ga8f052c5047750ee329d2fb496d977bad", null ], + [ "MICRO_ERROR_CODE_HDR", "group__micro_constants.html#ga3821f13d4cff7a22f7c8c21181847b44", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_error_functions.html b/deps/nats.c/doc/html/group__micro_error_functions.html new file mode 100644 index 0000000..9d6fc6b --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_error_functions.html @@ -0,0 +1,433 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: microError + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + +

+Macros

#define microError_Ignore(__err)   microError_Destroy(__err)
 
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

NATS_EXTERN microErrormicro_Errorf (const char *format,...)
 creates a new microError, with a printf-like formatted message.
 
NATS_EXTERN microErrormicro_ErrorfCode (int code, const char *format,...)
 creates a new microError, with a code and a printf-like formatted message.
 
NATS_EXTERN microErrormicro_ErrorFromStatus (natsStatus s)
 Wraps a NATS status into a microError, if not a NATS_OK.
 
NATS_EXTERN int microError_Code (microError *err)
 returns the int code of the error.
 
NATS_EXTERN void microError_Destroy (microError *err)
 destroys a microError.
 
NATS_EXTERN natsStatus microError_Status (microError *err)
 Returns the NATS status associated with the error.
 
NATS_EXTERN const char * microError_String (microError *err, char *buf, size_t len)
 Returns a printable string with the error message.
 
NATS_EXTERN microErrormicroError_Wrapf (microError *err, const char *format,...)
 Wraps an exising microError with a higher printf-like formatted message.
 
+

Detailed Description

+

Functions that create and manipulate microError.

+

Macro Definition Documentation

+ +

◆ microError_Ignore

+ +
+
+ + + + + + + + +
#define microError_Ignore( __err)   microError_Destroy(__err)
+
+ +
+
+

Function Documentation

+ +

◆ micro_Errorf()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * micro_Errorf (const char * format,
 ... 
)
+
+
Note
Errors must be freed with microError_Destroy, but often they are simply returned up the call stack.
+
Parameters
+ + +
formatprintf-like format.
+
+
+
Returns
a new microError or micro_ErrorOutOfMemory.
+ +
+
+ +

◆ micro_ErrorfCode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * micro_ErrorfCode (int code,
const char * format,
 ... 
)
+
+
Note
Errors must be freed with microError_Destroy, but often they are simply returned up the call stack.
+
Parameters
+ + + +
codean int code, loosely modeled after the HTTP status code.
formatprintf-like format.
+
+
+
Returns
a new microError or micro_ErrorOutOfMemory.
+ +
+
+ +

◆ micro_ErrorFromStatus()

+ +
+
+ + + + + + + + +
NATS_EXTERN microError * micro_ErrorFromStatus (natsStatus s)
+
+
Parameters
+ + +
sNATS status of receiving the response.
+
+
+
Returns
a new microError or NULL if no error if found.
+ +
+
+ +

◆ microError_Code()

+ +
+
+ + + + + + + + +
NATS_EXTERN int microError_Code (microErrorerr)
+
+
Parameters
+ + +
errthe error.
+
+
+
Returns
the int code.
+ +
+
+ +

◆ microError_Destroy()

+ +
+
+ + + + + + + + +
NATS_EXTERN void microError_Destroy (microErrorerr)
+
+
Parameters
+ + +
errthe error.
+
+
+ +
+
+ +

◆ microError_Status()

+ +
+
+ + + + + + + + +
NATS_EXTERN natsStatus microError_Status (microErrorerr)
+
+
Parameters
+ + +
err
+
+
+
Returns
the status
+ +
+
+ +

◆ microError_String()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN const char * microError_String (microErrorerr,
char * buf,
size_t len 
)
+
+

This function outputs into a user-provided buffer, and returns a "`%s`-able" pointer to it.

+
Parameters
+ + + + +
errthe error.
bufthe output buffer.
lenthe capacity of the output buffer.
+
+
+
Returns
buf
+ +
+
+ +

◆ microError_Wrapf()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microError_Wrapf (microErrorerr,
const char * format,
 ... 
)
+
+
Warning
The original error may be freed and should not be refered to after having been wrapped.
+
Parameters
+ + + + +
errthe original error
formatthe new message to prepend to the original error message.
...
+
+
+
Returns
a new, wrapped, error.
+ +
+
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_error_functions.js b/deps/nats.c/doc/html/group__micro_error_functions.js new file mode 100644 index 0000000..91282f5 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_error_functions.js @@ -0,0 +1,12 @@ +var group__micro_error_functions = +[ + [ "microError_Ignore", "group__micro_error_functions.html#ga7d7cf243a0d24ff38fbaf6afdfb461cd", null ], + [ "micro_Errorf", "group__micro_error_functions.html#ga7732a5a63c3b452f8d78f4e41e726fe1", null ], + [ "micro_ErrorfCode", "group__micro_error_functions.html#ga91dd255ecb0fc97fddb0b8abe4a3fc4c", null ], + [ "micro_ErrorFromStatus", "group__micro_error_functions.html#gac557c5b7b565746d8c5521c726842641", null ], + [ "microError_Code", "group__micro_error_functions.html#ga69edae8121c8a5a093c76ee2662bae54", null ], + [ "microError_Destroy", "group__micro_error_functions.html#ga1bf0dc7e647ffd431bdca222d9246f07", null ], + [ "microError_Status", "group__micro_error_functions.html#ga2648fe981670c5394bd058128ef6478c", null ], + [ "microError_String", "group__micro_error_functions.html#ga9694838e69616612ef98afe7a45cb58d", null ], + [ "microError_Wrapf", "group__micro_error_functions.html#gad43118a9e9e48aefbde3b21c4bd9d36f", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_functions.html b/deps/nats.c/doc/html/group__micro_functions.html new file mode 100644 index 0000000..8da50b8 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_functions.html @@ -0,0 +1,129 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Functions + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + + + + +

+Modules

 microService
 
 microGroup
 
 microRequest
 
 microError
 
 microClient
 
 Miscellaneous
 
+

Detailed Description

+

Microservice functions.

+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_functions.js b/deps/nats.c/doc/html/group__micro_functions.js new file mode 100644 index 0000000..806508a --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_functions.js @@ -0,0 +1,9 @@ +var group__micro_functions = +[ + [ "microService", "group__micro_service_functions.html", "group__micro_service_functions" ], + [ "microGroup", "group__micro_group_functions.html", "group__micro_group_functions" ], + [ "microRequest", "group__micro_request_functions.html", "group__micro_request_functions" ], + [ "microError", "group__micro_error_functions.html", "group__micro_error_functions" ], + [ "microClient", "group__micro_client_functions.html", "group__micro_client_functions" ], + [ "Miscellaneous", "group__micro_cleanup_functions.html", "group__micro_cleanup_functions" ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_group.html b/deps/nats.c/doc/html/group__micro_group.html new file mode 100644 index 0000000..634651c --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_group.html @@ -0,0 +1,133 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: EXPERIMENTAL - Microservices + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
EXPERIMENTAL - Microservices
+
+
+ + + + + + + + + + + + +

+Modules

 Types
 
 Callbacks
 
 Public structs
 
 Public constants
 
 Functions
 
+

Detailed Description

+
Warning
EXPERIMENTAL FEATURE! We reserve the right to change the API without necessarily bumping the major version of the library.
+

+NATS Microservices.

+

Microservices can expose one or more request-response endpoints that process incoming NATS messages.

+

Microservices are created by calling micro_AddService, and configured by passing a microServiceConfig to it. Many microservices can share a single connection to a NATS server.

+

Once created, a microservice will subscribe to all endpoints' subjects and associate them with the configured handlers. It will also subscribe to and service monitoring subjects for service-specific pings, metadata, and statistics requests. The endpoint subscriptions are created with a queue group, so that incoming requests are automatically load-balanced across all running instances of a microservice. The monitoring subscriptions are not groupped, each service instance receives and responds to all monitoring requests.

+

Once created, the microservice is asyncronous, message handlers and other callbacks will be invoked in separate threads. No further action is needed. Your program can use microService_Stop, microService_IsStopped to control the execution of the service.

+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_group.js b/deps/nats.c/doc/html/group__micro_group.js new file mode 100644 index 0000000..ddbfb22 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_group.js @@ -0,0 +1,8 @@ +var group__micro_group = +[ + [ "Types", "group__micro_types.html", "group__micro_types" ], + [ "Callbacks", "group__micro_callbacks.html", "group__micro_callbacks" ], + [ "Public structs", "group__micro_structs.html", "group__micro_structs" ], + [ "Public constants", "group__micro_constants.html", "group__micro_constants" ], + [ "Functions", "group__micro_functions.html", "group__micro_functions" ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_group_functions.html b/deps/nats.c/doc/html/group__micro_group_functions.html new file mode 100644 index 0000000..6f4c4fa --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_group_functions.html @@ -0,0 +1,207 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: microGroup + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + +

+Functions

NATS_EXTERN microErrormicroGroup_AddGroup (microGroup **new_group, microGroup *parent, const char *prefix)
 Adds a sub-group to microGroup.
 
NATS_EXTERN microErrormicroGroup_AddEndpoint (microGroup *g, microEndpointConfig *config)
 Adds an endpoint to a microGroup and starts listening for messages.
 
+

Detailed Description

+

Functions that operate with microGroup.

+

Function Documentation

+ +

◆ microGroup_AddGroup()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microGroup_AddGroup (microGroup ** new_group,
microGroupparent,
const char * prefix 
)
+
+

The new subgroup will be prefixed as "parent_prefix.prefix.". Groups are associated with a service, and are destroyed when the service is destroyed.

+
Parameters
+ + + + +
new_groupthe location where to store the pointer to the new microGroup object.
parentthe microGroup that the new group will be added to.
prefixa prefix to use on names and subjects of all endpoints in the group.
+
+
+
Returns
a microError if an error occurred.
+
See also
microGroup_AddGroup, microGroup_AddEndpoint
+ +
+
+ +

◆ microGroup_AddEndpoint()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microGroup_AddEndpoint (microGroupg,
microEndpointConfigconfig 
)
+
+

This is a convenience method to add an endpoint with its Subject and Name prefixed with the group's prefix.

+
Parameters
+ + + +
gthe microGroup that the endpoint will be added to.
configa microEndpointConfig object with the configuration of the endpoint. See micro_endpoint_config_s for descriptions of the fields.
+
+
+
Returns
a microError if an error occurred.
+
See also
microService_Destroy, microService_AddEndpoint, microEndpointConfig
+ +
+
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_group_functions.js b/deps/nats.c/doc/html/group__micro_group_functions.js new file mode 100644 index 0000000..d9024c5 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_group_functions.js @@ -0,0 +1,5 @@ +var group__micro_group_functions = +[ + [ "microGroup_AddGroup", "group__micro_group_functions.html#ga0bdc873f98dd1cb6c88b5c14974d74a0", null ], + [ "microGroup_AddEndpoint", "group__micro_group_functions.html#gabc9641ad7ee7775c388c864f2ffa6883", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_request_functions.html b/deps/nats.c/doc/html/group__micro_request_functions.html new file mode 100644 index 0000000..482a13b --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_request_functions.html @@ -0,0 +1,820 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: microRequest + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

NATS_EXTERN microErrormicroRequest_AddHeader (microRequest *req, const char *key, const char *value)
 Adds a header to the underlying NATS request message.
 
NATS_EXTERN microErrormicroRequest_DeleteHeader (microRequest *req, const char *key)
 Deletes a header from the underlying NATS request message.
 
NATS_EXTERN natsConnectionmicroRequest_GetConnection (microRequest *req)
 Returns the connection associated with the request.
 
NATS_EXTERN const char * microRequest_GetData (microRequest *req)
 Returns the data in the the request, as a byte array.
 
NATS_EXTERN int microRequest_GetDataLength (microRequest *req)
 Returns the number of data bytes in the the request.
 
NATS_EXTERN void * microRequest_GetEndpointState (microRequest *req)
 Returns the pointer to the user-provided endpoint state, if the request is associated with an endpoint.
 
NATS_EXTERN microErrormicroRequest_GetHeaderKeys (microRequest *req, const char ***keys, int *count)
 Gets the list of all header keys in the NATS message underlying the request.
 
NATS_EXTERN microErrormicroRequest_GetHeaderValue (microRequest *req, const char *key, const char **value)
 Get the header entry associated with key from the NATS message underlying the request.
 
NATS_EXTERN microErrormicroRequest_GetHeaderValues (microRequest *req, const char *key, const char ***values, int *count)
 Get all header values associated with key from the NATS message underlying the request.
 
NATS_EXTERN natsMsgmicroRequest_GetMsg (microRequest *req)
 Get the NATS message underlying the request.
 
NATS_EXTERN const char * microRequest_GetReply (microRequest *req)
 Returns the reply subject set in this message.
 
NATS_EXTERN microServicemicroRequest_GetService (microRequest *req)
 Returns the pointer to the microservice associated with the request.
 
NATS_EXTERN void * microRequest_GetServiceState (microRequest *req)
 Returns the pointer to the user-provided service state.
 
NATS_EXTERN const char * microRequest_GetSubject (microRequest *req)
 Returns the subject of the request message.
 
NATS_EXTERN microErrormicroRequest_Respond (microRequest *req, const char *data, size_t len)
 Respond to a request, on the same NATS connection.
 
NATS_EXTERN microErrormicroRequest_RespondError (microRequest *req, microError *err)
 Respond to a request with a simple error.
 
NATS_EXTERN microErrormicroRequest_RespondCustom (microRequest *req, microError *err, const char *data, size_t len)
 Respond to a message, with an OK or an error.
 
NATS_EXTERN microErrormicroRequest_SetHeader (microRequest *req, const char *key, const char *value)
 Add value to the header associated with key in the NATS message underlying the request.
 
+

Detailed Description

+

Functions that operate with microRequest.

+

Function Documentation

+ +

◆ microRequest_AddHeader()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microRequest_AddHeader (microRequestreq,
const char * key,
const char * value 
)
+
+
Parameters
+ + + + +
reqthe request.
keythe key under which the value will be stored. It can't ne NULL or empty.
valuethe string to add to the values associated with the given key. The value can be NULL or empty string.
+
+
+
Returns
a microError if an error occurred.
+
See also
natsMsgHeader_Add, microRequest_DeleteHeader, microRequest_GetHeaderKeys, microRequest_GetHeaderValue, microRequest_GetHeaderValues
+ +
+
+ +

◆ microRequest_DeleteHeader()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microRequest_DeleteHeader (microRequestreq,
const char * key 
)
+
+
Parameters
+ + + +
reqthe request.
keythe key to delete from the headers map.
+
+
+
Returns
a microError if an error occurred.
+
See also
natsMsgHeader_Delete, microRequest_AddHeader
+ +
+
+ +

◆ microRequest_GetConnection()

+ +
+
+ + + + + + + + +
NATS_EXTERN natsConnection * microRequest_GetConnection (microRequestreq)
+
+
Parameters
+ + +
reqthe request.
+
+
+
Returns
a natsConnection associated with the request. In fact, it's the connection associated with the service, so by the time the request handler is invoked the connection state may be different from when it was received.
+ +
+
+ +

◆ microRequest_GetData()

+ +
+
+ + + + + + + + +
NATS_EXTERN const char * microRequest_GetData (microRequestreq)
+
+
Note
The request owns the data, so it should not be freed other than with microRequest_Destroy.
+
+The data is not NULL terminated. Use microRequest_GetDataLength to obtain the number of bytes.
+
Parameters
+ + +
reqthe request.
+
+
+
Returns
a pointer to the request's data.
+
See also
natsMsg_GetData, microRequest_GetDataLength
+ +
+
+ +

◆ microRequest_GetDataLength()

+ +
+
+ + + + + + + + +
NATS_EXTERN int microRequest_GetDataLength (microRequestreq)
+
+
Parameters
+ + +
reqthe request.
+
+
+
Returns
the number of data bytes in the request.
+
See also
natsMsg_GetDataLength, microRequest_GetData
+ +
+
+ +

◆ microRequest_GetEndpointState()

+ +
+
+ + + + + + + + +
NATS_EXTERN void * microRequest_GetEndpointState (microRequestreq)
+
+
Parameters
+ + +
reqthe request.
+
+
+
Returns
the state pointer provided in microEndpointConfig.
+
See also
microEndpointConfig, micro_endpoint_config_s
+ +
+
+ +

◆ microRequest_GetHeaderKeys()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microRequest_GetHeaderKeys (microRequestreq,
const char *** keys,
int * count 
)
+
+

The returned strings are own by the library and MUST not be freed or altered. However, the returned array keys MUST be freed by the user.

+
Parameters
+ + + + +
reqthe request.
keysthe memory location where the library will store the pointer to the array of keys.
countthe memory location where the library will store the number of keys returned.
+
+
+
Returns
a microError if an error occurred.
+
See also
natsMsgHeader_Keys, microRequest_GetHeaderValue, microRequest_GetHeaderValues
+ +
+
+ +

◆ microRequest_GetHeaderValue()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microRequest_GetHeaderValue (microRequestreq,
const char * key,
const char ** value 
)
+
+
Parameters
+ + + + +
reqthe request.
keythe key for which the value is requested.
valuethe memory location where the library will store the pointer to the first value (if more than one is found) associated with the key.
+
+
+
Returns
a microError if an error occurred.
+
See also
natsMsgHeader_Get, microRequest_GetHeaderValue, microRequest_GetHeaderValues
+ +
+
+ +

◆ microRequest_GetHeaderValues()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microRequest_GetHeaderValues (microRequestreq,
const char * key,
const char *** values,
int * count 
)
+
+
Parameters
+ + + + + +
reqthe request.
keythe key for which the values are requested.
valuesthe memory location where the library will store the pointer to the array value (if more than one is found) associated with the key.
countthe memory location where the library will store the number of values returned.
+
+
+
Returns
a microError if an error occurred.
+
See also
natsMsgHeader_Values, microRequest_GetHeaderValue, microRequest_GetHeaderKeys
+ +
+
+ +

◆ microRequest_GetMsg()

+ +
+
+ + + + + + + + +
NATS_EXTERN natsMsg * microRequest_GetMsg (microRequestreq)
+
+
Parameters
+ + +
reqthe request.
+
+
+
Returns
the pointer to natsMsg.
+ +
+
+ +

◆ microRequest_GetReply()

+ +
+
+ + + + + + + + +
NATS_EXTERN const char * microRequest_GetReply (microRequestreq)
+
+

Returns the reply, possibly NULL.

+
Warning
The string belongs to the message and must not be freed. Copy it if needed.
+
Parameters
+ + +
reqthe request.
+
+
+ +
+
+ +

◆ microRequest_GetService()

+ +
+
+ + + + + + + + +
NATS_EXTERN microService * microRequest_GetService (microRequestreq)
+
+
Parameters
+ + +
reqthe request.
+
+
+
Returns
the microservice pointer.
+ +
+
+ +

◆ microRequest_GetServiceState()

+ +
+
+ + + + + + + + +
NATS_EXTERN void * microRequest_GetServiceState (microRequestreq)
+
+
Parameters
+ + +
reqthe request.
+
+
+
Returns
the state pointer provided in microServiceConfig.
+
See also
microServiceConfig, micro_service_config_s
+ +
+
+ +

◆ microRequest_GetSubject()

+ +
+
+ + + + + + + + +
NATS_EXTERN const char * microRequest_GetSubject (microRequestreq)
+
+
Warning
The string belongs to the message and must not be freed. Copy it if needed.
+
Parameters
+ + +
reqthe request.
+
+
+ +
+
+ +

◆ microRequest_Respond()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microRequest_Respond (microRequestreq,
const char * data,
size_t len 
)
+
+
Parameters
+ + + + +
reqthe request.
datathe response data.
lenthe length of the response data.
+
+
+
Returns
an error, if any.
+ +
+
+ +

◆ microRequest_RespondError()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microRequest_RespondError (microRequestreq,
microErrorerr 
)
+
+

If err is NULL, RespondError does nothing.

+
Note
microRequest_RespondError is called automatially if the handler returns an error. Usually, there is no need for a handler to use this function directly. If the request
+
Parameters
+ + + +
reqthe request.
errthe error to include in the response header. If NULL, no error.
+
+
+
Returns
an error, if any.
+ +
+
+ +

◆ microRequest_RespondCustom()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microRequest_RespondCustom (microRequestreq,
microErrorerr,
const char * data,
size_t len 
)
+
+

If err is NULL, RespondErrorWithData is equivalent to Respond. If err is not NULL, the response will include the error in the response header, and err will be freed.

+

The following example illustrates idiomatic usage in a request handler. Since this handler handles its own error responses, the only error it might return would be a failure to send the response.

+
err = somefunc();
+
if (err != NULL) {
+
return microRequest_RespondCustom(req, err, error_data, data_len);
+
}
+
...
+
NATS_EXTERN microError * microRequest_RespondCustom(microRequest *req, microError *err, const char *data, size_t len)
Respond to a message, with an OK or an error.
+

Or, if the request handler has its own cleanup logic:

+
if (err = somefunc(), err != NULL)
+
goto CLEANUP;
+
...
+
+
CLEANUP:
+
if (err != NULL) {
+
return microRequest_RespondCustom(req, err, error_data, data_len);
+
}
+
return NULL;
+
Parameters
+ + + + + +
reqthe request.
errthe error to include in the response header. If NULL, no error.
datathe response data.
lenthe length of the response data.
+
+
+
Note
+
Returns
an error, if any.
+ +
+
+ +

◆ microRequest_SetHeader()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microRequest_SetHeader (microRequestreq,
const char * key,
const char * value 
)
+
+
Parameters
+ + + + +
reqthe request.
keythe key under which the value will be stored. It can't ne NULL or empty.
valuethe string to store under the given key. The value can be NULL or empty string.
+
+
+
Returns
a microError if an error occurred.
+
See also
natsMsgHeader_Set
+ +
+
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_request_functions.js b/deps/nats.c/doc/html/group__micro_request_functions.js new file mode 100644 index 0000000..c16d6c3 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_request_functions.js @@ -0,0 +1,21 @@ +var group__micro_request_functions = +[ + [ "microRequest_AddHeader", "group__micro_request_functions.html#ga6a6fa30291301abf54e25a24fde7e293", null ], + [ "microRequest_DeleteHeader", "group__micro_request_functions.html#gad50a68e2193da36d7b477a34f488840c", null ], + [ "microRequest_GetConnection", "group__micro_request_functions.html#ga6cf9c55a05fe1234ef264c25ca8294b3", null ], + [ "microRequest_GetData", "group__micro_request_functions.html#ga695cf95ff0f596affecbd3954fd498cf", null ], + [ "microRequest_GetDataLength", "group__micro_request_functions.html#ga3fd1eef10afd445f517d73f32c9d4fd0", null ], + [ "microRequest_GetEndpointState", "group__micro_request_functions.html#gab999f2b9972c4339f6f78f491dfc6f3b", null ], + [ "microRequest_GetHeaderKeys", "group__micro_request_functions.html#gab78f9e653c13c8bbbbaa74d50dd34aa4", null ], + [ "microRequest_GetHeaderValue", "group__micro_request_functions.html#gad28fb0245a4c6d3218e4d233c141d3ce", null ], + [ "microRequest_GetHeaderValues", "group__micro_request_functions.html#gad73789e910856e6d3ece0ea95f1c8a54", null ], + [ "microRequest_GetMsg", "group__micro_request_functions.html#ga764c2ebab8816c4706d6e49e5cbe8320", null ], + [ "microRequest_GetReply", "group__micro_request_functions.html#gae87e12447ebc9864d38268a15c370182", null ], + [ "microRequest_GetService", "group__micro_request_functions.html#ga285974d2b6bc4b1369d9a9aa495e8119", null ], + [ "microRequest_GetServiceState", "group__micro_request_functions.html#ga8947795096eb225b16af422026627efa", null ], + [ "microRequest_GetSubject", "group__micro_request_functions.html#ga6727593cc380ad418e1d45d232ffea5e", null ], + [ "microRequest_Respond", "group__micro_request_functions.html#ga9c50e895154b151d3c9dadd3502b80f9", null ], + [ "microRequest_RespondError", "group__micro_request_functions.html#ga402e8ccd0602a27d333d50088f6a92a3", null ], + [ "microRequest_RespondCustom", "group__micro_request_functions.html#gae62bab929e8835da250870cfde2f22b2", null ], + [ "microRequest_SetHeader", "group__micro_request_functions.html#gab94d97619daf42590d7e6c6bd758b9ab", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_service_functions.html b/deps/nats.c/doc/html/group__micro_service_functions.html new file mode 100644 index 0000000..0850e41 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_service_functions.html @@ -0,0 +1,514 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: microService + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

NATS_EXTERN microErrormicro_AddService (microService **new_microservice, natsConnection *nc, microServiceConfig *config)
 Creates and starts a new microservice.
 
NATS_EXTERN microErrormicroService_AddEndpoint (microService *m, microEndpointConfig *config)
 Adds an endpoint to a microservice and starts listening for messages.
 
NATS_EXTERN microErrormicroService_AddGroup (microGroup **new_group, microService *m, const char *prefix)
 Adds an group (prefix) to a microservice.
 
NATS_EXTERN microErrormicroService_Destroy (microService *m)
 Destroys a microservice, stopping it first if needed.
 
NATS_EXTERN natsConnectionmicroService_GetConnection (microService *m)
 Returns the connection associated with the service. If the service was successfully started, it is safe to assume it's not NULL, however it may already have been disconnected or closed.
 
NATS_EXTERN microErrormicroService_GetInfo (microServiceInfo **new_info, microService *m)
 Returns a microServiceInfo for a microservice.
 
NATS_EXTERN void * microService_GetState (microService *m)
 Returns the pointer to state data (closure). It is originally provided in microServiceConfig.State.
 
NATS_EXTERN microErrormicroService_GetStats (microServiceStats **new_stats, microService *m)
 Returns run-time statistics for a microservice.
 
NATS_EXTERN bool microService_IsStopped (microService *m)
 Checks if the service is stopped.
 
NATS_EXTERN microErrormicroService_Run (microService *m)
 Waits for a microservice to stop.
 
NATS_EXTERN microErrormicroService_Stop (microService *m)
 Stops a running microservice.
 
+

Detailed Description

+

Functions that operate with microService.

+

Function Documentation

+ +

◆ micro_AddService()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * micro_AddService (microService ** new_microservice,
natsConnectionnc,
microServiceConfigconfig 
)
+
+
Note
The microservice should be destroyed to clean up using microService_Destroy.
+
Parameters
+ + + + +
new_microservicethe location where to store the pointer to the new microService object.
ncthe natsConnection the service will use to receive and respond to requests.
configa microServiceConfig object with the configuration of the service. See micro_service_config_s for descriptions of the fields.
+
+
+
Returns
a microError if an error occurred.
+
See also
microService_Destroy, microService_AddEndpoint, microServiceConfig, microEndpointConfig
+ +
+
+ +

◆ microService_AddEndpoint()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microService_AddEndpoint (microServicem,
microEndpointConfigconfig 
)
+
+

Endpoints are currently destroyed when the service is stopped, there is no present way to remove or stop individual endpoints.

+
Parameters
+ + + +
mthe microService that the endpoint will be added to.
configa microEndpointConfig object with the configuration of the endpoint. See micro_endpoint_config_s for descriptions of the fields.
+
+
+
Returns
a microError if an error occurred.
+
See also
microService_Destroy, microEndpointConfig
+ +
+
+ +

◆ microService_AddGroup()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microService_AddGroup (microGroup ** new_group,
microServicem,
const char * prefix 
)
+
+

Groups are associated with a service, and are destroyed when the service is destroyed.

+
Parameters
+ + + + +
new_groupthe location where to store the pointer to the new microGroup object.
mthe microService that the group will be added to.
prefixa prefix to use on names and subjects of all endpoints in the group.
+
+
+
Returns
a microError if an error occurred.
+
See also
microGroup_AddGroup, microGroup_AddEndpoint
+ +
+
+ +

◆ microService_Destroy()

+ +
+
+ + + + + + + + +
NATS_EXTERN microError * microService_Destroy (microServicem)
+
+
Note
This function may fail while stopping the service, do not assume unconditional success if clean up is important.
+
Parameters
+ + +
mthe microService to stop and destroy.
+
+
+
Returns
a microError if an error occurred.
+
See also
microService_Stop, microService_Run
+ +
+
+ +

◆ microService_GetConnection()

+ +
+
+ + + + + + + + +
NATS_EXTERN natsConnection * microService_GetConnection (microServicem)
+
+
Parameters
+ + +
mthe microService.
+
+
+
Returns
a natsConnection associated with the service.
+ +
+
+ +

◆ microService_GetInfo()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microService_GetInfo (microServiceInfo ** new_info,
microServicem 
)
+
+
Note
the microServiceInfo struct returned by this call should be freed with microServiceInfo_Destroy.
+
Parameters
+ + + +
new_inforeceives the pointer to the microServiceInfo.
mthe microService to query.
+
+
+
Returns
a microError if an error occurred.
+
See also
microServiceInfo, micro_service_info_s
+ +
+
+ +

◆ microService_GetState()

+ +
+
+ + + + + + + + +
NATS_EXTERN void * microService_GetState (microServicem)
+
+
Parameters
+ + +
mthe microService.
+
+
+
Returns
the state pointer.
+
See also
microServiceConfig
+ +
+
+ +

◆ microService_GetStats()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NATS_EXTERN microError * microService_GetStats (microServiceStats ** new_stats,
microServicem 
)
+
+
Note
the microServiceStats struct returned by this call should be freed with microServiceStats_Destroy.
+
Parameters
+ + + +
new_statsreceives the pointer to the microServiceStats.
mthe microService to query.
+
+
+
Returns
a microError if an error occurred.
+
See also
microServiceStats, micro_service_stats_s
+ +
+
+ +

◆ microService_IsStopped()

+ +
+
+ + + + + + + + +
NATS_EXTERN bool microService_IsStopped (microServicem)
+
+
Parameters
+ + +
mthe microService.
+
+
+
Returns
true if stopped, otherwise false.
+
See also
micro_AddService, microService_Stop, microService_Run
+ +
+
+ +

◆ microService_Run()

+ +
+
+ + + + + + + + +
NATS_EXTERN microError * microService_Run (microServicem)
+
+

micro_AddService starts the service with async subscriptions. microService_Run waits for the service to stop.

+
Parameters
+ + +
mthe microService.
+
+
+
Returns
a microError for invalid arguments, otherwise always succeeds.
+
See also
micro_AddService, microService_Stop
+ +
+
+ +

◆ microService_Stop()

+ +
+
+ + + + + + + + +
NATS_EXTERN microError * microService_Stop (microServicem)
+
+

Drains and closes the all subscriptions (endpoints and monitoring), resets the stats, and calls the Done callback for the service, so it can do its own clean up if needed.

+

It is possible that this call encounters an error while stopping the service, in which case it aborts and returns the error. The service then may be in a partially stopped state, and the Done callback will not have been called.

+
Parameters
+ + +
mthe microService.
+
+
+
Returns
a microError if an error occurred.
+
See also
micro_AddService, microService_Run
+ +
+
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_service_functions.js b/deps/nats.c/doc/html/group__micro_service_functions.js new file mode 100644 index 0000000..531812b --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_service_functions.js @@ -0,0 +1,14 @@ +var group__micro_service_functions = +[ + [ "micro_AddService", "group__micro_service_functions.html#ga2986a9751147b6f77064b5739635c2c1", null ], + [ "microService_AddEndpoint", "group__micro_service_functions.html#gadcab5687b72ec24ef7ae647ea844ebc7", null ], + [ "microService_AddGroup", "group__micro_service_functions.html#ga578c9af27fda603dc84e7ad736685bd8", null ], + [ "microService_Destroy", "group__micro_service_functions.html#ga32ff6b2fb38eafb4df8e6b1039ee5984", null ], + [ "microService_GetConnection", "group__micro_service_functions.html#ga20bb55e101c42a3b7172ea055b3ea04f", null ], + [ "microService_GetInfo", "group__micro_service_functions.html#gae7f5d4bde8ac12bde5ad48cebfad9e25", null ], + [ "microService_GetState", "group__micro_service_functions.html#gaf58eddc84ef124c80a86d380075ef226", null ], + [ "microService_GetStats", "group__micro_service_functions.html#ga19b3b7126a1e2472a4970fc16b2f9fb4", null ], + [ "microService_IsStopped", "group__micro_service_functions.html#gac829b81893f09b1ed7c401147ed6b0c0", null ], + [ "microService_Run", "group__micro_service_functions.html#gaecde4e29e2b963e73fe4a8ff2fce064a", null ], + [ "microService_Stop", "group__micro_service_functions.html#ga35de7172dac67472ac3890bc955b9b42", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_structs.html b/deps/nats.c/doc/html/group__micro_structs.html new file mode 100644 index 0000000..4c033e1 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_structs.html @@ -0,0 +1,130 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Public structs + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + + + + + +

+Classes

struct  micro_endpoint_config_s
 
struct  micro_endpoint_info_s
 
struct  micro_endpoint_stats_s
 
struct  micro_service_config_s
 The Microservice top-level configuration object. More...
 
struct  micro_service_info_s
 
struct  micro_service_stats_s
 
+

Detailed Description

+

Microservice public structs.

+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_structs.js b/deps/nats.c/doc/html/group__micro_structs.js new file mode 100644 index 0000000..d57eca5 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_structs.js @@ -0,0 +1,55 @@ +var group__micro_structs = +[ + [ "micro_endpoint_config_s", "structmicro__endpoint__config__s.html", [ + [ "Name", "structmicro__endpoint__config__s.html#a1a47fe3be59a271217bcb4341cddecae", null ], + [ "Subject", "structmicro__endpoint__config__s.html#a6c58e0e9c1da670da4a38993a613eb7d", null ], + [ "Metadata", "structmicro__endpoint__config__s.html#a7aee4ab9e29512c0b6ee12ba233c0fb7", null ], + [ "Handler", "structmicro__endpoint__config__s.html#a4a916af910a5eb88abf3f0aa60082667", null ], + [ "State", "structmicro__endpoint__config__s.html#ae9a1cf8dc159a651869e33c1f5cab3eb", null ] + ] ], + [ "micro_endpoint_info_s", "structmicro__endpoint__info__s.html", [ + [ "Name", "structmicro__endpoint__info__s.html#ab8b3d1a96e19424fc7f367f2e0dc8175", null ], + [ "Subject", "structmicro__endpoint__info__s.html#a94d9e2e4c19e17f06c827577cd967502", null ], + [ "Metadata", "structmicro__endpoint__info__s.html#aef2820ecb742b9ce9a643d39343df740", null ] + ] ], + [ "micro_endpoint_stats_s", "structmicro__endpoint__stats__s.html", [ + [ "Name", "structmicro__endpoint__stats__s.html#acfcec95bf83819e8dfe64a4babf62f8e", null ], + [ "Subject", "structmicro__endpoint__stats__s.html#a08745ca3e151b1d7d5c064659975f4d6", null ], + [ "NumRequests", "structmicro__endpoint__stats__s.html#a1adfdb3c1641301b419ccf136cbaa927", null ], + [ "NumErrors", "structmicro__endpoint__stats__s.html#a85ead23cb79aeb6e5c9b4409544412db", null ], + [ "ProcessingTimeSeconds", "structmicro__endpoint__stats__s.html#a3e971e78657d71f28477476a560162dd", null ], + [ "ProcessingTimeNanoseconds", "structmicro__endpoint__stats__s.html#a532060ae39ed420c3f84244163b4590b", null ], + [ "AverageProcessingTimeNanoseconds", "structmicro__endpoint__stats__s.html#acc74c3df96d5f8595521a57dd0eb0cde", null ], + [ "LastErrorString", "structmicro__endpoint__stats__s.html#a2adef3bbd175d542387fe47b9a156e6c", null ] + ] ], + [ "micro_service_config_s", "structmicro__service__config__s.html", [ + [ "Name", "structmicro__service__config__s.html#acb82e165927f5e5c404beb4f3120a8e2", null ], + [ "Version", "structmicro__service__config__s.html#a20d3780b9452237119aee56853216b03", null ], + [ "Description", "structmicro__service__config__s.html#a090e884af689503d9c2fcb086a5478e6", null ], + [ "Metadata", "structmicro__service__config__s.html#a4a5a97a4181a4870353f9e139cca72fc", null ], + [ "Endpoint", "structmicro__service__config__s.html#ae13d06757417aabf01619090ab83f977", null ], + [ "StatsHandler", "structmicro__service__config__s.html#a8385ccdaef440f9406a876868663ec56", null ], + [ "ErrHandler", "structmicro__service__config__s.html#a4069a6987c910fb4f045b233b6befc27", null ], + [ "DoneHandler", "structmicro__service__config__s.html#ab349d30e0f637d449c0af865234a0985", null ], + [ "State", "structmicro__service__config__s.html#a0a0ae007824f6f53fbb0cb4b940c5ad2", null ] + ] ], + [ "micro_service_info_s", "structmicro__service__info__s.html", [ + [ "Type", "structmicro__service__info__s.html#a47188c4f3a9cc6fdd1151dd59db4b1fe", null ], + [ "Name", "structmicro__service__info__s.html#a3ac45f2dd5827f95160b1d7899dcf9b7", null ], + [ "Version", "structmicro__service__info__s.html#a46ad1eddcbed5db1af32add59a910369", null ], + [ "Description", "structmicro__service__info__s.html#ad1b5706234217f33fdac3435ca920b39", null ], + [ "Id", "structmicro__service__info__s.html#a9368a61ebb6cf74a27ea261d7517d9c2", null ], + [ "Metadata", "structmicro__service__info__s.html#a292990d3fd1d94e48fd91e5556a2c091", null ], + [ "Endpoints", "structmicro__service__info__s.html#ac65a0b0e98971c334080b022f71e482d", null ], + [ "EndpointsLen", "structmicro__service__info__s.html#afa11d35ca9aa8c19bc95409727479cd7", null ] + ] ], + [ "micro_service_stats_s", "structmicro__service__stats__s.html", [ + [ "Type", "structmicro__service__stats__s.html#af37a4da72bb1e1ad292dd1caa6a309a2", null ], + [ "Name", "structmicro__service__stats__s.html#ae81f531e8fb5f4fe6bba9552743985ca", null ], + [ "Version", "structmicro__service__stats__s.html#ace4844493f3a27ce7b1accb2d1bb4da5", null ], + [ "Id", "structmicro__service__stats__s.html#afbc7f9586df0c4d8969736e76284bb20", null ], + [ "Started", "structmicro__service__stats__s.html#a53e7ea532c4bc4f9a9c4322b28060a4e", null ], + [ "Endpoints", "structmicro__service__stats__s.html#aa1ac7f9fd93c943ab8619e625976e567", null ], + [ "EndpointsLen", "structmicro__service__stats__s.html#a88ca92be3498c27f5519c8ddbd2dc9df", null ] + ] ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__micro_types.html b/deps/nats.c/doc/html/group__micro_types.html new file mode 100644 index 0000000..417413f --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_types.html @@ -0,0 +1,359 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Types + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Typedefs

typedef struct micro_client_s microClient
 The Microservice client.
 
typedef struct __for_forward_compatibility_only microClientConfig
 The Microservice configuration object. For forward compatibility only.
 
typedef struct micro_endpoint_s microEndpoint
 microEndpoint represents a microservice endpoint.
 
typedef struct micro_endpoint_config_s microEndpointConfig
 The Microservice endpoint configuration object.
 
typedef struct micro_endpoint_info_s microEndpointInfo
 static information about an endpoint.
 
typedef struct micro_endpoint_stats_s microEndpointStats
 The Microservice endpoint-level stats struct.
 
typedef struct micro_error_s microError
 the Microservice error object.
 
typedef struct micro_group_s microGroup
 a collection of endpoints and other groups, with a common prefix to their subjects and names.
 
typedef struct micro_request_s microRequest
 a request received by a microservice endpoint.
 
typedef struct micro_service_s microService
 the main object for a configured microservice.
 
typedef struct micro_service_config_s microServiceConfig
 The microservice configuration object.
 
typedef struct micro_service_info_s microServiceInfo
 Information about a running microservice.
 
typedef struct micro_service_stats_s microServiceStats
 The Microservice service-level stats struct.
 
+

Detailed Description

+

Microservice types.

+

Typedef Documentation

+ +

◆ microClient

+ +
+
+ + + + +
typedef struct micro_client_s microClient
+
+

Initialize with micro_NewClient and destroy with microClient_Destroy.

+
See also
micro_NewClient, microClient_Destroy
+ +
+
+ +

◆ microClientConfig

+ +
+
+ + + + +
typedef struct __for_forward_compatibility_only microClientConfig
+
+ +
+
+ +

◆ microEndpoint

+ +
+
+ + + + +
typedef struct micro_endpoint_s microEndpoint
+
+

The only place where this struct is used by the user is in callbacks, to identify which endpoint was called, or caused an error.

+
See also
microRequestHandler, microErrorHandler, microServiceConfig, microEndpointConfig
+ +
+
+ +

◆ microEndpointConfig

+ + + +

◆ microEndpointInfo

+ +
+
+ + + + +
typedef struct micro_endpoint_info_s microEndpointInfo
+
+

microEndpointInfo is returned by microService_GetInfo function, as part of microServiceInfo. It is also accessible by sending a $SRV.INFO.<service-name>[.<id>] request to the service. See micro_endpoint_info_s for descriptions of the fields.

+
See also
micro_endpoint_info_s, micro_service_info_s, microService_GetInfo
+ +
+
+ +

◆ microEndpointStats

+ +
+
+ + + + +
typedef struct micro_endpoint_stats_s microEndpointStats
+
+

Returned as part of microEndpointStats. See micro_endpoint_stats_s for descriptions of the fields.

+
See also
micro_endpoint_stats_s, microServiceStats, microService_GetStats
+ +
+
+ +

◆ microError

+ +
+
+ + + + +
typedef struct micro_error_s microError
+
+

This error type is returned by most microservice functions. You can create your own custom errors by using micro_Errorf and wrap existing errors using microError_Wrapf. Errors are heap-allocated and must be freed with either microError_Destroy or by passing it into microRequest_Respond.

+

There are no public fields in this struct, use microError_Code, microError_Status, and microError_String to get more information about the error.

+ +
+
+ +

◆ microGroup

+ +
+
+ + + + +
typedef struct micro_group_s microGroup
+
+

It has no other purpose than convenience, for organizing endpoint subject space.

+ +
+
+ +

◆ microRequest

+ +
+
+ + + + +
typedef struct micro_request_s microRequest
+
+
See also
micro_request_s for descriptions of the fields.
+ +
+
+ +

◆ microService

+ +
+
+ + + + +
typedef struct micro_service_s microService
+
+

It can be created with micro_AddService, and configured by passing a microServiceConfig to it. Once no longer needed, a microservice should be destroyed with microService_Destroy.

+
See also
micro_AddService, microServiceConfig, microEndpointConfig, microService_Destroy, microService_Stop, microService_IsStopped, microService_Run
+ +
+
+ +

◆ microServiceConfig

+ +
+
+ + + + +
typedef struct micro_service_config_s microServiceConfig
+
+

The service is created with a clone of the config and all of its values, so the original can be freed or modified after calling micro_AddService. See micro_service_config_s for descriptions of the fields.

+
See also
micro_service_config_s
+ +
+
+ +

◆ microServiceInfo

+ +
+
+ + + + +
typedef struct micro_service_info_s microServiceInfo
+
+

microServiceInfo is the struct returned by microService_GetInfo function. It is also accessible by sending a $SRV.INFO.<service-name>[.<id>] request to the service. See micro_service_info_s for descriptions of the fields.

+
See also
micro_service_info_s, microService_GetInfo
+ +
+
+ +

◆ microServiceStats

+ +
+
+ + + + +
typedef struct micro_service_stats_s microServiceStats
+
+
See also
micro_service_stats_s for descriptions of the fields, microService_GetStats
+ +
+
+
+
+ + + + + diff --git a/deps/nats.c/doc/html/group__micro_types.js b/deps/nats.c/doc/html/group__micro_types.js new file mode 100644 index 0000000..b56a6f0 --- /dev/null +++ b/deps/nats.c/doc/html/group__micro_types.js @@ -0,0 +1,16 @@ +var group__micro_types = +[ + [ "microClient", "group__micro_types.html#ga22c8eebaa1ca15ba0834b89cc1081130", null ], + [ "microClientConfig", "group__micro_types.html#ga550430b08d2e071e3901c6d720f4a039", null ], + [ "microEndpoint", "group__micro_types.html#gaea03a1fb23faec1d7919054b27acfbc3", null ], + [ "microEndpointConfig", "group__micro_types.html#ga7718d2f2c911e4cf677788f4ffe048cd", null ], + [ "microEndpointInfo", "group__micro_types.html#gadd4fcc67087b4d5f42015a7269cb6496", null ], + [ "microEndpointStats", "group__micro_types.html#ga0a429a5ecfff69b212a3ba9abebcba53", null ], + [ "microError", "group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7", null ], + [ "microGroup", "group__micro_types.html#ga2681ea21e9f5f6681b972bbb67e32133", null ], + [ "microRequest", "group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4", null ], + [ "microService", "group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28", null ], + [ "microServiceConfig", "group__micro_types.html#ga1e46c0657cf42e83b366d224f380fb55", null ], + [ "microServiceInfo", "group__micro_types.html#ga033705d0404de94efb7a6444c6e91743", null ], + [ "microServiceStats", "group__micro_types.html#gaf832de937edc57bcc3af5e1456b3760c", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/group__msg_group.html b/deps/nats.c/doc/html/group__msg_group.html index 2eddfe1..7a29a2b 100644 --- a/deps/nats.c/doc/html/group__msg_group.html +++ b/deps/nats.c/doc/html/group__msg_group.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Message @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + +
diff --git a/deps/nats.c/doc/html/libuv_8h.html b/deps/nats.c/doc/html/libuv_8h.html index 3e1501f..a61aebb 100644 --- a/deps/nats.c/doc/html/libuv_8h.html +++ b/deps/nats.c/doc/html/libuv_8h.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: libuv.h File Reference @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + +
diff --git a/deps/nats.c/doc/html/menudata.js b/deps/nats.c/doc/html/menudata.js index b848bf9..5ae4b4f 100644 --- a/deps/nats.c/doc/html/menudata.js +++ b/deps/nats.c/doc/html/menudata.js @@ -25,7 +25,7 @@ var menudata={children:[ {text:"Main Page",url:"index.html"}, {text:"Related Pages",url:"pages.html"}, -{text:"Modules",url:"modules.html"}, +{text:"Topics",url:"topics.html"}, {text:"Classes",url:"annotated.html",children:[ {text:"Class List",url:"annotated.html"}, {text:"Class Index",url:"classes.html"}, @@ -49,6 +49,7 @@ var menudata={children:[ {text:"r",url:"functions_r.html#index_r"}, {text:"s",url:"functions_s.html#index_s"}, {text:"t",url:"functions_t.html#index_t"}, +{text:"v",url:"functions_v.html#index_v"}, {text:"w",url:"functions_w.html#index_w"}]}, {text:"Variables",url:"functions_vars.html",children:[ {text:"a",url:"functions_vars.html#index_a"}, @@ -69,6 +70,7 @@ var menudata={children:[ {text:"r",url:"functions_vars_r.html#index_r"}, {text:"s",url:"functions_vars_s.html#index_s"}, {text:"t",url:"functions_vars_t.html#index_t"}, +{text:"v",url:"functions_vars_v.html#index_v"}, {text:"w",url:"functions_vars_w.html#index_w"}]}]}]}, {text:"Files",url:"files.html",children:[ {text:"File List",url:"files.html"}, @@ -76,16 +78,19 @@ var menudata={children:[ {text:"All",url:"globals.html",children:[ {text:"j",url:"globals.html#index_j"}, {text:"k",url:"globals_k.html#index_k"}, +{text:"m",url:"globals_m.html#index_m"}, {text:"n",url:"globals_n.html#index_n"}, {text:"s",url:"globals_s.html#index_s"}]}, {text:"Functions",url:"globals_func.html",children:[ {text:"j",url:"globals_func.html#index_j"}, {text:"k",url:"globals_func_k.html#index_k"}, +{text:"m",url:"globals_func_m.html#index_m"}, {text:"n",url:"globals_func_n.html#index_n"}, {text:"s",url:"globals_func_s.html#index_s"}]}, {text:"Typedefs",url:"globals_type.html",children:[ {text:"j",url:"globals_type.html#index_j"}, {text:"k",url:"globals_type.html#index_k"}, +{text:"m",url:"globals_type.html#index_m"}, {text:"n",url:"globals_type.html#index_n"}, {text:"s",url:"globals_type.html#index_s"}]}, {text:"Enumerations",url:"globals_enum.html"}, diff --git a/deps/nats.c/doc/html/minus.svg b/deps/nats.c/doc/html/minus.svg new file mode 100644 index 0000000..f70d0c1 --- /dev/null +++ b/deps/nats.c/doc/html/minus.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/deps/nats.c/doc/html/minusd.svg b/deps/nats.c/doc/html/minusd.svg new file mode 100644 index 0000000..5f8e879 --- /dev/null +++ b/deps/nats.c/doc/html/minusd.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/deps/nats.c/doc/html/modules.html b/deps/nats.c/doc/html/modules.html index c1234ed..c8a363d 100644 --- a/deps/nats.c/doc/html/modules.html +++ b/deps/nats.c/doc/html/modules.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Modules @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + +
-Go to the documentation of this file.
1// Copyright 2015-2022 The NATS Authors
+Go to the documentation of this file.
1// Copyright 2015-2023 The NATS Authors
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
@@ -159,7 +164,7 @@ $(document).ready(function(){initNavTree('nats_8h_source.html',''); initResizabl
138//
139// Types.
140//
-
152typedef struct __natsConnection natsConnection;
+
152typedef struct __natsConnection natsConnection;
153
159typedef struct __natsStatistics natsStatistics;
160
@@ -171,1757 +176,2221 @@ $(document).ready(function(){initNavTree('nats_8h_source.html',''); initResizabl
179
187typedef char natsInbox;
188
+
212typedef struct natsMsgList
213{
215 int Count;
216
+
218
-
227typedef struct __jsCtx jsCtx;
-
228
-
244typedef struct jsPubOptions
-
245{
-
246 int64_t MaxWait;
-
247 const char *MsgId;
-
248 const char *ExpectStream;
-
249 const char *ExpectLastMsgId;
-
250 uint64_t ExpectLastSeq;
- - -
253
- -
255
-
259typedef enum
-
260{
- - - -
264
- +
+
224typedef struct natsMetadata
+
225{
+
226 // User-provided metadata for the stream, encoded as an array of {"key", "value",...}
+
227 const char **List;
+
228 // Number of key/value pairs in Metadata, 1/2 of the length of the array.
+
229 int Count;
+ +
+
231
+
240typedef struct __jsCtx jsCtx;
+
241
+
+
257typedef struct jsPubOptions
+
258{
+
259 int64_t MaxWait;
+
260 const char *MsgId;
+
261 const char *ExpectStream;
+
262 const char *ExpectLastMsgId;
+
263 uint64_t ExpectLastSeq;
+ +
266
-
270typedef enum
-
271{
- - -
274
- -
276
-
280typedef enum
-
281{
- - -
284
- -
286
-
290typedef enum
-
291{
- - - - - - -
298
- -
300
-
304typedef enum
-
305{
- - - -
309
-
310
- -
312
-
316typedef enum
-
317{
- - + +
+
268
+ +
279
+
+
283typedef enum
+
284{
+ + +
287
+ +
+
289
+
+
293typedef enum
+
294{
+ + +
297
+ +
+
299
+ +
308
+
322
-
323
-
335typedef struct jsPlacement
-
336{
-
337 const char *Cluster;
-
338 const char **Tags;
- -
340
- +
+
326typedef enum
+
327{
+ + + +
331
+
332
+ +
+
334
+
+
338typedef enum
+
339{
+ +
342
-
352typedef struct jsExternalStream
-
353{
-
354 const char *APIPrefix;
-
355 const char *DeliverPrefix;
-
356
- -
358
-
371typedef struct jsStreamSource
-
372{
-
373 const char *Name;
-
374 uint64_t OptStartSeq;
-
375 int64_t OptStartTime;
-
376 const char *FilterSubject;
- -
378 // Domain and External are mutually exclusive.
-
379 // If Domain is set, an External value will be created with
-
380 // the APIPrefix constructed based on the Domain value.
-
381 const char *Domain;
-
382
- -
384
-
388typedef struct jsRePublish
-
389{
-
390 const char *Source;
-
391 const char *Destination;
- -
393
- -
395
-
472typedef struct jsStreamConfig {
-
473 const char *Name;
-
474 const char *Description;
-
475 const char **Subjects;
- - - -
479 int64_t MaxMsgs;
-
480 int64_t MaxBytes;
-
481 int64_t MaxAge;
- -
483 int32_t MaxMsgSize;
- - -
486 int64_t Replicas;
-
487 bool NoAck;
-
488 const char *Template;
-
489 int64_t Duplicates;
- - - - -
494 bool Sealed;
- - - -
502
-
503 // Allow republish of the message after being sequenced and stored.
- -
505
-
506 // Allow higher performance, direct access to get individual messages. E.g. KeyValue
- -
508 // Allow higher performance and unified direct access for mirrors as well.
- -
510
-
511 // Allow KV like semantics to also discard new on a per subject basis
- -
513
- -
515
-
519typedef struct jsLostStreamData
-
520{
-
521 uint64_t *Msgs;
- -
523 uint64_t Bytes;
-
524
- -
526
- -
533{
-
534 const char *Subject;
-
535 uint64_t Msgs;
-
536
- -
538
- -
569{
- -
571 int Count;
-
572
- -
574
-
581typedef struct jsStreamState
-
582{
-
583 uint64_t Msgs;
-
584 uint64_t Bytes;
-
585 uint64_t FirstSeq;
-
586 int64_t FirstTime;
-
587 uint64_t LastSeq;
-
588 int64_t LastTime;
-
589 int64_t NumSubjects;
- -
591 uint64_t NumDeleted;
-
592 uint64_t *Deleted;
- - -
595 int64_t Consumers;
+ +
+
344
+
345
+
+
357typedef struct jsPlacement
+
358{
+
359 const char *Cluster;
+
360 const char **Tags;
+ +
362
+ +
+
364
+
+
374typedef struct jsExternalStream
+
375{
+
376 const char *APIPrefix;
+
377 const char *DeliverPrefix;
+
378
+ +
+
380
+
+
393typedef struct jsStreamSource
+
394{
+
395 const char *Name;
+
396 uint64_t OptStartSeq;
+
397 int64_t OptStartTime;
+
398 const char *FilterSubject;
+ +
400 // Domain and External are mutually exclusive.
+
401 // If Domain is set, an External value will be created with
+
402 // the APIPrefix constructed based on the Domain value.
+
403 const char *Domain;
+
404
+ +
+
406
+
+
410typedef struct jsRePublish
+
411{
+
412 const char *Source;
+
413 const char *Destination;
+ +
415
+ +
+
417
+
+ +
423{
+
424 const char *Source;
+
425 const char *Destination;
+ +
+
427
+ +
437
+
+
517typedef struct jsStreamConfig {
+
518 const char *Name;
+
519 const char *Description;
+
520 const char **Subjects;
+ + + +
524 int64_t MaxMsgs;
+
525 int64_t MaxBytes;
+
526 int64_t MaxAge;
+ +
528 int32_t MaxMsgSize;
+ + +
531 int64_t Replicas;
+
532 bool NoAck;
+
533 const char *Template;
+
534 int64_t Duplicates;
+ + + + +
539 bool Sealed;
+ + + +
547
+
548 // Allow republish of the message after being sequenced and stored.
+ +
550
+
551 // Allow higher performance, direct access to get individual messages. E.g. KeyValue
+ +
553 // Allow higher performance and unified direct access for mirrors as well.
+ +
555
+
556 // Allow KV like semantics to also discard new on a per subject basis
+ +
558
+ + +
581 uint64_t FirstSeq;
+ + + +
+
585
+
+
589typedef struct jsLostStreamData
+
590{
+
591 uint64_t *Msgs;
+ +
593 uint64_t Bytes;
+
594
+ +
596
- -
598
-
603typedef struct jsPeerInfo
-
604{
-
605 char *Name;
- - -
608 int64_t Active;
-
609 uint64_t Lag;
-
610
- -
612
-
617typedef struct jsClusterInfo
-
618{
-
619 char *Name;
-
620 char *Leader;
- - -
623
- -
625
-
629typedef struct jsStreamSourceInfo
-
630{
-
631 char *Name;
- -
633 uint64_t Lag;
-
634 int64_t Active;
-
635
- -
637
-
641typedef struct jsStreamAlternate
-
642{
-
643 const char *Name;
-
644 const char *Domain;
-
645 const char *Cluster;
-
646
- -
648
-
655typedef struct jsStreamInfo
-
656{
- -
658 int64_t Created;
- - - - - - - +
+ +
603{
+
604 const char *Subject;
+
605 uint64_t Msgs;
+
606
+ +
+
608
+ +
644
+
+
651typedef struct jsStreamState
+
652{
+
653 uint64_t Msgs;
+
654 uint64_t Bytes;
+
655 uint64_t FirstSeq;
+
656 int64_t FirstTime;
+
657 uint64_t LastSeq;
+
658 int64_t LastTime;
+
659 int64_t NumSubjects;
+ +
661 uint64_t NumDeleted;
+
662 uint64_t *Deleted;
+ + +
665 int64_t Consumers;
666
- + +
668
-
676typedef struct jsStreamInfoList
-
677{
- -
679 int Count;
+
+
673typedef struct jsPeerInfo
+
674{
+
675 char *Name;
+ + +
678 int64_t Active;
+
679 uint64_t Lag;
680
- + +
682
-
690typedef struct jsStreamNamesList
-
691{
-
692 char **List;
-
693 int Count;
-
694
- -
696
-
733typedef struct jsConsumerConfig
-
734{
-
735 const char *Name;
-
736 const char *Durable;
-
737 const char *Description;
- -
739 uint64_t OptStartSeq;
-
740 int64_t OptStartTime;
- -
742 int64_t AckWait;
-
743 int64_t MaxDeliver;
-
744 int64_t *BackOff;
- -
746 const char *FilterSubject;
- -
748 uint64_t RateLimit;
-
749 const char *SampleFrequency;
-
750 int64_t MaxWaiting;
- - -
753 int64_t Heartbeat;
- +
+
687typedef struct jsClusterInfo
+
688{
+
689 char *Name;
+
690 char *Leader;
+ + +
693
+ +
+
695
+ +
710
+
+
714typedef struct jsStreamAlternate
+
715{
+
716 const char *Name;
+
717 const char *Domain;
+
718 const char *Cluster;
+
719
+ +
+
721
+ +
741
+
+
749typedef struct jsStreamInfoList
+
750{
+ +
752 int Count;
+
753
+ +
755
-
756 // Pull based options.
- - - -
760
-
761 // Push based options.
-
762 const char *DeliverSubject;
-
763 const char *DeliverGroup;
-
764
-
765 // Ephemeral inactivity threshold.
- +
+
763typedef struct jsStreamNamesList
+
764{
+
765 char **List;
+
766 int Count;
767
-
768 // Generally inherited by parent stream and other markers, now can be configured directly.
-
769 int64_t Replicas;
-
770 // Force memory storage.
- -
772
- -
774
- -
793{
-
794 uint64_t Stream;
-
795 uint64_t ConsumerClient;
-
796 uint64_t ConsumerServer;
-
797
- -
799
-
815typedef struct jsSubOptions
-
816{
-
823 const char *Stream;
-
833 const char *Consumer;
-
848 const char *Queue;
- - -
873 bool Ordered;
-
874
- -
876
-
880typedef struct jsSequencePair
+ +
+
769
+
+
813typedef struct jsConsumerConfig
+
814{
+
815 const char *Name;
+
816 const char *Durable;
+
817 const char *Description;
+ +
819 uint64_t OptStartSeq;
+
820 int64_t OptStartTime;
+ +
822 int64_t AckWait;
+
823 int64_t MaxDeliver;
+
824 int64_t *BackOff;
+ +
826 const char *FilterSubject;
+ +
828 uint64_t RateLimit;
+
829 const char *SampleFrequency;
+
830 int64_t MaxWaiting;
+ + +
833 int64_t Heartbeat;
+ +
835
+
836 // Pull based options.
+ + + +
840
+
841 // Push based options.
+
842 const char *DeliverSubject;
+
843 const char *DeliverGroup;
+
844
+
845 // Ephemeral inactivity threshold.
+ +
847
+
848 // Generally inherited by parent stream and other markers, now can be configured directly.
+
849 int64_t Replicas;
+
850 // Force memory storage.
+ +
852
+
853 // Configuration options introduced in 2.10
+
854
+
855 // Multiple filter subjects
+
856 const char **FilterSubjects;
+ +
858
+
859 // User-provided metadata for the consumer, encoded as an array of {"key", "value",...}
+ + +
+
862
+
+
881{
-
882 uint64_t Consumer;
-
883 uint64_t Stream;
-
884
- -
886
-
890typedef struct jsSequenceInfo
-
891{
-
892 uint64_t Consumer;
-
893 uint64_t Stream;
-
894 int64_t Last;
-
895
- -
897
-
904typedef struct jsConsumerInfo
-
905{
-
906 char *Stream;
-
907 char *Name;
-
908 int64_t Created;
- - - - - -
914 int64_t NumWaiting;
-
915 uint64_t NumPending;
- - -
918
- -
920
-
928typedef struct jsConsumerInfoList
-
929{
- -
931 int Count;
-
932
- -
934
- -
943{
-
944 char **List;
-
945 int Count;
-
946
- -
948
-
952typedef struct jsAPIStats
-
953{
-
954 uint64_t Total;
-
955 uint64_t Errors;
-
956
- -
958
-
962typedef struct jsAccountLimits
-
963{
-
964 int64_t MaxMemory;
-
965 int64_t MaxStore;
-
966 int64_t MaxStreams;
- - - - - +
882 uint64_t Stream;
+
883 uint64_t ConsumerClient;
+
884 uint64_t ConsumerServer;
+
885
+ +
+
887
+
+
903typedef struct jsSubOptions
+
904{
+
911 const char *Stream;
+
921 const char *Consumer;
+
936 const char *Queue;
+ + +
961 bool Ordered;
+
962
+ +
+
964
+
+
968typedef struct jsSequencePair
+
969{
+
970 uint64_t Consumer;
+
971 uint64_t Stream;
972
- + +
974
-
975typedef struct jsTier
-
976{
-
977 const char *Name;
-
978 uint64_t Memory;
-
979 uint64_t Store;
-
980 int64_t Streams;
-
981 int64_t Consumers;
- +
+
978typedef struct jsSequenceInfo
+
979{
+
980 uint64_t Consumer;
+
981 uint64_t Stream;
+
982 int64_t Last;
983
- + +
985
-
989typedef struct jsAccountInfo
-
990{
-
991 uint64_t Memory;
-
992 uint64_t Store;
-
993 int64_t Streams;
-
994 int64_t Consumers;
-
995 char *Domain;
- - - - -
1000
- -
1002
-
1010typedef struct jsMsgMetaData
-
1011{
- - -
1014 uint64_t NumPending;
-
1015 int64_t Timestamp;
-
1016 char *Stream;
- -
1018 char *Domain;
-
1019
- -
1021
-
1025typedef struct jsPubAck
-
1026{
-
1027 char *Stream;
-
1028 uint64_t Sequence;
-
1029 char *Domain;
- -
1031
- -
1033
-
1038typedef struct jsPubAckErr
-
1039{
- - - -
1043 const char *ErrText;
+ +
1008
+
+ +
1017{
+ + +
1020
+ +
+
1022
+
+ +
1031{
+
1032 char **List;
+ +
1034
+ +
+
1036
+
+
1040typedef struct jsAPIStats
+
1041{
+
1042 uint64_t Total;
+
1043 uint64_t Errors;
1044
- + +
1046
-
1047#ifndef BUILD_IN_DOXYGEN
-
1048// Forward declarations
-
1049typedef void (*jsPubAckErrHandler)(jsCtx *js, jsPubAckErr *pae, void *closure);
-
1050typedef void (*jsPubAckHandler)(jsCtx *js, natsMsg *msg, jsPubAck *pa, jsPubAckErr *pae, void *closure);
-
1051#endif
-
1052
- -
1063{
-
1064 uint64_t Sequence;
-
1065 const char *NextBySubject;
-
1066 const char *LastBySubject;
-
1067
- -
1069
-
1075typedef struct jsFetchRequest
-
1076{
-
1077 int64_t Expires;
-
1078 int Batch;
-
1079 int64_t MaxBytes;
-
1080 bool NoWait;
-
1081 int64_t Heartbeat;
-
1082
- -
1084
-
1090typedef struct jsOptions
-
1091{
-
1092 const char *Prefix;
-
1093 const char *Domain;
-
1094 int64_t Wait;
-
1095
- -
1100 {
-
1101 int64_t MaxPending;
-
1102
-
1103 // If jsPubAckHandler is specified, the callback will be invoked
-
1104 // for every asynchronous published message, either as a positive
-
1105 // result, or with the error encountered when publishing that
-
1106 // message. If this callback is specified, ErrHandler (see below)
-
1107 // will be ignored.
- - -
1110
-
1111 // This callback is invoked for messages published asynchronously
-
1112 // when an error is returned by the server or if the library has
-
1113 // timed-out waiting for an acknowledgment back from the server
-
1114 // (if publish uses the jsPubOptions.MaxWait).
- - -
1117
-
1118 int64_t StallWait;
+
+
1050typedef struct jsAccountLimits
+
1051{
+
1052 int64_t MaxMemory;
+
1053 int64_t MaxStore;
+
1054 int64_t MaxStreams;
+ + + + + +
1060
+ +
+
1062
+
+
1063typedef struct jsTier
+
1064{
+
1065 const char *Name;
+
1066 uint64_t Memory;
+
1067 uint64_t Store;
+
1068 int64_t Streams;
+
1069 int64_t Consumers;
+ +
1071
+ +
+
1073
+
+
1077typedef struct jsAccountInfo
+
1078{
+
1079 uint64_t Memory;
+
1080 uint64_t Store;
+
1081 int64_t Streams;
+
1082 int64_t Consumers;
+
1083 char *Domain;
+ + + + +
1088
+ +
+
1090
+
+
1098typedef struct jsMsgMetaData
+
1099{
+ + +
1102 uint64_t NumPending;
+
1103 int64_t Timestamp;
+
1104 char *Stream;
+ +
1106 char *Domain;
+
1107
+ +
+
1109
+
+
1113typedef struct jsPubAck
+
1114{
+
1115 char *Stream;
+
1116 uint64_t Sequence;
+
1117 char *Domain;
+
1119
- + +
1121
- -
1129 {
- -
1140 {
-
1141 const char *Subject;
-
1142 uint64_t Sequence;
-
1143 uint64_t Keep;
-
1144
- -
1146
- -
1151 {
- -
1153 const char *SubjectsFilter;
-
1154
- -
1156
- -
1158
- -
1160
-
1164typedef struct __kvStore kvStore;
-
1165
-
1169typedef struct __kvEntry kvEntry;
+
+
1126typedef struct jsPubAckErr
+
1127{
+ + + +
1131 const char *ErrText;
+
1132
+ +
+
1134
+
1135#ifndef BUILD_IN_DOXYGEN
+
1136// Forward declarations
+
1137typedef void (*jsPubAckErrHandler)(jsCtx *js, jsPubAckErr *pae, void *closure);
+
1138typedef void (*jsPubAckHandler)(jsCtx *js, natsMsg *msg, jsPubAck *pa, jsPubAckErr *pae, void *closure);
+
1139#endif
+
1140
+
+ +
1151{
+
1152 uint64_t Sequence;
+
1153 const char *NextBySubject;
+
1154 const char *LastBySubject;
+
1155
+ +
+
1157
+
+
1163typedef struct jsFetchRequest
+
1164{
+
1165 int64_t Expires;
+
1166 int Batch;
+
1167 int64_t MaxBytes;
+
1168 bool NoWait;
+
1169 int64_t Heartbeat;
1170
-
1174typedef struct __kvStatus kvStatus;
-
1175
-
1179typedef struct __kvWatcher kvWatcher;
-
1180
-
1184typedef enum
-
1185{
- - - - + +
+
1172
+
+
1178typedef struct jsOptions
+
1179{
+
1180 const char *Prefix;
+
1181 const char *Domain;
+
1182 int64_t Wait;
+
1183
+
+ +
1188 {
+
1189 int64_t MaxPending;
1190
-
1191} kvOperation;
-
1192
-
1198typedef struct kvConfig
-
1199{
-
1200 const char *Bucket;
-
1201 const char *Description;
- -
1203 uint8_t History;
-
1204 int64_t TTL;
-
1205 int64_t MaxBytes;
- - - - - - -
1212
- -
1214
-
1220typedef struct kvWatchOptions
-
1221{
- - - -
1225 int64_t Timeout;
-
1226
- -
1228
-
1234typedef struct kvPurgeOptions
-
1235{
-
1236 // How long to wait (in milliseconds) for some operations to complete.
-
1237 int64_t Timeout;
-
1238
-
1239 // When calling kvStore_PurgeDeletes(), all keys that have a delete or
-
1240 // purge marker as the last entry are gathered and then those keys
-
1241 // are purged of their content, including the marker.
-
1242 // Starting with NATS C client v3.3.0, if this option is not specified,
-
1243 // only the markers older than 30 minutes will be deleted. Use this
-
1244 // option to set the limit or a negative value to force removal of
-
1245 // markers regardless of their age.
-
1246 // The value is expressed as a time in nanoseconds.
- +
1191 // If jsPubAckHandler is specified, the callback will be invoked
+
1192 // for every asynchronous published message, either as a positive
+
1193 // result, or with the error encountered when publishing that
+
1194 // message. If this callback is specified, ErrHandler (see below)
+
1195 // will be ignored.
+ + +
1198
+
1199 // This callback is invoked for messages published asynchronously
+
1200 // when an error is returned by the server or if the library has
+
1201 // timed-out waiting for an acknowledgment back from the server
+
1202 // (if publish uses the jsPubOptions.MaxWait).
+ + +
1205
+
1206 int64_t StallWait;
+
1207
+ +
+
1209
+
+ +
1217 {
+
+ +
1228 {
+
1229 const char *Subject;
+
1230 uint64_t Sequence;
+
1231 uint64_t Keep;
+
1232
+ +
+
1234
+
+ +
1239 {
+ +
1241 const char *SubjectsFilter;
+
1242
+ +
+
1244
+ +
+
1246
+ +
1248
- -
1250
-
1268typedef struct kvEntryList
-
1269{
- - -
1272
- -
1274
-
1292typedef struct kvKeysList
-
1293{
-
1294 char **Keys;
- -
1296
- -
1298
-
1299#if defined(NATS_HAS_STREAMING)
-
1304typedef struct __stanConnection stanConnection;
-
1305
-
1310typedef struct __stanSubscription stanSubscription;
-
1311
-
1316typedef struct __stanMsg stanMsg;
-
1317
-
1322typedef struct __stanConnOptions stanConnOptions;
-
1323
-
1328typedef struct __stanSubOptions stanSubOptions;
-
1329#endif
-
1330 // end of typesGroup
-
1332
-
1333//
-
1334// Callbacks.
-
1335//
+
1252typedef struct __kvStore kvStore;
+
1253
+
1257typedef struct __kvEntry kvEntry;
+
1258
+
1262typedef struct __kvStatus kvStatus;
+
1263
+
1267typedef struct __kvWatcher kvWatcher;
+
1268
+
+
1272typedef enum
+
1273{
+ + + + +
1278
+
1279} kvOperation;
+
+
1280
+
+
1286typedef struct kvConfig
+
1287{
+
1288 const char *Bucket;
+
1289 const char *Description;
+ +
1291 uint8_t History;
+
1292 int64_t TTL;
+
1293 int64_t MaxBytes;
+ + + + + + +
1300
+ +
+
1302
+
+
1308typedef struct kvWatchOptions
+
1309{
+ + + +
1313 int64_t Timeout;
+
1314
+ +
+
1316
+
+
1322typedef struct kvPurgeOptions
+
1323{
+
1324 // How long to wait (in milliseconds) for some operations to complete.
+
1325 int64_t Timeout;
+
1326
+
1327 // When calling kvStore_PurgeDeletes(), all keys that have a delete or
+
1328 // purge marker as the last entry are gathered and then those keys
+
1329 // are purged of their content, including the marker.
+
1330 // Starting with NATS C client v3.3.0, if this option is not specified,
+
1331 // only the markers older than 30 minutes will be deleted. Use this
+
1332 // option to set the limit or a negative value to force removal of
+
1333 // markers regardless of their age.
+
1334 // The value is expressed as a time in nanoseconds.
+
1336
-
1359typedef void (*natsMsgHandler)(
-
1360 natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure);
-
1361
- -
1376 natsConnection *nc, void *closure);
-
1377
-
1384typedef void (*natsErrHandler)(
-
1385 natsConnection *nc, natsSubscription *subscription, natsStatus err,
-
1386 void *closure);
-
1387
- -
1402 void **userData,
-
1403 void *loop,
-
1404 natsConnection *nc,
-
1405 natsSock socket);
-
1406
- -
1417 void *userData,
-
1418 bool add);
-
1419
- -
1430 void *userData,
-
1431 bool add);
-
1432
- -
1441 void *userData);
-
1442
- -
1465 char **userJWT,
-
1466 char **customErrTxt,
-
1467 void *closure);
-
1468
-
1469
- -
1496 char **customErrTxt,
-
1497 unsigned char **signature,
-
1498 int *signatureLength,
-
1499 const char *nonce,
-
1500 void *closure);
-
1501
-
1510typedef const char* (*natsTokenHandler)(void *closure);
-
1511
-
1512
-
1520typedef void (*natsOnCompleteCB)(void *closure);
-
1521
-
1542typedef int64_t (*natsCustomReconnectDelayHandler)(natsConnection *nc, int attempts, void *closure);
-
1543
-
1544#ifdef BUILD_IN_DOXYGEN
-
1578typedef void (*jsPubAckErrHandler)(jsCtx *js, jsPubAckErr *pae, void *closure);
-
1579
-
1621typedef void (*jsPubAckHandler)(jsCtx *js, natsMsg *msg, jsPubAck *pa, jsPubAckErr *pae, void *closure);
-
1622#endif
-
1623
-
1624#if defined(NATS_HAS_STREAMING)
-
1633typedef void (*stanPubAckHandler)(const char *guid, const char *error, void *closure);
-
1634
-
1644typedef void (*stanMsgHandler)(
-
1645 stanConnection *sc, stanSubscription *sub, const char *channel, stanMsg *msg, void *closure);
-
1646
- -
1654 stanConnection *sc, const char* errorTxt, void *closure);
-
1655#endif
-
1656 // end of callbacksGroup
-
1658
-
1659//
-
1660// Functions.
-
1661//
- -
1688nats_Open(int64_t lockSpinCount);
-
1689
-
1690
-
1695NATS_EXTERN const char*
- -
1697
-
1705NATS_EXTERN uint32_t
- -
1707
-
1708#ifdef BUILD_IN_DOXYGEN
- -
1724#else
-
1725
-
1726#define nats_CheckCompatibility() nats_CheckCompatibilityImpl(NATS_VERSION_REQUIRED_NUMBER, \
-
1727 NATS_VERSION_NUMBER, \
-
1728 NATS_VERSION_STRING)
-
1729
-
1730NATS_EXTERN bool
-
1731nats_CheckCompatibilityImpl(uint32_t reqVerNumber, uint32_t verNumber, const char *verString);
-
1732
-
1733#endif
+ +
+
1338
+
+
1356typedef struct kvEntryList
+
1357{
+ + +
1360
+ +
+
1362
+
+
1380typedef struct kvKeysList
+
1381{
+
1382 char **Keys;
+ +
1384
+ +
+
1386
+
1387#if defined(NATS_HAS_STREAMING)
+
1392typedef struct __stanConnection stanConnection;
+
1393
+
1398typedef struct __stanSubscription stanSubscription;
+
1399
+
1404typedef struct __stanMsg stanMsg;
+
1405
+
1410typedef struct __stanConnOptions stanConnOptions;
+
1411
+
1416typedef struct __stanSubOptions stanSubOptions;
+
1417#endif
+
1418
+ // end of typesGroup
1420
+
1421//
+
1422// Callbacks.
+
1423//
+
1424
+
1447typedef void (*natsMsgHandler)(
+
1448 natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure);
+
1449
+ +
1464 natsConnection *nc, void *closure);
+
1465
+
1472typedef void (*natsErrHandler)(
+
1473 natsConnection *nc, natsSubscription *subscription, natsStatus err,
+
1474 void *closure);
+
1475
+ +
1490 void **userData,
+
1491 void *loop,
+
1492 natsConnection *nc,
+
1493 natsSock socket);
+
1494
+ +
1505 void *userData,
+
1506 bool add);
+
1507
+ +
1518 void *userData,
+
1519 bool add);
+
1520
+ +
1529 void *userData);
+
1530
+ +
1553 char **userJWT,
+
1554 char **customErrTxt,
+
1555 void *closure);
+
1556
+
1557
+ +
1584 char **customErrTxt,
+
1585 unsigned char **signature,
+
1586 int *signatureLength,
+
1587 const char *nonce,
+
1588 void *closure);
+
1589
+
1598typedef const char* (*natsTokenHandler)(void *closure);
+
1599
+
1600
+
1608typedef void (*natsOnCompleteCB)(void *closure);
+
1609
+
1630typedef int64_t (*natsCustomReconnectDelayHandler)(natsConnection *nc, int attempts, void *closure);
+
1631
+
1632#ifdef BUILD_IN_DOXYGEN
+
1666typedef void (*jsPubAckErrHandler)(jsCtx *js, jsPubAckErr *pae, void *closure);
+
1667
+
1709typedef void (*jsPubAckHandler)(jsCtx *js, natsMsg *msg, jsPubAck *pa, jsPubAckErr *pae, void *closure);
+
1710#endif
+
1711
+
1712#if defined(NATS_HAS_STREAMING)
+
1721typedef void (*stanPubAckHandler)(const char *guid, const char *error, void *closure);
+
1722
+
1732typedef void (*stanMsgHandler)(
+
1733 stanConnection *sc, stanSubscription *sub, const char *channel, stanMsg *msg, void *closure);
1734
-
1739NATS_EXTERN int64_t
- -
1741
-
1747NATS_EXTERN int64_t
- -
1749
-
1757NATS_EXTERN void
-
1758nats_Sleep(int64_t sleepTime);
-
1759
-
1772NATS_EXTERN const char*
- -
1774
- -
1784nats_GetLastErrorStack(char *buffer, size_t bufLen);
+ +
1742 stanConnection *sc, const char* errorTxt, void *closure);
+
1743#endif
+
1744
+ // end of callbacksGroup
1746
+
1747//
+
1748// Functions.
+
1749//
+ +
1776nats_Open(int64_t lockSpinCount);
+
1777
+
1778
+
1783NATS_EXTERN const char*
+
1785
-
1806NATS_EXTERN void
- -
1808
- - -
1840
-
1851NATS_EXTERN void
- -
1853
- -
1879nats_Sign(const char *encodedSeed,
-
1880 const char *input,
-
1881 unsigned char **signature,
-
1882 int *signatureLength);
-
1883
-
1904NATS_EXTERN void
- -
1906
- -
1953nats_CloseAndWait(int64_t timeout);
-
1954 // end of libraryGroup
-
1956
-
1972NATS_EXTERN const char*
- -
1974 // end of statusGroup
-
1976
- - -
1996
- - -
2015 uint64_t *inMsgs, uint64_t *inBytes,
-
2016 uint64_t *outMsgs, uint64_t *outBytes,
-
2017 uint64_t *reconnects);
-
2018
-
2025NATS_EXTERN void
- -
2027 // end of statsGroup
-
2029
- - -
2056
-
2077/*
-
2078 * The above is for doxygen. The proper syntax for username/password
-
2079 * is without the '\' character:
-
2080 *
-
2081 * nats://localhost:4222
-
2082 * nats://user@localhost:4222
-
2083 * nats://user:password@localhost:4222
-
2084 */
- -
2086natsOptions_SetURL(natsOptions *opts, const char *url);
-
2087
- -
2103natsOptions_SetServers(natsOptions *opts, const char** servers, int serversCount);
-
2104
- -
2131natsOptions_SetUserInfo(natsOptions *opts, const char *user, const char *password);
-
2132
- -
2158natsOptions_SetToken(natsOptions *opts, const char *token);
-
2159
- - -
2177 void *closure);
-
2178
- - -
2190
- -
2204natsOptions_SetTimeout(natsOptions *opts, int64_t timeout);
-
2205
- -
2214natsOptions_SetName(natsOptions *opts, const char *name);
-
2215
- - -
2227
- - -
2243
- -
2270natsOptions_SetCATrustedCertificates(natsOptions *opts, const char *certificates);
-
2271
- - -
2288 const char *certsFileName,
-
2289 const char *keyFileName);
-
2290
- - -
2304 const char *cert,
-
2305 const char *key);
-
2306
- -
2323natsOptions_SetCiphers(natsOptions *opts, const char *ciphers);
-
2324
- -
2339natsOptions_SetCipherSuites(natsOptions *opts, const char *ciphers);
-
2340
- - -
2352
- - -
2365
- - +
1793NATS_EXTERN uint32_t
+ +
1795
+
1796#ifdef BUILD_IN_DOXYGEN
+ +
1812#else
+
1813
+
1814#define nats_CheckCompatibility() nats_CheckCompatibilityImpl(NATS_VERSION_REQUIRED_NUMBER, \
+
1815 NATS_VERSION_NUMBER, \
+
1816 NATS_VERSION_STRING)
+
1817
+
1818NATS_EXTERN bool
+
1819nats_CheckCompatibilityImpl(uint32_t reqVerNumber, uint32_t verNumber, const char *verString);
+
1820
+
1821#endif
+
1822
+
1827NATS_EXTERN int64_t
+ +
1829
+
1835NATS_EXTERN int64_t
+ +
1837
+
1845NATS_EXTERN void
+
1846nats_Sleep(int64_t sleepTime);
+
1847
+
1860NATS_EXTERN const char*
+ +
1862
+ +
1872nats_GetLastErrorStack(char *buffer, size_t bufLen);
+
1873
+
1894NATS_EXTERN void
+ +
1896
+ + +
1928
+
1939NATS_EXTERN void
+ +
1941
+ +
1967nats_Sign(const char *encodedSeed,
+
1968 const char *input,
+
1969 unsigned char **signature,
+
1970 int *signatureLength);
+
1971
+
1992NATS_EXTERN void
+ +
1994
+ +
2041nats_CloseAndWait(int64_t timeout);
+
2042
+ // end of libraryGroup
2044
+
2060NATS_EXTERN const char*
+ +
2062
+ // end of statusGroup
2064
+ + +
2084
+ + +
2103 uint64_t *inMsgs, uint64_t *inBytes,
+
2104 uint64_t *outMsgs, uint64_t *outBytes,
+
2105 uint64_t *reconnects);
+
2106
+
2113NATS_EXTERN void
+ +
2115
+ // end of statsGroup
2117
+ + +
2144
+
2165/*
+
2166 * The above is for doxygen. The proper syntax for username/password
+
2167 * is without the '\' character:
+
2168 *
+
2169 * nats://localhost:4222
+
2170 * nats://user@localhost:4222
+
2171 * nats://user:password@localhost:4222
+
2172 */
+ +
2174natsOptions_SetURL(natsOptions *opts, const char *url);
+
2175
+ +
2191natsOptions_SetServers(natsOptions *opts, const char** servers, int serversCount);
+
2192
+ +
2219natsOptions_SetUserInfo(natsOptions *opts, const char *user, const char *password);
+
2220
+ +
2246natsOptions_SetToken(natsOptions *opts, const char *token);
+
2247
+ + +
2265 void *closure);
+
2266
+ + +
2278
+ +
2292natsOptions_SetTimeout(natsOptions *opts, int64_t timeout);
+
2293
+ +
2302natsOptions_SetName(natsOptions *opts, const char *name);
+
2303
+ + +
2315
+ + +
2331
+ +
2358natsOptions_SetCATrustedCertificates(natsOptions *opts, const char *certificates);
+
2359
+ + +
2376 const char *certsFileName,
+
2377 const char *keyFileName);
2378
- - -
2391
- - -
2403
- - -
2417
- - -
2431
- - -
2445
- - -
2455
- -
2470natsOptions_SetReconnectWait(natsOptions *opts, int64_t reconnectWait);
-
2471
- -
2496natsOptions_SetReconnectJitter(natsOptions *opts, int64_t jitter, int64_t jitterTLS);
-
2497
- - - -
2519 void *closure);
-
2520
- - -
2535
- - -
2551
- - -
2568 void *closure);
-
2569
- - -
2584 void *closure);
+ + +
2392 const char *cert,
+
2393 const char *key);
+
2394
+ +
2411natsOptions_SetCiphers(natsOptions *opts, const char *ciphers);
+
2412
+ +
2427natsOptions_SetCipherSuites(natsOptions *opts, const char *ciphers);
+
2428
+ + +
2440
+ + +
2453
+ + +
2466
+ + +
2479
+ + +
2491
+ + +
2505
+ + +
2519
+ + +
2533
+ + +
2543
+ +
2558natsOptions_SetReconnectWait(natsOptions *opts, int64_t reconnectWait);
+
2559
+ +
2584natsOptions_SetReconnectJitter(natsOptions *opts, int64_t jitter, int64_t jitterTLS);
2585
- - -
2604 natsConnectionHandler disconnectedCb,
-
2605 void *closure);
-
2606
- - -
2624 natsConnectionHandler reconnectedCb,
-
2625 void *closure);
-
2626
- - -
2643 natsConnectionHandler discoveredServersCb,
-
2644 void *closure);
-
2645
- - -
2661
- - -
2680 natsConnectionHandler lameDuckCb,
-
2681 void *closure);
-
2682
- - -
2702 void *loop,
-
2703 natsEvLoop_Attach attachCb,
- - -
2706 natsEvLoop_Detach detachCb);
-
2707
- - -
2732
- - -
2757
- - -
2787
- - -
2799
- - -
2816
- - -
2837
- - -
2893 natsConnectionHandler connectedCb, void* closure);
-
2894
+ + + +
2607 void *closure);
+
2608
+ + +
2623
+ + +
2639
+ + +
2656 void *closure);
+
2657
+ + +
2672 void *closure);
+
2673
+ + +
2692 natsConnectionHandler disconnectedCb,
+
2693 void *closure);
+
2694
+ + +
2712 natsConnectionHandler reconnectedCb,
+
2713 void *closure);
+
2714
+ + +
2731 natsConnectionHandler discoveredServersCb,
+
2732 void *closure);
+
2733
+ + +
2749
+ + +
2768 natsConnectionHandler lameDuckCb,
+
2769 void *closure);
+
2770
+ + +
2790 void *loop,
+
2791 natsEvLoop_Attach attachCb,
+ + +
2794 natsEvLoop_Detach detachCb);
+
2795
+ + +
2820
+ + +
2845
+ + +
2875
+ + +
2887
+ + +
2904
- -
2925 natsUserJWTHandler ujwtCB,
-
2926 void *ujwtClosure,
- -
2928 void *sigClosure);
-
2929
- - -
2970 const char *userOrChainedFile,
-
2971 const char *seedFile);
-
2972
- - -
2987 const char *jwtAndSeedContent);
-
2988
- - -
3014 const char *pubKey,
- -
3016 void *sigClosure);
+ +
2925
+ + +
2981 natsConnectionHandler connectedCb, void* closure);
+
2982
+ + +
3013 natsUserJWTHandler ujwtCB,
+
3014 void *ujwtClosure,
+ +
3016 void *sigClosure);
3017
- - -
3044 const char *pubKey,
-
3045 const char *seedFile);
-
3046
- - -
3062
- - -
3099
- -
3116natsOptions_SetCustomInboxPrefix(natsOptions *opts, const char *inboxPrefix);
-
3117
- - -
3133
-
3141NATS_EXTERN void
- -
3143 // end of optsGroup
-
3145
-
3146#if defined(NATS_HAS_STREAMING)
- - -
3182
- - -
3206
- - -
3225
- - -
3237
- - -
3249
- - -
3259
-
3260
- -
3276stanConnOptions_SetMaxPubAcksInflight(stanConnOptions *opts, int maxPubAcksInflight, float percentage);
-
3277
- -
3294stanConnOptions_SetPings(stanConnOptions *opts, int interval, int maxOut);
-
3295
- - -
3308
-
3316NATS_EXTERN void
- -
3318 // end of stanConnOptsGroup
-
3320
- - -
3353
- -
3373stanSubOptions_SetDurableName(stanSubOptions *opts, const char *durableName);
-
3374
- - -
3390
- - -
3404
- - -
3422
- - -
3439
- - -
3453
- - -
3464
- - -
3474
- - -
3491
-
3499NATS_EXTERN void
- -
3501 // end of stanSubOptsGroup
-
3503#endif
-
3504
- - -
3526
-
3533NATS_EXTERN void
- -
3535 // end of inboxGroup
-
3537
-
3556NATS_EXTERN void
- -
3558
- -
3577natsMsg_Create(natsMsg **newMsg, const char *subj, const char *reply,
-
3578 const char *data, int dataLen);
+ + +
3058 const char *userOrChainedFile,
+
3059 const char *seedFile);
+
3060
+ + +
3075 const char *jwtAndSeedContent);
+
3076
+ + +
3102 const char *pubKey,
+ +
3104 void *sigClosure);
+
3105
+ + +
3132 const char *pubKey,
+
3133 const char *seedFile);
+
3134
+ + +
3150
+ + +
3187
+ +
3204natsOptions_SetCustomInboxPrefix(natsOptions *opts, const char *inboxPrefix);
+
3205
+ + +
3221
+
3229NATS_EXTERN void
+ +
3231
+ // end of optsGroup
3233
+
3234#if defined(NATS_HAS_STREAMING)
+ + +
3270
+ + +
3294
+ + +
3313
+ + +
3325
+ + +
3337
+ + +
3347
+
3348
+ +
3364stanConnOptions_SetMaxPubAcksInflight(stanConnOptions *opts, int maxPubAcksInflight, float percentage);
+
3365
+ +
3382stanConnOptions_SetPings(stanConnOptions *opts, int interval, int maxOut);
+
3383
+ + +
3396
+
3404NATS_EXTERN void
+ +
3406
+ // end of stanConnOptsGroup
3408
+ + +
3441
+ +
3461stanSubOptions_SetDurableName(stanSubOptions *opts, const char *durableName);
+
3462
+ + +
3478
+ + +
3492
+ + +
3510
+ + +
3527
+ + +
3541
+ + +
3552
+ + +
3562
+ +
3579
-
3588NATS_EXTERN const char*
- -
3590
-
3600NATS_EXTERN const char*
- -
3602
-
3618NATS_EXTERN const char*
- -
3620
-
3627NATS_EXTERN int
- -
3629
- -
3646natsMsgHeader_Set(natsMsg *msg, const char *key, const char *value);
-
3647
- -
3664natsMsgHeader_Add(natsMsg *msg, const char *key, const char *value);
-
3665
- -
3685natsMsgHeader_Get(natsMsg *msg, const char *key, const char **value);
-
3686
- -
3721natsMsgHeader_Values(natsMsg *msg, const char *key, const char* **values, int *count);
-
3722
- -
3753natsMsgHeader_Keys(natsMsg *msg, const char* **keys, int *count);
-
3754
- -
3769natsMsgHeader_Delete(natsMsg *msg, const char *key);
-
3770
-
3796NATS_EXTERN bool
- -
3798
-
3805NATS_EXTERN void
- -
3807 // end of msgGroup
-
3809
-
3810#if defined(NATS_HAS_STREAMING)
-
3823NATS_EXTERN uint64_t
- -
3825
-
3832NATS_EXTERN int64_t
- -
3834
-
3843NATS_EXTERN bool
- -
3845
-
3861NATS_EXTERN const char*
- -
3863
-
3870NATS_EXTERN int
- -
3872
-
3879NATS_EXTERN void
- -
3881 // end of stanMsgGroup
-
3883#endif
-
3884
- - -
3917
-
3928NATS_EXTERN void
- -
3930
-
3941NATS_EXTERN void
- -
3943
- - -
3964
-
3971NATS_EXTERN bool
- -
3973
-
3980NATS_EXTERN bool
- -
3982
-
3989bool
- -
3991
- - -
4002
-
4014NATS_EXTERN int
- -
4016
- - -
4034
- - -
4049
-
4059NATS_EXTERN int64_t
- +
3587NATS_EXTERN void
+ +
3589
+ // end of stanSubOptsGroup
3591#endif
+
3592
+ + +
3614
+
3621NATS_EXTERN void
+ +
3623
+ // end of inboxGroup
3625
+
3644NATS_EXTERN void
+ +
3646
+ +
3665natsMsg_Create(natsMsg **newMsg, const char *subj, const char *reply,
+
3666 const char *data, int dataLen);
+
3667
+
3676NATS_EXTERN const char*
+ +
3678
+
3688NATS_EXTERN const char*
+ +
3690
+
3706NATS_EXTERN const char*
+ +
3708
+
3715NATS_EXTERN int
+ +
3717
+ +
3734natsMsgHeader_Set(natsMsg *msg, const char *key, const char *value);
+
3735
+ +
3752natsMsgHeader_Add(natsMsg *msg, const char *key, const char *value);
+
3753
+ +
3773natsMsgHeader_Get(natsMsg *msg, const char *key, const char **value);
+
3774
+ +
3809natsMsgHeader_Values(natsMsg *msg, const char *key, const char* **values, int *count);
+
3810
+ +
3841natsMsgHeader_Keys(natsMsg *msg, const char* **keys, int *count);
+
3842
+ +
3857natsMsgHeader_Delete(natsMsg *msg, const char *key);
+
3858
+
3884NATS_EXTERN bool
+ +
3886
+
3893NATS_EXTERN void
+ +
3895
+ // end of msgGroup
3897
+
3898#if defined(NATS_HAS_STREAMING)
+
3911NATS_EXTERN uint64_t
+ +
3913
+
3920NATS_EXTERN int64_t
+ +
3922
+
3931NATS_EXTERN bool
+ +
3933
+
3949NATS_EXTERN const char*
+ +
3951
+
3958NATS_EXTERN int
+ +
3960
+
3967NATS_EXTERN void
+ +
3969
+ // end of stanMsgGroup
3971#endif
+
3972
+ + +
4005
+
4016NATS_EXTERN void
+ +
4018
+
4029NATS_EXTERN void
+ +
4031
+ + +
4052
+
4059NATS_EXTERN bool
+
4061
- - -
4073
- -
4084natsConnection_GetConnectedUrl(natsConnection *nc, char *buffer, size_t bufferSize);
-
4085
- -
4096natsConnection_GetConnectedServerId(natsConnection *nc, char *buffer, size_t bufferSize);
-
4097
- -
4119natsConnection_GetServers(natsConnection *nc, char ***servers, int *count);
-
4120
- -
4142natsConnection_GetDiscoveredServers(natsConnection *nc, char ***servers, int *count);
-
4143
- -
4157natsConnection_GetLastError(natsConnection *nc, const char **lastError);
-
4158
- - -
4174
- - -
4195
- - -
4215
- - -
4230 const unsigned char *message, int messageLen,
-
4231 unsigned char sig[64]);
-
4232
- - -
4253
- - -
4266
- - -
4276
- - -
4298
-
4308NATS_EXTERN void
- -
4310
-
4318NATS_EXTERN void
- -
4320 // end of connMgtGroup
-
4322
+
4068NATS_EXTERN bool
+ +
4070
+
4077bool
+ +
4079
+ + +
4090
+
4102NATS_EXTERN int
+ +
4104
+ + +
4122
+ + +
4137
+
4147NATS_EXTERN int64_t
+ +
4149
+ + +
4161
+ +
4172natsConnection_GetConnectedUrl(natsConnection *nc, char *buffer, size_t bufferSize);
+
4173
+ +
4184natsConnection_GetConnectedServerId(natsConnection *nc, char *buffer, size_t bufferSize);
+
4185
+ +
4207natsConnection_GetServers(natsConnection *nc, char ***servers, int *count);
+
4208
+ +
4230natsConnection_GetDiscoveredServers(natsConnection *nc, char ***servers, int *count);
+
4231
+ +
4245natsConnection_GetLastError(natsConnection *nc, const char **lastError);
+
4246
+ + +
4262
+ + +
4283
+ + +
4303
+ + +
4318 const unsigned char *message, int messageLen,
+
4319 unsigned char sig[64]);
+
4320
- -
4341 const void *data, int dataLen);
-
4342
- - -
4359 const char *str);
-
4360
- - -
4373
- - -
4388 const char *reply, const void *data, int dataLen);
-
4389
- - -
4408 const char *reply, const char *str);
-
4409
+ +
4341
+ + +
4354
+ + +
4364
+ + +
4386
+
4396NATS_EXTERN void
+ +
4398
+
4406NATS_EXTERN void
+ +
4408
+ // end of connMgtGroup
4410
-
4428natsConnection_Request(natsMsg **replyMsg, natsConnection *nc, const char *subj,
-
4429 const void *data, int dataLen, int64_t timeout);
+ +
4429 const void *data, int dataLen);
4430
- - -
4454 const char *subj, const char *str,
-
4455 int64_t timeout);
-
4456
- - -
4473 natsMsg *requestMsg, int64_t timeout);
-
4474 // end of connPubGroup
-
4476
- - -
4499 const char *subject, natsMsgHandler cb,
-
4500 void *cbClosure);
-
4501
- - -
4534 const char *subject, int64_t timeout,
-
4535 natsMsgHandler cb, void *cbClosure);
-
4536
- - -
4549 const char *subject);
-
4550
- - -
4570 const char *subject, const char *queueGroup,
-
4571 natsMsgHandler cb, void *cbClosure);
-
4572
- - -
4607 const char *subject, const char *queueGroup,
-
4608 int64_t timeout, natsMsgHandler cb, void *cbClosure);
-
4609
- - -
4623 const char *subject, const char *queueGroup);
-
4624 // end of connSubGroup
-
4626 // end of connGroup
-
4628
- - -
4649
- - -
4674 int64_t timeout);
-
4675
- - -
4686
- - -
4700
- - + + +
4447 const char *str);
+
4448
+ + +
4461
+ + +
4476 const char *reply, const void *data, int dataLen);
+
4477
+ + +
4496 const char *reply, const char *str);
+
4497
+ +
4516natsConnection_Request(natsMsg **replyMsg, natsConnection *nc, const char *subj,
+
4517 const void *data, int dataLen, int64_t timeout);
+
4518
+ + +
4542 const char *subj, const char *str,
+
4543 int64_t timeout);
+
4544
+ + +
4561 natsMsg *requestMsg, int64_t timeout);
+
4562
+ // end of connPubGroup
4564
+ + +
4587 const char *subject, natsMsgHandler cb,
+
4588 void *cbClosure);
+
4589
+ + +
4622 const char *subject, int64_t timeout,
+
4623 natsMsgHandler cb, void *cbClosure);
+
4624
+ + +
4637 const char *subject);
+
4638
+ + +
4658 const char *subject, const char *queueGroup,
+
4659 natsMsgHandler cb, void *cbClosure);
+
4660
+ + +
4695 const char *subject, const char *queueGroup,
+
4696 int64_t timeout, natsMsgHandler cb, void *cbClosure);
+
4697
+ + +
4711 const char *subject, const char *queueGroup);
4712
-
4721NATS_EXTERN int64_t
- -
4723
-
4734NATS_EXTERN const char*
- -
4736
- -
4758natsSubscription_SetPendingLimits(natsSubscription *sub, int msgLimit, int bytesLimit);
-
4759
- -
4780natsSubscription_GetPendingLimits(natsSubscription *sub, int *msgLimit, int *bytesLimit);
-
4781
- - -
4798
- - -
4809
- - -
4827
- - -
4842
- - -
4851
- - -
4880 int *pendingMsgs,
-
4881 int *pendingBytes,
-
4882 int *maxPendingMsgs,
-
4883 int *maxPendingBytes,
-
4884 int64_t *deliveredMsgs,
-
4885 int64_t *droppedMsgs);
+ // end of connSubGroup
4714
+ // end of connGroup
4716
+ + +
4737
+ + +
4762 int64_t timeout);
+
4763
+ + +
4774
+ + +
4788
+ + +
4800
+
4809NATS_EXTERN int64_t
+ +
4811
+
4822NATS_EXTERN const char*
+ +
4824
+ +
4846natsSubscription_SetPendingLimits(natsSubscription *sub, int msgLimit, int bytesLimit);
+
4847
+ +
4868natsSubscription_GetPendingLimits(natsSubscription *sub, int *msgLimit, int *bytesLimit);
+
4869
+ +
4886
-
4895NATS_EXTERN bool
- + +
4897
- - -
4917
- - -
4970
- - -
4995
- - -
5023
- - -
5054
-
5062NATS_EXTERN void
- -
5064 // end of subGroup
-
5066
-
5067#if defined(NATS_HAS_STREAMING)
- -
5109stanConnection_Connect(stanConnection **sc, const char *clusterID, const char *clientID,
-
5110 stanConnOptions *options);
+ + +
4915
+ + +
4930
+ + +
4939
+ + +
4968 int *pendingMsgs,
+
4969 int *pendingBytes,
+
4970 int *maxPendingMsgs,
+
4971 int *maxPendingBytes,
+
4972 int64_t *deliveredMsgs,
+
4973 int64_t *droppedMsgs);
+
4974
+
4983NATS_EXTERN bool
+ +
4985
+ + +
5005
+ + +
5058
+ + +
5083
+ +
5111
- - -
5136
-
5161NATS_EXTERN void
- -
5163
- - -
5176
- - -
5186 // end of stanConnMgtGroup
-
5188
- - -
5207 const void *data, int dataLen);
-
5208
- - -
5234 const void *data, int dataLen,
-
5235 stanPubAckHandler ah, void *ahClosure);
-
5236 // end of stanConnPubGroup
-
5238
- - -
5263 const char *channel, stanMsgHandler cb,
-
5264 void *cbClosure, stanSubOptions *options);
-
5265
- - -
5287 const char *channel, const char *queueGroup,
-
5288 stanMsgHandler cb, void *cbClosure, stanSubOptions *options);
-
5289 // end of stanConnSubGroup
-
5291 // end of stanConnGroup
-
5293
- - + + +
5142
+
5150NATS_EXTERN void
+ +
5152
+ // end of subGroup
5154
+
5155#if defined(NATS_HAS_STREAMING)
+ +
5197stanConnection_Connect(stanConnection **sc, const char *clusterID, const char *clientID,
+
5198 stanConnOptions *options);
+
5199
+ + +
5224
+
5249NATS_EXTERN void
+ +
5251
+ + +
5264
+ + +
5274
+ // end of stanConnMgtGroup
5276
+ + +
5295 const void *data, int dataLen);
+
5296
+ + +
5322 const void *data, int dataLen,
+
5323 stanPubAckHandler ah, void *ahClosure);
5324
- - -
5336
- - -
5358
- - -
5371
-
5379NATS_EXTERN void
- -
5381 // end of stanSubGroup
-
5383#endif
-
5384
- - -
5400
- - -
5417
-
5424NATS_EXTERN void
- -
5426
- - -
5442
- - -
5451
- - -
5460
- - + // end of stanConnPubGroup
5326
+ + +
5351 const char *channel, stanMsgHandler cb,
+
5352 void *cbClosure, stanSubOptions *options);
+
5353
+ + +
5375 const char *channel, const char *queueGroup,
+
5376 stanMsgHandler cb, void *cbClosure, stanSubOptions *options);
+
5377
+ // end of stanConnSubGroup
5379
+ // end of stanConnGroup
5381
+ + +
5412
+ + +
5424
+ + +
5446
+ + +
5459
+
5467NATS_EXTERN void
+
5469
- - -
5478
- - -
5500
- - -
5522
- -
5546js_PurgeStream(jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
-
5547
- -
5559js_DeleteStream(jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
-
5560
- -
5579js_GetMsg(natsMsg **msg, jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode);
-
5580
- -
5599js_GetLastMsg(natsMsg **msg, jsCtx *js, const char *stream, const char *subject, jsOptions *opts, jsErrCode *errCode);
-
5600
+ // end of stanSubGroup
5471#endif
+
5472
+ + +
5488
+ + +
5505
+
5512NATS_EXTERN void
+ +
5514
+ + +
5530
+ + +
5539
+ + +
5548
+ + +
5557
+ + +
5566
+ + +
5588
- +
5610
-
5634js_DirectGetMsg(natsMsg **msg, jsCtx *js, const char *stream, jsOptions *opts, jsDirectGetMsgOptions *dgOpts);
+
5634js_PurgeStream(jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
5635
- -
5653js_DeleteMsg(jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode);
-
5654
- -
5670js_EraseMsg(jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode);
-
5671
- -
5699js_GetStreamInfo(jsStreamInfo **si, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
-
5700
-
5707NATS_EXTERN void
- -
5709
- - -
5726
-
5736NATS_EXTERN void
- -
5738
- - -
5755
-
5765NATS_EXTERN void
- -
5767
- - -
5778
- - -
5800 const char *stream, jsConsumerConfig *cfg,
-
5801 jsOptions *opts, jsErrCode *errCode);
-
5802
- - -
5824 const char *stream, jsConsumerConfig *cfg,
-
5825 jsOptions *opts, jsErrCode *errCode);
+ +
5647js_DeleteStream(jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
+
5648
+ +
5667js_GetMsg(natsMsg **msg, jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode);
+
5668
+ +
5687js_GetLastMsg(natsMsg **msg, jsCtx *js, const char *stream, const char *subject, jsOptions *opts, jsErrCode *errCode);
+
5688
+ + +
5698
+ +
5722js_DirectGetMsg(natsMsg **msg, jsCtx *js, const char *stream, jsOptions *opts, jsDirectGetMsgOptions *dgOpts);
+
5723
+ +
5741js_DeleteMsg(jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode);
+
5742
+ +
5758js_EraseMsg(jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode);
+
5759
+ +
5787js_GetStreamInfo(jsStreamInfo **si, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
+
5788
+
5795NATS_EXTERN void
+ +
5797
+ + +
5814
+
5824NATS_EXTERN void
+
5826
- - -
5842 const char *stream, const char *consumer,
-
5843 jsOptions *opts, jsErrCode *errCode);
-
5844
- -
5857js_DeleteConsumer(jsCtx *js, const char *stream, const char *consumer,
-
5858 jsOptions *opts, jsErrCode *errCode);
-
5859
-
5866NATS_EXTERN void
- -
5868
- -
5884js_Consumers(jsConsumerInfoList **list, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
-
5885
-
5895NATS_EXTERN void
- -
5897
- -
5913js_ConsumerNames(jsConsumerNamesList **list, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
+ + +
5843
+
5853NATS_EXTERN void
+ +
5855
+ + +
5866
+ + +
5888 const char *stream, jsConsumerConfig *cfg,
+
5889 jsOptions *opts, jsErrCode *errCode);
+
5890
+ + +
5912 const char *stream, jsConsumerConfig *cfg,
+
5913 jsOptions *opts, jsErrCode *errCode);
5914
-
5924NATS_EXTERN void
- -
5926
- - -
5943
-
5950NATS_EXTERN void
- -
5952 // end of jsAssetsGroup
-
5954
- - -
5970
- -
5987js_Publish(jsPubAck **pubAck, jsCtx *js, const char *subj, const void *data, int dataLen,
-
5988 jsPubOptions *opts, jsErrCode *errCode);
-
5989
- - -
6011 jsPubOptions *opts, jsErrCode *errCode);
-
6012
-
6019NATS_EXTERN void
- -
6021
- -
6033js_PublishAsync(jsCtx *js, const char *subj, const void *data, int dataLen,
-
6034 jsPubOptions *opts);
-
6035
- - -
6061
- - -
6075
- - -
6126 // end of jsPubGroup
-
6128
- - -
6144
- -
6191js_Subscribe(natsSubscription **sub, jsCtx *js, const char *subject,
-
6192 natsMsgHandler cb, void* cbClosure,
-
6193 jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode);
-
6194
- -
6210js_SubscribeSync(natsSubscription **sub, jsCtx *js, const char *subject,
-
6211 jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode);
-
6212
- -
6235js_PullSubscribe(natsSubscription **sub, jsCtx *js, const char *subject, const char *durable,
-
6236 jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode);
-
6237
- -
6257natsSubscription_Fetch(natsMsgList *list, natsSubscription *sub, int batch, int64_t timeout,
-
6258 jsErrCode *errCode);
-
6259
- - -
6268
- - -
6283
- - -
6296 jsOptions *opts, jsErrCode *errCode);
-
6297
- - -
6327 // end of jsSubGroup
-
6329
- - -
6352
-
6359NATS_EXTERN void
- -
6361
- - -
6372
- - -
6386
- - -
6399
- -
6413natsMsg_NakWithDelay(natsMsg *msg, int64_t delay, jsOptions *opts);
-
6414
- - -
6425
- - -
6436
-
6446NATS_EXTERN uint64_t
- -
6448
-
6458NATS_EXTERN int64_t
- -
6460 // end of jsMsg
-
6462 // end of jsGroup
-
6464
- - -
6495
- - -
6512
- -
6529js_KeyValue(kvStore **new_kv, jsCtx *js, const char *bucket);
-
6530
- -
6541js_DeleteKeyValue(jsCtx *js, const char *bucket);
-
6542
-
6550NATS_EXTERN void
- -
6552 // end of kvGroupMgt
-
6554
-
6571NATS_EXTERN const char*
- -
6573
-
6580NATS_EXTERN const char*
- -
6582
-
6589NATS_EXTERN const void*
- -
6591
-
6598NATS_EXTERN int
- + + +
5930 const char *stream, const char *consumer,
+
5931 jsOptions *opts, jsErrCode *errCode);
+
5932
+ +
5945js_DeleteConsumer(jsCtx *js, const char *stream, const char *consumer,
+
5946 jsOptions *opts, jsErrCode *errCode);
+
5947
+
5954NATS_EXTERN void
+ +
5956
+ +
5972js_Consumers(jsConsumerInfoList **list, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
+
5973
+
5983NATS_EXTERN void
+ +
5985
+ +
6001js_ConsumerNames(jsConsumerNamesList **list, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
+
6002
+
6012NATS_EXTERN void
+ +
6014
+ + +
6031
+
6038NATS_EXTERN void
+ +
6040
+ // end of jsAssetsGroup
6042
+ + +
6058
+ +
6075js_Publish(jsPubAck **pubAck, jsCtx *js, const char *subj, const void *data, int dataLen,
+
6076 jsPubOptions *opts, jsErrCode *errCode);
+
6077
+ + +
6099 jsPubOptions *opts, jsErrCode *errCode);
+
6100
+
6107NATS_EXTERN void
+ +
6109
+ +
6121js_PublishAsync(jsCtx *js, const char *subj, const void *data, int dataLen,
+
6122 jsPubOptions *opts);
+
6123
+ + +
6149
+ + +
6163
+ + +
6214
+ // end of jsPubGroup
6216
+ + +
6232
+ +
6279js_Subscribe(natsSubscription **sub, jsCtx *js, const char *subject,
+
6280 natsMsgHandler cb, void* cbClosure,
+
6281 jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode);
+
6282
+ +
6298js_SubscribeSync(natsSubscription **sub, jsCtx *js, const char *subject,
+
6299 jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode);
+
6300
+ +
6323js_PullSubscribe(natsSubscription **sub, jsCtx *js, const char *subject, const char *durable,
+
6324 jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode);
+
6325
+ +
6345natsSubscription_Fetch(natsMsgList *list, natsSubscription *sub, int batch, int64_t timeout,
+
6346 jsErrCode *errCode);
+
6347
+ + +
6356
+ + +
6371
+ + +
6384 jsOptions *opts, jsErrCode *errCode);
+
6385
+ + +
6415
+ // end of jsSubGroup
6417
+ + +
6440
+
6447NATS_EXTERN void
+ +
6449
+ + +
6460
+ + +
6474
+ + +
6487
+ +
6501natsMsg_NakWithDelay(natsMsg *msg, int64_t delay, jsOptions *opts);
+
6502
+ + +
6513
+ + +
6524
+
6534NATS_EXTERN uint64_t
+ +
6536
+
6546NATS_EXTERN int64_t
+ +
6548
+ // end of jsMsg
6550
+ // end of jsGroup
6552
+ + +
6583
+ +
6600
-
6608NATS_EXTERN const char*
- -
6610
-
6617NATS_EXTERN uint64_t
- -
6619
-
6626NATS_EXTERN int64_t
- -
6628
-
6638NATS_EXTERN uint64_t
- + +
6617js_KeyValue(kvStore **new_kv, jsCtx *js, const char *bucket);
+
6618
+ +
6629js_DeleteKeyValue(jsCtx *js, const char *bucket);
+
6630
+
6638NATS_EXTERN void
+
6640
- - -
6651
-
6658NATS_EXTERN void
- -
6660 // end of kvEntry
-
6662
- -
6674kvStore_Get(kvEntry **new_entry, kvStore *kv, const char *key);
-
6675
- -
6689kvStore_GetRevision(kvEntry **new_entry, kvStore *kv, const char *key, uint64_t revision);
-
6690
- -
6702kvStore_Put(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len);
-
6703
- -
6718kvStore_PutString(uint64_t *rev, kvStore *kv, const char *key, const char *data);
-
6719
- -
6731kvStore_Create(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len);
-
6732
- -
6747kvStore_CreateString(uint64_t *rev, kvStore *kv, const char *key, const char *data);
+ // end of kvGroupMgt
6642
+
6659NATS_EXTERN const char*
+ +
6661
+
6668NATS_EXTERN const char*
+ +
6670
+
6677NATS_EXTERN const void*
+ +
6679
+
6686NATS_EXTERN int
+ +
6688
+
6696NATS_EXTERN const char*
+ +
6698
+
6705NATS_EXTERN uint64_t
+ +
6707
+
6714NATS_EXTERN int64_t
+ +
6716
+
6726NATS_EXTERN uint64_t
+ +
6728
+ + +
6739
+
6746NATS_EXTERN void
+
6748
- -
6761kvStore_Update(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len, uint64_t last);
-
6762
- -
6778kvStore_UpdateString(uint64_t *rev, kvStore *kv, const char *key, const char *data, uint64_t last);
-
6779
- -
6788kvStore_Delete(kvStore *kv, const char *key);
-
6789
- -
6799kvStore_Purge(kvStore *kv, const char *key, kvPurgeOptions *opts);
-
6800
- - -
6810
+ // end of kvEntry
6750
+ +
6762kvStore_Get(kvEntry **new_entry, kvStore *kv, const char *key);
+
6763
+ +
6777kvStore_GetRevision(kvEntry **new_entry, kvStore *kv, const char *key, uint64_t revision);
+
6778
+ +
6790kvStore_Put(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len);
+
6791
+ +
6806kvStore_PutString(uint64_t *rev, kvStore *kv, const char *key, const char *data);
+
6807
- +
6819kvStore_Create(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len);
6820
- - -
6840
- -
6858kvStore_Watch(kvWatcher **new_watcher, kvStore *kv, const char *keys, kvWatchOptions *opts);
-
6859
- - -
6876
- - -
6897
-
6909NATS_EXTERN void
- -
6911
- -
6935kvStore_History(kvEntryList *list, kvStore *kv, const char *key, kvWatchOptions *opts);
-
6936
-
6948NATS_EXTERN void
- -
6950
-
6960NATS_EXTERN const char*
- -
6962
-
6963// PurgeDeletes
+ +
6835kvStore_CreateString(uint64_t *rev, kvStore *kv, const char *key, const char *data);
+
6836
+ +
6849kvStore_Update(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len, uint64_t last);
+
6850
+ +
6866kvStore_UpdateString(uint64_t *rev, kvStore *kv, const char *key, const char *data, uint64_t last);
+
6867
+ +
6876kvStore_Delete(kvStore *kv, const char *key);
+
6877
+ +
6887kvStore_Purge(kvStore *kv, const char *key, kvPurgeOptions *opts);
+
6888
+ + +
6898
+ + +
6908
+ + +
6928
+ +
6946kvStore_Watch(kvWatcher **new_watcher, kvStore *kv, const char *keys, kvWatchOptions *opts);
+
6947
+ +
6964
- - -
6976
- -
7003kvWatcher_Next(kvEntry **new_entry, kvWatcher *w, int64_t timeout);
-
7004
- - -
7016
-
7023NATS_EXTERN void
- -
7025 // end of kvWatcher
-
7027
-
7044NATS_EXTERN const char*
- -
7046
-
7053NATS_EXTERN uint64_t
- -
7055
-
7062NATS_EXTERN int64_t
- + + +
6985
+
6997NATS_EXTERN void
+ +
6999
+ +
7023kvStore_History(kvEntryList *list, kvStore *kv, const char *key, kvWatchOptions *opts);
+
7024
+
7036NATS_EXTERN void
+ +
7038
+
7048NATS_EXTERN const char*
+ +
7050
+
7051// PurgeDeletes
+
7052
+ +
7064
-
7071NATS_EXTERN int64_t
- -
7073
-
7080NATS_EXTERN int64_t
- -
7082
-
7089NATS_EXTERN uint64_t
- -
7091
-
7098NATS_EXTERN void
- -
7100 // end of kvStatus
-
7102 // end of kvGroup
-
7104 // end of funcGroup
-
7106
-
7143#ifdef __cplusplus
-
7144}
-
7145#endif
-
7146
-
7147#endif /* NATS_H_ */
-
void(* natsOnCompleteCB)(void *closure)
Callback used to notify that an object lifecycle is complete.
Definition: nats.h:1520
-
natsStatus(* natsEvLoop_Attach)(void **userData, void *loop, natsConnection *nc, natsSock socket)
Attach this connection to the external event loop.
Definition: nats.h:1401
-
natsStatus(* natsUserJWTHandler)(char **userJWT, char **customErrTxt, void *closure)
Callback used to fetch and return account signed user JWT.
Definition: nats.h:1464
-
natsStatus(* natsEvLoop_WriteAddRemove)(void *userData, bool add)
Write event needs to be added or removed.
Definition: nats.h:1429
-
int64_t(* natsCustomReconnectDelayHandler)(natsConnection *nc, int attempts, void *closure)
Callback used to specify how long to wait between reconnects.
Definition: nats.h:1542
-
const char *(* natsTokenHandler)(void *closure)
Callback used to build a token on connections and reconnections.
Definition: nats.h:1510
-
void(* jsPubAckHandler)(jsCtx *js, natsMsg *msg, jsPubAck *pa, jsPubAckErr *pae, void *closure)
Callback used to process asynchronous publish responses from JetStream.
Definition: nats.h:1621
-
void(* jsPubAckErrHandler)(jsCtx *js, jsPubAckErr *pae, void *closure)
Callback used to process asynchronous publish errors from JetStream.
Definition: nats.h:1578
-
void(* natsErrHandler)(natsConnection *nc, natsSubscription *subscription, natsStatus err, void *closure)
Callback used to notify the user of errors encountered while processing inbound messages.
Definition: nats.h:1384
-
natsStatus(* natsEvLoop_Detach)(void *userData)
Detach from the event loop.
Definition: nats.h:1440
-
natsStatus(* natsSignatureHandler)(char **customErrTxt, unsigned char **signature, int *signatureLength, const char *nonce, void *closure)
Callback used to sign a nonce sent by the server.
Definition: nats.h:1495
-
void(* stanConnectionLostHandler)(stanConnection *sc, const char *errorTxt, void *closure)
Callback used to notify the user of the permanent loss of the connection.
Definition: nats.h:1653
-
void(* natsConnectionHandler)(natsConnection *nc, void *closure)
Callback used to notify the user of asynchronous connection events.
Definition: nats.h:1375
-
void(* natsMsgHandler)(natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure)
Callback used to deliver messages to the application.
Definition: nats.h:1359
-
void(* stanPubAckHandler)(const char *guid, const char *error, void *closure)
Callback used to notify of an asynchronous publish result.
Definition: nats.h:1633
-
natsStatus(* natsEvLoop_ReadAddRemove)(void *userData, bool add)
Read event needs to be added or removed.
Definition: nats.h:1416
-
void(* stanMsgHandler)(stanConnection *sc, stanSubscription *sub, const char *channel, stanMsg *msg, void *closure)
Callback used to deliver messages to the application.
Definition: nats.h:1644
+ +
7091kvWatcher_Next(kvEntry **new_entry, kvWatcher *w, int64_t timeout);
+
7092
+ + +
7104
+
7111NATS_EXTERN void
+ +
7113
+ // end of kvWatcher
7115
+
7132NATS_EXTERN const char*
+ +
7134
+
7141NATS_EXTERN uint64_t
+ +
7143
+
7150NATS_EXTERN int64_t
+ +
7152
+
7159NATS_EXTERN int64_t
+ +
7161
+
7168NATS_EXTERN int64_t
+ +
7170
+
7177NATS_EXTERN uint64_t
+ +
7179
+
7186NATS_EXTERN void
+ +
7188
+ // end of kvStatus
7190
+ // end of kvGroup
7192
+ // end of funcGroup
7194
+
7195//
+
7196// Microservices.
+
7197//
+
7198
+
7244typedef struct micro_client_s microClient;
+
7245
+
7249typedef struct __for_forward_compatibility_only microClientConfig;
+
7250
+
7260typedef struct micro_endpoint_s microEndpoint;
+
7261
+ +
7270
+ +
7281
+ +
7291
+
7304typedef struct micro_error_s microError;
+
7305
+
7313typedef struct micro_group_s microGroup;
+
7314
+
7320typedef struct micro_request_s microRequest;
+
7321
+
7333typedef struct micro_service_s microService;
+
7334
+ +
7345
+ +
7356
+ +
7364
+ // end of microTypes
7366
+
7385typedef microError *(*microRequestHandler)(microRequest *req);
+
7386
+ +
7410
+
7422typedef void (*microDoneHandler)(microService *m);
+
7423
+ // end of microCallbacks
7425
+
+ +
7437{
+
7443 const char *Name;
+
7444
+
7454 const char *Subject;
+
7455
+ +
7461
+ +
7466
+
7471 void *State;
+
7472};
+
+
7473
+
+ +
7478{
+
7482 const char *Name;
+
7483
+
7487 const char *Subject;
+
7488
+ +
7494};
+
+
7495
+
+ +
7500{
+
7501 const char *Name;
+
7502 const char *Subject;
+
7503
+ +
7508
+
7513 int64_t NumErrors;
+
7514
+ +
7519
+ +
7524
+ +
7529
+ +
7534};
+
+
7535
+
+ +
7543{
+
7549 const char *Name;
+
7550
+
7554 const char *Version;
+
7555
+
7559 const char *Description;
+
7560
+ +
7565
+ +
7574
+ +
7583
+ +
7592
+ +
7602
+
7610 void *State;
+
7611};
+
+
7612
+
+ +
7619{
+
7623 const char *Type;
+
7624
+
7628 const char *Name;
+
7629
+
7633 const char *Version;
+
7634
+
7638 const char *Description;
+
7639
+
7643 const char *Id;
+
7644
+ +
7649
+ +
7654
+ +
7659};
+
+
7660
+
+ +
7665{
+
7669 const char *Type;
+
7670
+
7674 const char *Name;
+
7675
+
7679 const char *Version;
+
7680
+
7684 const char *Id;
+
7685
+
7689 int64_t Started;
+
7690
+ +
7695
+ +
7700};
+
+
7701
+ // end of microStructs
7703
+
7715#define MICRO_API_PREFIX "$SRV"
+
7716
+
7720#define MICRO_INFO_RESPONSE_TYPE "io.nats.micro.v1.info_response"
+
7721
+
7725#define MICRO_INFO_VERB "INFO"
+
7726
+
7730#define MICRO_PING_RESPONSE_TYPE "io.nats.micro.v1.ping_response"
+
7731
+
7735#define MICRO_PING_VERB "PING"
+
7736
+
7740#define MICRO_STATS_RESPONSE_TYPE "io.nats.micro.v1.stats_response"
+
7741
+
7745#define MICRO_STATS_VERB "STATS"
+
7746
+
7751#define MICRO_STATUS_HDR "Nats-Status"
+
7752
+
7757#define MICRO_ERROR_HDR "Nats-Service-Error"
+
7758
+
7763#define MICRO_ERROR_CODE_HDR "Nats-Service-Error-Code"
+
7764
+ // end of microConstants
7766
+ + +
7798
+ + +
7814
+ +
7831microService_AddGroup(microGroup **new_group, microService *m, const char *prefix);
+
7832
+ + +
7846
+ + +
7857
+ + +
7872
+
7882NATS_EXTERN void *
+ +
7884
+ + +
7899
+
7908NATS_EXTERN bool
+ +
7910
+ + +
7924
+ +
7942
+ // end of microServiceFunctions
7944
+ +
7967microGroup_AddGroup(microGroup **new_group, microGroup *parent, const char *prefix);
+
7968
+ + +
7984
+ // end of microGroupFunctions
7986
+ +
8007microRequest_AddHeader(microRequest *req, const char *key, const char *value);
+
8008
+ + +
8020
+ + +
8031
+
8045NATS_EXTERN const char *
+ +
8047
+
8056NATS_EXTERN int
+ +
8058
+
8068NATS_EXTERN void *
+ +
8070
+ +
8088microRequest_GetHeaderKeys(microRequest *req, const char ***keys, int *count);
+
8089
+ +
8102microRequest_GetHeaderValue(microRequest *req, const char *key, const char **value);
+
8103
+ +
8120microRequest_GetHeaderValues(microRequest *req, const char *key, const char ***values, int *count);
+
8121
+ + +
8130
+
8140NATS_EXTERN const char *
+ +
8142
+ + +
8151
+
8160NATS_EXTERN void *
+ +
8162
+
8170NATS_EXTERN const char *
+ +
8172
+ +
8183microRequest_Respond(microRequest *req, const char *data, size_t len);
+
8184
+ + +
8201
+ +
8246microRequest_RespondCustom(microRequest *req, microError *err, const char *data, size_t len);
+
8247
+ +
8262microRequest_SetHeader(microRequest *req, const char *key, const char *value);
+
8263
+ // end of microRequestFunctions
8265
+ +
8282micro_Errorf(const char *format, ...);
+
8283
+ +
8296micro_ErrorfCode(int code, const char *format, ...);
+
8297
+ + +
8306
+
8313NATS_EXTERN int
+ +
8315
+
8320NATS_EXTERN void
+ +
8322
+
8323#define microError_Ignore(__err) microError_Destroy(__err)
+
8324
+ + +
8334
+
8346NATS_EXTERN const char *
+
8347microError_String(microError *err, char *buf, size_t len);
+
8348
+ +
8363microError_Wrapf(microError *err, const char *format, ...);
+
8364
+ // end of microErrorFunctions
8366
+ + +
8383
+
8389NATS_EXTERN void
+ +
8391
+ +
8405microClient_DoRequest(natsMsg **reply, microClient *client, const char *subject, const char *data, int data_len);
+
8406
+ // end of microClientFunctions
8408
+
8420NATS_EXTERN void
+ +
8422
+
8428NATS_EXTERN void
+ +
8430
+ // end of microCleanupFunctions
8432
+ // end of microFunctions
8434
+ // end of microGroup
8436
+
8473#ifdef __cplusplus
+
8474}
+
8475#endif
+
8476
+
8477#endif /* NATS_H_ */
+
void(* natsOnCompleteCB)(void *closure)
Callback used to notify that an object lifecycle is complete.
Definition nats.h:1608
+
natsStatus(* natsEvLoop_Attach)(void **userData, void *loop, natsConnection *nc, natsSock socket)
Attach this connection to the external event loop.
Definition nats.h:1489
+
natsStatus(* natsUserJWTHandler)(char **userJWT, char **customErrTxt, void *closure)
Callback used to fetch and return account signed user JWT.
Definition nats.h:1552
+
natsStatus(* natsEvLoop_WriteAddRemove)(void *userData, bool add)
Write event needs to be added or removed.
Definition nats.h:1517
+
int64_t(* natsCustomReconnectDelayHandler)(natsConnection *nc, int attempts, void *closure)
Callback used to specify how long to wait between reconnects.
Definition nats.h:1630
+
const char *(* natsTokenHandler)(void *closure)
Callback used to build a token on connections and reconnections.
Definition nats.h:1598
+
void(* jsPubAckHandler)(jsCtx *js, natsMsg *msg, jsPubAck *pa, jsPubAckErr *pae, void *closure)
Callback used to process asynchronous publish responses from JetStream.
Definition nats.h:1709
+
void(* jsPubAckErrHandler)(jsCtx *js, jsPubAckErr *pae, void *closure)
Callback used to process asynchronous publish errors from JetStream.
Definition nats.h:1666
+
void(* natsErrHandler)(natsConnection *nc, natsSubscription *subscription, natsStatus err, void *closure)
Callback used to notify the user of errors encountered while processing inbound messages.
Definition nats.h:1472
+
natsStatus(* natsEvLoop_Detach)(void *userData)
Detach from the event loop.
Definition nats.h:1528
+
natsStatus(* natsSignatureHandler)(char **customErrTxt, unsigned char **signature, int *signatureLength, const char *nonce, void *closure)
Callback used to sign a nonce sent by the server.
Definition nats.h:1583
+
void(* stanConnectionLostHandler)(stanConnection *sc, const char *errorTxt, void *closure)
Callback used to notify the user of the permanent loss of the connection.
Definition nats.h:1741
+
void(* natsConnectionHandler)(natsConnection *nc, void *closure)
Callback used to notify the user of asynchronous connection events.
Definition nats.h:1463
+
void(* natsMsgHandler)(natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure)
Callback used to deliver messages to the application.
Definition nats.h:1447
+
void(* stanPubAckHandler)(const char *guid, const char *error, void *closure)
Callback used to notify of an asynchronous publish result.
Definition nats.h:1721
+
natsStatus(* natsEvLoop_ReadAddRemove)(void *userData, bool add)
Read event needs to be added or removed.
Definition nats.h:1504
+
void(* stanMsgHandler)(stanConnection *sc, stanSubscription *sub, const char *channel, stanMsg *msg, void *closure)
Callback used to deliver messages to the application.
Definition nats.h:1732
NATS_EXTERN int natsConnection_Buffered(natsConnection *nc)
Returns the number of bytes to be sent to the server.
bool natsConnection_IsDraining(natsConnection *nc)
Test if connection is draining.
NATS_EXTERN void natsConnection_Close(natsConnection *nc)
Closes the connection.
@@ -2090,6 +2559,60 @@ $(document).ready(function(){initNavTree('nats_8h_source.html',''); initResizabl
NATS_EXTERN natsStatus nats_CloseAndWait(int64_t timeout)
Tear down the library and wait for all resources to be released.
NATS_EXTERN natsStatus nats_Sign(const char *encodedSeed, const char *input, unsigned char **signature, int *signatureLength)
Signs a given text using the provided private key.
NATS_EXTERN void nats_ReleaseThreadMemory(void)
Release thread-local memory possibly allocated by the library.
+
void(* microErrorHandler)(microService *m, microEndpoint *ep, natsStatus s)
Callback type for async error notifications.
Definition nats.h:7409
+
microError *(* microRequestHandler)(microRequest *req)
Callback type for request processing.
Definition nats.h:7385
+
void(* microDoneHandler)(microService *m)
Callback type for Done (service stopped) notifications.
Definition nats.h:7422
+
NATS_EXTERN void microServiceInfo_Destroy(microServiceInfo *info)
Destroys a microServiceInfo object.
+
NATS_EXTERN void microServiceStats_Destroy(microServiceStats *stats)
Destroys a microServiceStats object.
+
NATS_EXTERN microError * micro_NewClient(microClient **new_client, natsConnection *nc, microClientConfig *cfg)
Creates a new microservice client.
+
NATS_EXTERN void microClient_Destroy(microClient *client)
Destroys a microservice client.
+
NATS_EXTERN microError * microClient_DoRequest(natsMsg **reply, microClient *client, const char *subject, const char *data, int data_len)
Sends a request to a microservice and receives the response.
+
NATS_EXTERN void microError_Destroy(microError *err)
destroys a microError.
+
NATS_EXTERN natsStatus microError_Status(microError *err)
Returns the NATS status associated with the error.
+
NATS_EXTERN int microError_Code(microError *err)
returns the int code of the error.
+
NATS_EXTERN microError * micro_Errorf(const char *format,...)
creates a new microError, with a printf-like formatted message.
+
NATS_EXTERN microError * micro_ErrorfCode(int code, const char *format,...)
creates a new microError, with a code and a printf-like formatted message.
+
NATS_EXTERN const char * microError_String(microError *err, char *buf, size_t len)
Returns a printable string with the error message.
+
NATS_EXTERN microError * micro_ErrorFromStatus(natsStatus s)
Wraps a NATS status into a microError, if not a NATS_OK.
+
NATS_EXTERN microError * microError_Wrapf(microError *err, const char *format,...)
Wraps an exising microError with a higher printf-like formatted message.
+
NATS_EXTERN microError * microGroup_AddGroup(microGroup **new_group, microGroup *parent, const char *prefix)
Adds a sub-group to microGroup.
+
NATS_EXTERN microError * microGroup_AddEndpoint(microGroup *g, microEndpointConfig *config)
Adds an endpoint to a microGroup and starts listening for messages.
+
NATS_EXTERN microService * microRequest_GetService(microRequest *req)
Returns the pointer to the microservice associated with the request.
+
NATS_EXTERN int microRequest_GetDataLength(microRequest *req)
Returns the number of data bytes in the the request.
+
NATS_EXTERN microError * microRequest_RespondError(microRequest *req, microError *err)
Respond to a request with a simple error.
+
NATS_EXTERN const char * microRequest_GetSubject(microRequest *req)
Returns the subject of the request message.
+
NATS_EXTERN const char * microRequest_GetData(microRequest *req)
Returns the data in the the request, as a byte array.
+
NATS_EXTERN microError * microRequest_AddHeader(microRequest *req, const char *key, const char *value)
Adds a header to the underlying NATS request message.
+
NATS_EXTERN natsConnection * microRequest_GetConnection(microRequest *req)
Returns the connection associated with the request.
+
NATS_EXTERN natsMsg * microRequest_GetMsg(microRequest *req)
Get the NATS message underlying the request.
+
NATS_EXTERN void * microRequest_GetServiceState(microRequest *req)
Returns the pointer to the user-provided service state.
+
NATS_EXTERN microError * microRequest_Respond(microRequest *req, const char *data, size_t len)
Respond to a request, on the same NATS connection.
+
NATS_EXTERN microError * microRequest_GetHeaderKeys(microRequest *req, const char ***keys, int *count)
Gets the list of all header keys in the NATS message underlying the request.
+
NATS_EXTERN microError * microRequest_SetHeader(microRequest *req, const char *key, const char *value)
Add value to the header associated with key in the NATS message underlying the request.
+
NATS_EXTERN void * microRequest_GetEndpointState(microRequest *req)
Returns the pointer to the user-provided endpoint state, if the request is associated with an endpoin...
+
NATS_EXTERN microError * microRequest_GetHeaderValue(microRequest *req, const char *key, const char **value)
Get the header entry associated with key from the NATS message underlying the request.
+
NATS_EXTERN microError * microRequest_DeleteHeader(microRequest *req, const char *key)
Deletes a header from the underlying NATS request message.
+
NATS_EXTERN microError * microRequest_GetHeaderValues(microRequest *req, const char *key, const char ***values, int *count)
Get all header values associated with key from the NATS message underlying the request.
+
NATS_EXTERN microError * microRequest_RespondCustom(microRequest *req, microError *err, const char *data, size_t len)
Respond to a message, with an OK or an error.
+
NATS_EXTERN const char * microRequest_GetReply(microRequest *req)
Returns the reply subject set in this message.
+
NATS_EXTERN microError * microService_GetStats(microServiceStats **new_stats, microService *m)
Returns run-time statistics for a microservice.
+
NATS_EXTERN natsConnection * microService_GetConnection(microService *m)
Returns the connection associated with the service. If the service was successfully started,...
+
NATS_EXTERN microError * micro_AddService(microService **new_microservice, natsConnection *nc, microServiceConfig *config)
Creates and starts a new microservice.
+
NATS_EXTERN microError * microService_Destroy(microService *m)
Destroys a microservice, stopping it first if needed.
+
NATS_EXTERN microError * microService_Stop(microService *m)
Stops a running microservice.
+
NATS_EXTERN microError * microService_AddGroup(microGroup **new_group, microService *m, const char *prefix)
Adds an group (prefix) to a microservice.
+
NATS_EXTERN bool microService_IsStopped(microService *m)
Checks if the service is stopped.
+
NATS_EXTERN microError * microService_AddEndpoint(microService *m, microEndpointConfig *config)
Adds an endpoint to a microservice and starts listening for messages.
+
NATS_EXTERN microError * microService_GetInfo(microServiceInfo **new_info, microService *m)
Returns a microServiceInfo for a microservice.
+
NATS_EXTERN microError * microService_Run(microService *m)
Waits for a microservice to stop.
+
NATS_EXTERN void * microService_GetState(microService *m)
Returns the pointer to state data (closure). It is originally provided in microServiceConfig....
+
struct micro_client_s microClient
The Microservice client.
Definition nats.h:7244
+
struct micro_group_s microGroup
a collection of endpoints and other groups, with a common prefix to their subjects and names.
Definition nats.h:7313
+
struct micro_request_s microRequest
a request received by a microservice endpoint.
Definition nats.h:7320
+
struct micro_error_s microError
the Microservice error object.
Definition nats.h:7304
+
struct __for_forward_compatibility_only microClientConfig
The Microservice configuration object. For forward compatibility only.
Definition nats.h:7249
+
struct micro_endpoint_s microEndpoint
microEndpoint represents a microservice endpoint.
Definition nats.h:7260
+
struct micro_service_s microService
the main object for a configured microservice.
Definition nats.h:7333
NATS_EXTERN natsStatus natsMsg_Create(natsMsg **newMsg, const char *subj, const char *reply, const char *data, int dataLen)
Creates a natsMsg object.
NATS_EXTERN void natsMsgList_Destroy(natsMsgList *list)
Destroys this list of messages.
NATS_EXTERN int natsMsg_GetDataLength(const natsMsg *msg)
Returns the message length.
@@ -2226,349 +2749,418 @@ $(document).ready(function(){initNavTree('nats_8h_source.html',''); initResizabl
NATS_EXTERN natsStatus natsSubscription_SetOnCompleteCB(natsSubscription *sub, natsOnCompleteCB cb, void *closure)
Sets a completion callback.
NATS_EXTERN natsStatus natsSubscription_Unsubscribe(natsSubscription *sub)
Unsubscribes.
NATS_EXTERN natsStatus natsSubscription_ClearMaxPending(natsSubscription *sub)
Clears the statistics regarding the maximum pending values.
-
struct __stanSubOptions stanSubOptions
Way to configure a stanSubscription.
Definition: nats.h:1328
-
struct __kvStore kvStore
Definition: nats.h:1164
-
jsDeliverPolicy
Definition: nats.h:291
-
struct __stanConnOptions stanConnOptions
Way to configure a stanConnection.
Definition: nats.h:1322
-
jsStorageType
Definition: nats.h:281
-
char natsInbox
Unique subject often used for point-to-point communication.
Definition: nats.h:187
-
struct __stanMsg stanMsg
The Streaming message.
Definition: nats.h:1316
-
jsRetentionPolicy
Definition: nats.h:260
-
struct __kvWatcher kvWatcher
Definition: nats.h:1179
-
struct __natsStatistics natsStatistics
Statistics of a natsConnection.
Definition: nats.h:159
-
jsDiscardPolicy
Definition: nats.h:271
-
jsReplayPolicy
Definition: nats.h:317
-
struct __natsSubscription natsSubscription
Interest on a given subject.
Definition: nats.h:165
-
kvOperation
Definition: nats.h:1185
-
jsAckPolicy
Definition: nats.h:305
-
struct __stanConnection stanConnection
A connection to a NATS Streaming Server.
Definition: nats.h:1304
-
struct __jsCtx jsCtx
Definition: nats.h:227
-
struct __natsOptions natsOptions
Way to configure a natsConnection.
Definition: nats.h:178
-
struct __kvStatus kvStatus
Definition: nats.h:1174
-
struct __kvEntry kvEntry
Definition: nats.h:1169
-
struct __natsMsg natsMsg
A structure holding a subject, optional reply and payload.
Definition: nats.h:172
-
struct __stanSubscription stanSubscription
Interest on a given channel.
Definition: nats.h:1310
-
struct __natsConnection natsConnection
A connection to a NATS Server.
Definition: nats.h:152
-
@ js_DeliverByStartSequence
Starts from a given sequence.
Definition: nats.h:295
-
@ js_DeliverByStartTime
Starts from a given UTC time (number of nanoseconds since epoch)
Definition: nats.h:296
-
@ js_DeliverNew
Starts with messages sent after the consumer is created.
Definition: nats.h:294
-
@ js_DeliverLastPerSubject
Starts with the last message for all subjects received.
Definition: nats.h:297
-
@ js_DeliverLast
Starts with the last sequence received.
Definition: nats.h:293
-
@ js_DeliverAll
Starts from the very beginning of a stream. This is the default.
Definition: nats.h:292
-
@ js_FileStorage
Specifies on disk storage. It's the default.
Definition: nats.h:282
-
@ js_MemoryStorage
Specifies in memory only.
Definition: nats.h:283
-
@ js_LimitsPolicy
Specifies that messages are retained until any given limit is reached, which could be one of MaxMsgs,...
Definition: nats.h:261
-
@ js_InterestPolicy
Specifies that when all known observables have acknowledged a message it can be removed.
Definition: nats.h:262
-
@ js_WorkQueuePolicy
Specifies that when the first worker or subscriber acknowledges the message it can be removed.
Definition: nats.h:263
-
@ js_DiscardNew
Will fail to store new messages.
Definition: nats.h:273
-
@ js_DiscardOld
Will remove older messages to return to the limits. This is the default.
Definition: nats.h:272
-
@ js_ReplayInstant
Replays messages as fast as possible.
Definition: nats.h:318
-
@ js_ReplayOriginal
Maintains the same timing as the messages were received.
Definition: nats.h:319
-
@ kvOp_Unknown
Definition: nats.h:1186
-
@ kvOp_Delete
Definition: nats.h:1188
-
@ kvOp_Put
Definition: nats.h:1187
-
@ kvOp_Purge
Definition: nats.h:1189
-
@ js_AckExplicit
Requires ack or nack for all messages.
Definition: nats.h:306
-
@ js_AckAll
When acking a sequence number, this implicitly acks all sequences below this one as well.
Definition: nats.h:308
-
@ js_AckNone
Requires no acks for delivered messages.
Definition: nats.h:307
-
#define NATS_EXTERN
Needed for shared library.
Definition: nats.h:49
-
int natsSock
Definition: nats.h:50
+
struct __stanSubOptions stanSubOptions
Way to configure a stanSubscription.
Definition nats.h:1416
+
struct __kvStore kvStore
Definition nats.h:1252
+
jsStorageCompression
Definition nats.h:304
+
jsDeliverPolicy
Definition nats.h:313
+
struct __stanConnOptions stanConnOptions
Way to configure a stanConnection.
Definition nats.h:1410
+
jsStorageType
Definition nats.h:294
+
char natsInbox
Unique subject often used for point-to-point communication.
Definition nats.h:187
+
struct __stanMsg stanMsg
The Streaming message.
Definition nats.h:1404
+
jsRetentionPolicy
Definition nats.h:273
+
struct __kvWatcher kvWatcher
Definition nats.h:1267
+
struct __natsStatistics natsStatistics
Statistics of a natsConnection.
Definition nats.h:159
+
jsDiscardPolicy
Definition nats.h:284
+
jsReplayPolicy
Definition nats.h:339
+
struct __natsSubscription natsSubscription
Interest on a given subject.
Definition nats.h:165
+
kvOperation
Definition nats.h:1273
+
jsAckPolicy
Definition nats.h:327
+
struct __stanConnection stanConnection
A connection to a NATS Streaming Server.
Definition nats.h:1392
+
struct __jsCtx jsCtx
Definition nats.h:240
+
struct __natsOptions natsOptions
Way to configure a natsConnection.
Definition nats.h:178
+
struct __kvStatus kvStatus
Definition nats.h:1262
+
struct __kvEntry kvEntry
Definition nats.h:1257
+
struct __natsMsg natsMsg
A structure holding a subject, optional reply and payload.
Definition nats.h:172
+
struct __stanSubscription stanSubscription
Interest on a given channel.
Definition nats.h:1398
+
struct __natsConnection natsConnection
A connection to a NATS Server.
Definition nats.h:152
+
@ js_StorageCompressionNone
Specifies no compression. It's the default.
Definition nats.h:305
+
@ js_StorageCompressionS2
Specifies S2.
Definition nats.h:306
+
@ js_DeliverByStartSequence
Starts from a given sequence.
Definition nats.h:317
+
@ js_DeliverByStartTime
Starts from a given UTC time (number of nanoseconds since epoch)
Definition nats.h:318
+
@ js_DeliverNew
Starts with messages sent after the consumer is created.
Definition nats.h:316
+
@ js_DeliverLastPerSubject
Starts with the last message for all subjects received.
Definition nats.h:319
+
@ js_DeliverLast
Starts with the last sequence received.
Definition nats.h:315
+
@ js_DeliverAll
Starts from the very beginning of a stream. This is the default.
Definition nats.h:314
+
@ js_FileStorage
Specifies on disk storage. It's the default.
Definition nats.h:295
+
@ js_MemoryStorage
Specifies in memory only.
Definition nats.h:296
+
@ js_LimitsPolicy
Specifies that messages are retained until any given limit is reached, which could be one of MaxMsgs,...
Definition nats.h:274
+
@ js_InterestPolicy
Specifies that when all known observables have acknowledged a message it can be removed.
Definition nats.h:275
+
@ js_WorkQueuePolicy
Specifies that when the first worker or subscriber acknowledges the message it can be removed.
Definition nats.h:276
+
@ js_DiscardNew
Will fail to store new messages.
Definition nats.h:286
+
@ js_DiscardOld
Will remove older messages to return to the limits. This is the default.
Definition nats.h:285
+
@ js_ReplayInstant
Replays messages as fast as possible.
Definition nats.h:340
+
@ js_ReplayOriginal
Maintains the same timing as the messages were received.
Definition nats.h:341
+
@ kvOp_Unknown
Definition nats.h:1274
+
@ kvOp_Delete
Definition nats.h:1276
+
@ kvOp_Put
Definition nats.h:1275
+
@ kvOp_Purge
Definition nats.h:1277
+
@ js_AckExplicit
Requires ack or nack for all messages.
Definition nats.h:328
+
@ js_AckAll
When acking a sequence number, this implicitly acks all sequences below this one as well.
Definition nats.h:330
+
@ js_AckNone
Requires no acks for delivered messages.
Definition nats.h:329
+
#define NATS_EXTERN
Needed for shared library.
Definition nats.h:49
+
int natsSock
Definition nats.h:50
-
jsErrCode
Definition: status.h:135
-
natsStatus
Status returned by most of the APIs.
Definition: status.h:50
-
natsConnStatus
The connection state.
Definition: status.h:24
-
Definition: nats.h:953
-
uint64_t Total
Definition: nats.h:954
-
uint64_t Errors
Definition: nats.h:955
-
Definition: nats.h:990
-
int64_t Consumers
Definition: nats.h:994
-
int64_t Streams
Definition: nats.h:993
-
int TiersLen
Definition: nats.h:999
-
uint64_t Memory
Definition: nats.h:991
-
jsAPIStats API
Definition: nats.h:996
-
jsAccountLimits Limits
Definition: nats.h:997
-
jsTier ** Tiers
Definition: nats.h:998
-
char * Domain
Definition: nats.h:995
-
uint64_t Store
Definition: nats.h:992
-
Definition: nats.h:963
-
int64_t MemoryMaxStreamBytes
Definition: nats.h:969
-
int64_t MaxStreams
Definition: nats.h:966
-
int64_t MaxAckPending
Definition: nats.h:968
-
int64_t MaxConsumers
Definition: nats.h:967
-
int64_t MaxStore
Definition: nats.h:965
-
int64_t MaxMemory
Definition: nats.h:964
-
bool MaxBytesRequired
Definition: nats.h:971
-
int64_t StoreMaxStreamBytes
Definition: nats.h:970
-
Definition: nats.h:618
-
int ReplicasLen
Definition: nats.h:622
-
char * Name
Definition: nats.h:619
-
jsPeerInfo ** Replicas
Definition: nats.h:621
-
char * Leader
Definition: nats.h:620
-
Definition: nats.h:734
-
bool MemoryStorage
Definition: nats.h:771
-
const char * Name
Definition: nats.h:735
-
uint64_t OptStartSeq
Definition: nats.h:739
-
bool HeadersOnly
Definition: nats.h:754
-
uint64_t RateLimit
Definition: nats.h:748
-
jsDeliverPolicy DeliverPolicy
Definition: nats.h:738
-
const char * Description
Definition: nats.h:737
-
const char * Durable
Definition: nats.h:736
-
const char * SampleFrequency
Definition: nats.h:749
-
bool FlowControl
Definition: nats.h:752
-
int64_t MaxRequestBatch
Maximum Pull Consumer request batch size.
Definition: nats.h:757
-
int64_t AckWait
Definition: nats.h:742
-
int64_t MaxRequestMaxBytes
Maximum Pull Consumer request maximum bytes.
Definition: nats.h:759
-
int64_t OptStartTime
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:740
-
int64_t MaxWaiting
Definition: nats.h:750
-
jsAckPolicy AckPolicy
Definition: nats.h:741
-
const char * DeliverSubject
Definition: nats.h:762
-
int64_t * BackOff
Redelivery durations expressed in nanoseconds.
Definition: nats.h:744
-
int64_t MaxRequestExpires
Maximum Pull Consumer request expiration, expressed in number of nanoseconds.
Definition: nats.h:758
-
int64_t Heartbeat
Heartbeat interval expressed in number of nanoseconds.
Definition: nats.h:753
-
int64_t Replicas
Definition: nats.h:769
-
int BackOffLen
Definition: nats.h:745
-
int64_t MaxDeliver
Definition: nats.h:743
-
jsReplayPolicy ReplayPolicy
Definition: nats.h:747
-
const char * DeliverGroup
Definition: nats.h:763
-
int64_t MaxAckPending
Definition: nats.h:751
-
const char * FilterSubject
Definition: nats.h:746
-
int64_t InactiveThreshold
How long the server keeps an ephemeral after detecting loss of interest, expressed in number of nanos...
Definition: nats.h:766
-
Definition: nats.h:905
-
jsSequenceInfo Delivered
Definition: nats.h:910
-
jsConsumerConfig * Config
Definition: nats.h:909
-
bool PushBound
Definition: nats.h:917
-
int64_t NumWaiting
Definition: nats.h:914
-
int64_t Created
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:908
-
jsClusterInfo * Cluster
Definition: nats.h:916
-
int64_t NumAckPending
Definition: nats.h:912
-
char * Stream
Definition: nats.h:906
-
int64_t NumRedelivered
Definition: nats.h:913
-
char * Name
Definition: nats.h:907
-
jsSequenceInfo AckFloor
Definition: nats.h:911
-
uint64_t NumPending
Definition: nats.h:915
-
Definition: nats.h:929
-
jsConsumerInfo ** List
Definition: nats.h:930
-
int Count
Definition: nats.h:931
-
Definition: nats.h:943
-
int Count
Definition: nats.h:945
-
char ** List
Definition: nats.h:944
-
Definition: nats.h:793
-
uint64_t Stream
This is the stream sequence that the application should resume from.
Definition: nats.h:794
-
uint64_t ConsumerServer
This is the consumer sequence last sent by the server.
Definition: nats.h:796
-
uint64_t ConsumerClient
This is the consumer sequence that was last received by the library.
Definition: nats.h:795
-
Definition: nats.h:1063
-
const char * NextBySubject
Get the next message (based on sequence) for that subject.
Definition: nats.h:1065
-
uint64_t Sequence
Get the message at this sequence.
Definition: nats.h:1064
-
const char * LastBySubject
Get the last message on that subject.
Definition: nats.h:1066
-
Definition: nats.h:353
-
const char * DeliverPrefix
Definition: nats.h:355
-
const char * APIPrefix
Definition: nats.h:354
-
Definition: nats.h:1076
-
int64_t MaxBytes
Maximum bytes for the request (request complete based on whichever Batch or MaxBytes comes first)
Definition: nats.h:1079
-
int Batch
Maximum number of messages to be received (see MaxBytes)
Definition: nats.h:1078
-
int64_t Expires
Expiration of the request, expressed in nanoseconds.
Definition: nats.h:1077
-
bool NoWait
Will not wait if the request cannot be completed.
Definition: nats.h:1080
-
int64_t Heartbeat
Have server sends heartbeats to help detect communication failures.
Definition: nats.h:1081
-
Definition: nats.h:520
-
uint64_t * Msgs
Definition: nats.h:521
-
uint64_t Bytes
Definition: nats.h:523
-
int MsgsLen
Definition: nats.h:522
-
Definition: nats.h:1011
-
uint64_t NumPending
Definition: nats.h:1014
-
jsSequencePair Sequence
Definition: nats.h:1012
-
char * Stream
Definition: nats.h:1016
-
char * Domain
Definition: nats.h:1018
-
char * Consumer
Definition: nats.h:1017
-
uint64_t NumDelivered
Definition: nats.h:1013
-
int64_t Timestamp
Definition: nats.h:1015
-
Definition: nats.h:1100
-
jsPubAckErrHandler ErrHandler
Callback invoked when error encountered publishing a given message.
Definition: nats.h:1115
-
jsPubAckHandler AckHandler
Callback invoked for each asynchronous published message.
Definition: nats.h:1108
-
void * AckHandlerClosure
Closure (or user data) passed to jsPubAckHandler callback.
Definition: nats.h:1109
-
void * ErrHandlerClosure
Closure (or user data) passed to jsPubAckErrHandler callback.
Definition: nats.h:1116
-
int64_t StallWait
Amount of time (in milliseconds) to wait in a PublishAsync call when there is MaxPending inflight mes...
Definition: nats.h:1118
-
int64_t MaxPending
Maximum outstanding asynchronous publishes that can be inflight at one time.
Definition: nats.h:1101
- -
bool DeletedDetails
Get the list of deleted message sequences.
Definition: nats.h:1152
-
const char * SubjectsFilter
Get the list of subjects in this stream.
Definition: nats.h:1153
- -
uint64_t Sequence
Purge up to but not including sequence.
Definition: nats.h:1142
-
uint64_t Keep
Number of messages to keep.
Definition: nats.h:1143
-
const char * Subject
This is the subject to match against messages for the purge command.
Definition: nats.h:1141
-
Definition: nats.h:1129
+
jsErrCode
Definition status.h:135
+
natsStatus
Status returned by most of the APIs.
Definition status.h:50
+
natsConnStatus
The connection state.
Definition status.h:24
+
Definition nats.h:1041
+
uint64_t Total
Definition nats.h:1042
+
uint64_t Errors
Definition nats.h:1043
+
Definition nats.h:1078
+
int64_t Consumers
Definition nats.h:1082
+
int64_t Streams
Definition nats.h:1081
+
int TiersLen
Definition nats.h:1087
+
uint64_t Memory
Definition nats.h:1079
+
jsAPIStats API
Definition nats.h:1084
+
jsAccountLimits Limits
Definition nats.h:1085
+
jsTier ** Tiers
Definition nats.h:1086
+
char * Domain
Definition nats.h:1083
+
uint64_t Store
Definition nats.h:1080
+
Definition nats.h:1051
+
int64_t MemoryMaxStreamBytes
Definition nats.h:1057
+
int64_t MaxStreams
Definition nats.h:1054
+
int64_t MaxAckPending
Definition nats.h:1056
+
int64_t MaxConsumers
Definition nats.h:1055
+
int64_t MaxStore
Definition nats.h:1053
+
int64_t MaxMemory
Definition nats.h:1052
+
bool MaxBytesRequired
Definition nats.h:1059
+
int64_t StoreMaxStreamBytes
Definition nats.h:1058
+
Definition nats.h:688
+
int ReplicasLen
Definition nats.h:692
+
char * Name
Definition nats.h:689
+
jsPeerInfo ** Replicas
Definition nats.h:691
+
char * Leader
Definition nats.h:690
+
Definition nats.h:814
+
bool MemoryStorage
Definition nats.h:851
+
const char * Name
Definition nats.h:815
+
int FilterSubjectsLen
Definition nats.h:857
+
uint64_t OptStartSeq
Definition nats.h:819
+
bool HeadersOnly
Definition nats.h:834
+
uint64_t RateLimit
Definition nats.h:828
+
jsDeliverPolicy DeliverPolicy
Definition nats.h:818
+
const char * Description
Definition nats.h:817
+
const char * Durable
Definition nats.h:816
+
const char * SampleFrequency
Definition nats.h:829
+
bool FlowControl
Definition nats.h:832
+
int64_t MaxRequestBatch
Maximum Pull Consumer request batch size.
Definition nats.h:837
+
int64_t AckWait
Definition nats.h:822
+
int64_t MaxRequestMaxBytes
Maximum Pull Consumer request maximum bytes.
Definition nats.h:839
+
int64_t OptStartTime
UTC time expressed as number of nanoseconds since epoch.
Definition nats.h:820
+
int64_t MaxWaiting
Definition nats.h:830
+
jsAckPolicy AckPolicy
Definition nats.h:821
+
natsMetadata Metadata
Definition nats.h:860
+
const char * DeliverSubject
Definition nats.h:842
+
int64_t * BackOff
Redelivery durations expressed in nanoseconds.
Definition nats.h:824
+
int64_t MaxRequestExpires
Maximum Pull Consumer request expiration, expressed in number of nanoseconds.
Definition nats.h:838
+
int64_t Heartbeat
Heartbeat interval expressed in number of nanoseconds.
Definition nats.h:833
+
int64_t Replicas
Definition nats.h:849
+
int BackOffLen
Definition nats.h:825
+
int64_t MaxDeliver
Definition nats.h:823
+
const char ** FilterSubjects
Definition nats.h:856
+
jsReplayPolicy ReplayPolicy
Definition nats.h:827
+
const char * DeliverGroup
Definition nats.h:843
+
int64_t MaxAckPending
Definition nats.h:831
+
const char * FilterSubject
Definition nats.h:826
+
int64_t InactiveThreshold
How long the server keeps an ephemeral after detecting loss of interest, expressed in number of nanos...
Definition nats.h:846
+
Definition nats.h:993
+
jsSequenceInfo Delivered
Definition nats.h:998
+
jsConsumerConfig * Config
Definition nats.h:997
+
bool PushBound
Definition nats.h:1005
+
int64_t NumWaiting
Definition nats.h:1002
+
int64_t Created
UTC time expressed as number of nanoseconds since epoch.
Definition nats.h:996
+
jsClusterInfo * Cluster
Definition nats.h:1004
+
int64_t NumAckPending
Definition nats.h:1000
+
char * Stream
Definition nats.h:994
+
int64_t NumRedelivered
Definition nats.h:1001
+
char * Name
Definition nats.h:995
+
jsSequenceInfo AckFloor
Definition nats.h:999
+
uint64_t NumPending
Definition nats.h:1003
+
Definition nats.h:1017
+
jsConsumerInfo ** List
Definition nats.h:1018
+
int Count
Definition nats.h:1019
+
Definition nats.h:1031
+
int Count
Definition nats.h:1033
+
char ** List
Definition nats.h:1032
+
Definition nats.h:881
+
uint64_t Stream
This is the stream sequence that the application should resume from.
Definition nats.h:882
+
uint64_t ConsumerServer
This is the consumer sequence last sent by the server.
Definition nats.h:884
+
uint64_t ConsumerClient
This is the consumer sequence that was last received by the library.
Definition nats.h:883
+
Definition nats.h:1151
+
const char * NextBySubject
Get the next message (based on sequence) for that subject.
Definition nats.h:1153
+
uint64_t Sequence
Get the message at this sequence.
Definition nats.h:1152
+
const char * LastBySubject
Get the last message on that subject.
Definition nats.h:1154
+
Definition nats.h:375
+
const char * DeliverPrefix
Definition nats.h:377
+
const char * APIPrefix
Definition nats.h:376
+
Definition nats.h:1164
+
int64_t MaxBytes
Maximum bytes for the request (request complete based on whichever Batch or MaxBytes comes first)
Definition nats.h:1167
+
int Batch
Maximum number of messages to be received (see MaxBytes)
Definition nats.h:1166
+
int64_t Expires
Expiration of the request, expressed in nanoseconds.
Definition nats.h:1165
+
bool NoWait
Will not wait if the request cannot be completed.
Definition nats.h:1168
+
int64_t Heartbeat
Have server sends heartbeats to help detect communication failures.
Definition nats.h:1169
+
Definition nats.h:590
+
uint64_t * Msgs
Definition nats.h:591
+
uint64_t Bytes
Definition nats.h:593
+
int MsgsLen
Definition nats.h:592
+
Definition nats.h:1099
+
uint64_t NumPending
Definition nats.h:1102
+
jsSequencePair Sequence
Definition nats.h:1100
+
char * Stream
Definition nats.h:1104
+
char * Domain
Definition nats.h:1106
+
char * Consumer
Definition nats.h:1105
+
uint64_t NumDelivered
Definition nats.h:1101
+
int64_t Timestamp
Definition nats.h:1103
+
Definition nats.h:1188
+
jsPubAckErrHandler ErrHandler
Callback invoked when error encountered publishing a given message.
Definition nats.h:1203
+
jsPubAckHandler AckHandler
Callback invoked for each asynchronous published message.
Definition nats.h:1196
+
void * AckHandlerClosure
Closure (or user data) passed to jsPubAckHandler callback.
Definition nats.h:1197
+
void * ErrHandlerClosure
Closure (or user data) passed to jsPubAckErrHandler callback.
Definition nats.h:1204
+
int64_t StallWait
Amount of time (in milliseconds) to wait in a PublishAsync call when there is MaxPending inflight mes...
Definition nats.h:1206
+
int64_t MaxPending
Maximum outstanding asynchronous publishes that can be inflight at one time.
Definition nats.h:1189
+ +
bool DeletedDetails
Get the list of deleted message sequences.
Definition nats.h:1240
+
const char * SubjectsFilter
Get the list of subjects in this stream.
Definition nats.h:1241
+ +
uint64_t Sequence
Purge up to but not including sequence.
Definition nats.h:1230
+
uint64_t Keep
Number of messages to keep.
Definition nats.h:1231
+
const char * Subject
This is the subject to match against messages for the purge command.
Definition nats.h:1229
+
Definition nats.h:1217
struct jsOptions::jsOptionsStream::jsOptionsStreamInfo Info
Optional stream information retrieval options.
struct jsOptions::jsOptionsStream::jsOptionsStreamPurge Purge
Optional stream purge options.
-
Definition: nats.h:1091
+
Definition nats.h:1179
struct jsOptions::jsOptionsPublishAsync PublishAsync
-
int64_t Wait
Amount of time (in milliseconds) to wait for various JetStream API requests, default is 5000 ms (5 se...
Definition: nats.h:1094
-
const char * Prefix
JetStream prefix, default is "$JS.API".
Definition: nats.h:1092
-
const char * Domain
Domain changes the domain part of JetSteam API prefix.
Definition: nats.h:1093
+
int64_t Wait
Amount of time (in milliseconds) to wait for various JetStream API requests, default is 5000 ms (5 se...
Definition nats.h:1182
+
const char * Prefix
JetStream prefix, default is "$JS.API".
Definition nats.h:1180
+
const char * Domain
Domain changes the domain part of JetSteam API prefix.
Definition nats.h:1181
struct jsOptions::jsOptionsStream Stream
Optional stream options.
-
Definition: nats.h:604
-
bool Offline
Definition: nats.h:607
-
uint64_t Lag
Definition: nats.h:609
-
int64_t Active
Definition: nats.h:608
-
char * Name
Definition: nats.h:605
-
bool Current
Definition: nats.h:606
-
Definition: nats.h:336
-
int TagsLen
Definition: nats.h:339
-
const char * Cluster
Definition: nats.h:337
-
const char ** Tags
Definition: nats.h:338
-
Definition: nats.h:1039
-
natsMsg * Msg
Definition: nats.h:1040
-
natsStatus Err
Definition: nats.h:1041
-
jsErrCode ErrCode
Definition: nats.h:1042
-
const char * ErrText
Definition: nats.h:1043
-
Definition: nats.h:1026
-
uint64_t Sequence
Definition: nats.h:1028
-
bool Duplicate
Definition: nats.h:1030
-
char * Domain
Definition: nats.h:1029
-
char * Stream
Definition: nats.h:1027
-
Definition: nats.h:245
-
const char * ExpectLastMsgId
Expected last message ID in the stream.
Definition: nats.h:249
-
int64_t MaxWait
Amount of time (in milliseconds) to wait for a publish response, default will the context's Wait valu...
Definition: nats.h:246
-
uint64_t ExpectLastSeq
Expected last message sequence in the stream.
Definition: nats.h:250
-
bool ExpectNoMessage
Expected no message (that is, sequence == 0) for the subject in the stream.
Definition: nats.h:252
-
const char * ExpectStream
Expected stream to respond from the publish call.
Definition: nats.h:248
-
const char * MsgId
Message ID used for de-duplication.
Definition: nats.h:247
-
uint64_t ExpectLastSubjectSeq
Expected last message sequence for the subject in the stream.
Definition: nats.h:251
-
Definition: nats.h:389
-
bool HeadersOnly
Definition: nats.h:392
-
const char * Source
Definition: nats.h:390
-
const char * Destination
Definition: nats.h:391
-
Definition: nats.h:891
-
int64_t Last
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:894
-
uint64_t Stream
Definition: nats.h:893
-
uint64_t Consumer
Definition: nats.h:892
-
Definition: nats.h:881
-
uint64_t Consumer
Definition: nats.h:882
-
uint64_t Stream
Definition: nats.h:883
-
Definition: nats.h:642
-
const char * Name
Definition: nats.h:643
-
const char * Cluster
Definition: nats.h:645
-
const char * Domain
Definition: nats.h:644
-
Definition: nats.h:472
-
jsDiscardPolicy Discard
Definition: nats.h:484
-
const char ** Subjects
Definition: nats.h:475
-
bool AllowDirect
Definition: nats.h:507
-
int SourcesLen
Definition: nats.h:493
-
bool DiscardNewPerSubject
Definition: nats.h:512
-
const char * Description
Definition: nats.h:474
-
const char * Template
Definition: nats.h:488
-
bool DenyPurge
Restrict the ability to purge messages.
Definition: nats.h:496
-
jsStorageType Storage
Definition: nats.h:485
-
jsRetentionPolicy Retention
Definition: nats.h:477
-
int64_t MaxMsgs
Definition: nats.h:479
-
int64_t MaxConsumers
Definition: nats.h:478
-
const char * Name
Definition: nats.h:473
-
bool NoAck
Definition: nats.h:487
-
jsStreamSource ** Sources
Definition: nats.h:492
-
int32_t MaxMsgSize
Definition: nats.h:483
-
jsRePublish * RePublish
Definition: nats.h:504
-
bool MirrorDirect
Definition: nats.h:509
-
int64_t Duplicates
Definition: nats.h:489
-
int64_t MaxMsgsPerSubject
Definition: nats.h:482
-
int64_t MaxAge
Definition: nats.h:481
-
int SubjectsLen
Definition: nats.h:476
-
bool AllowRollup
Definition: nats.h:501
-
jsStreamSource * Mirror
Definition: nats.h:491
-
jsPlacement * Placement
Definition: nats.h:490
-
int64_t MaxBytes
Definition: nats.h:480
-
int64_t Replicas
Definition: nats.h:486
-
bool Sealed
Seal a stream so no messages can get our or in.
Definition: nats.h:494
-
bool DenyDelete
Restrict the ability to delete messages.
Definition: nats.h:495
-
Definition: nats.h:656
-
jsStreamSourceInfo ** Sources
Definition: nats.h:662
-
int64_t Created
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:658
-
jsStreamAlternate ** Alternates
Definition: nats.h:664
-
jsStreamState State
Definition: nats.h:659
-
jsClusterInfo * Cluster
Definition: nats.h:660
-
jsStreamSourceInfo * Mirror
Definition: nats.h:661
-
int AlternatesLen
Definition: nats.h:665
-
jsStreamConfig * Config
Definition: nats.h:657
-
int SourcesLen
Definition: nats.h:663
-
Definition: nats.h:677
-
jsStreamInfo ** List
Definition: nats.h:678
-
int Count
Definition: nats.h:679
-
Definition: nats.h:691
-
char ** List
Definition: nats.h:692
-
int Count
Definition: nats.h:693
-
Definition: nats.h:372
-
jsExternalStream * External
Definition: nats.h:377
-
int64_t OptStartTime
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:375
-
const char * Name
Definition: nats.h:373
-
const char * Domain
Definition: nats.h:381
-
uint64_t OptStartSeq
Definition: nats.h:374
-
const char * FilterSubject
Definition: nats.h:376
-
Definition: nats.h:630
-
int64_t Active
Definition: nats.h:634
-
char * Name
Definition: nats.h:631
-
jsExternalStream * External
Definition: nats.h:632
-
uint64_t Lag
Definition: nats.h:633
-
Definition: nats.h:582
-
jsLostStreamData * Lost
Definition: nats.h:594
-
uint64_t LastSeq
Definition: nats.h:587
-
int64_t Consumers
Definition: nats.h:595
-
int DeletedLen
Definition: nats.h:593
-
uint64_t Msgs
Definition: nats.h:583
-
jsStreamStateSubjects * Subjects
Definition: nats.h:590
-
uint64_t FirstSeq
Definition: nats.h:585
-
int64_t LastTime
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:588
-
int64_t NumSubjects
Definition: nats.h:589
-
uint64_t * Deleted
Definition: nats.h:592
-
uint64_t NumDeleted
Definition: nats.h:591
-
uint64_t Bytes
Definition: nats.h:584
-
int64_t FirstTime
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:586
-
Definition: nats.h:533
-
uint64_t Msgs
Definition: nats.h:535
-
const char * Subject
Definition: nats.h:534
-
Definition: nats.h:569
-
int Count
Definition: nats.h:571
-
jsStreamStateSubject * List
Definition: nats.h:570
-
Definition: nats.h:816
-
bool ManualAck
If true, the user will have to acknowledge the messages.
Definition: nats.h:861
-
const char * Consumer
If specified, the subscription will be bound to an existing consumer from the Stream without attempti...
Definition: nats.h:833
-
const char * Stream
If specified, the consumer will be bound to this stream name.
Definition: nats.h:823
-
bool Ordered
If true, this will be an ordered consumer.
Definition: nats.h:873
-
const char * Queue
Queue name for queue subscriptions.
Definition: nats.h:848
-
jsConsumerConfig Config
Consumer configuration.
Definition: nats.h:866
-
Definition: nats.h:976
-
const char * Name
Definition: nats.h:977
-
int64_t Streams
Definition: nats.h:980
-
uint64_t Store
Definition: nats.h:979
-
int64_t Consumers
Definition: nats.h:981
-
uint64_t Memory
Definition: nats.h:978
-
jsAccountLimits Limits
Definition: nats.h:982
-
Definition: nats.h:1199
-
uint8_t History
Definition: nats.h:1203
-
const char * Bucket
Definition: nats.h:1200
-
int64_t MaxBytes
Definition: nats.h:1205
-
int32_t MaxValueSize
Definition: nats.h:1202
-
int Replicas
Definition: nats.h:1207
-
const char * Description
Definition: nats.h:1201
-
jsStreamSource * Mirror
Definition: nats.h:1209
-
int64_t TTL
Definition: nats.h:1204
-
jsStorageType StorageType
Definition: nats.h:1206
-
jsRePublish * RePublish
Definition: nats.h:1208
-
int SourcesLen
Definition: nats.h:1211
-
jsStreamSource ** Sources
Definition: nats.h:1210
-
A list of KeyValue store entries.
Definition: nats.h:1269
-
kvEntry ** Entries
Definition: nats.h:1270
-
int Count
Definition: nats.h:1271
-
A list of KeyValue store keys.
Definition: nats.h:1293
-
int Count
Definition: nats.h:1295
-
char ** Keys
Definition: nats.h:1294
-
Definition: nats.h:1235
-
int64_t Timeout
Definition: nats.h:1237
-
int64_t DeleteMarkersOlderThan
Definition: nats.h:1247
-
Definition: nats.h:1221
-
bool IgnoreDeletes
Definition: nats.h:1222
-
bool IncludeHistory
Definition: nats.h:1223
-
int64_t Timeout
How long to wait (in milliseconds) for some operations to complete.
Definition: nats.h:1225
-
bool MetaOnly
Definition: nats.h:1224
-
A list of NATS messages.
Definition: nats.h:213
-
int Count
Definition: nats.h:215
-
natsMsg ** Msgs
Definition: nats.h:214
+
Definition nats.h:674
+
bool Offline
Definition nats.h:677
+
uint64_t Lag
Definition nats.h:679
+
int64_t Active
Definition nats.h:678
+
char * Name
Definition nats.h:675
+
bool Current
Definition nats.h:676
+
Definition nats.h:358
+
int TagsLen
Definition nats.h:361
+
const char * Cluster
Definition nats.h:359
+
const char ** Tags
Definition nats.h:360
+
Definition nats.h:1127
+
natsMsg * Msg
Definition nats.h:1128
+
natsStatus Err
Definition nats.h:1129
+
jsErrCode ErrCode
Definition nats.h:1130
+
const char * ErrText
Definition nats.h:1131
+
Definition nats.h:1114
+
uint64_t Sequence
Definition nats.h:1116
+
bool Duplicate
Definition nats.h:1118
+
char * Domain
Definition nats.h:1117
+
char * Stream
Definition nats.h:1115
+
Definition nats.h:258
+
const char * ExpectLastMsgId
Expected last message ID in the stream.
Definition nats.h:262
+
int64_t MaxWait
Amount of time (in milliseconds) to wait for a publish response, default will the context's Wait valu...
Definition nats.h:259
+
uint64_t ExpectLastSeq
Expected last message sequence in the stream.
Definition nats.h:263
+
bool ExpectNoMessage
Expected no message (that is, sequence == 0) for the subject in the stream.
Definition nats.h:265
+
const char * ExpectStream
Expected stream to respond from the publish call.
Definition nats.h:261
+
const char * MsgId
Message ID used for de-duplication.
Definition nats.h:260
+
uint64_t ExpectLastSubjectSeq
Expected last message sequence for the subject in the stream.
Definition nats.h:264
+
Definition nats.h:411
+
bool HeadersOnly
Definition nats.h:414
+
const char * Source
Definition nats.h:412
+
const char * Destination
Definition nats.h:413
+
Definition nats.h:979
+
int64_t Last
UTC time expressed as number of nanoseconds since epoch.
Definition nats.h:982
+
uint64_t Stream
Definition nats.h:981
+
uint64_t Consumer
Definition nats.h:980
+
Definition nats.h:969
+
uint64_t Consumer
Definition nats.h:970
+
uint64_t Stream
Definition nats.h:971
+
Definition nats.h:715
+
const char * Name
Definition nats.h:716
+
const char * Cluster
Definition nats.h:718
+
const char * Domain
Definition nats.h:717
+
Definition nats.h:517
+
jsDiscardPolicy Discard
Definition nats.h:529
+
const char ** Subjects
Definition nats.h:520
+
jsSubjectTransformConfig SubjectTransform
Definition nats.h:582
+
bool AllowDirect
Definition nats.h:552
+
int SourcesLen
Definition nats.h:538
+
bool DiscardNewPerSubject
Definition nats.h:557
+
jsStorageCompression Compression
Definition nats.h:580
+
const char * Description
Definition nats.h:519
+
const char * Template
Definition nats.h:533
+
bool DenyPurge
Restrict the ability to purge messages.
Definition nats.h:541
+
jsStorageType Storage
Definition nats.h:530
+
jsStreamConsumerLimits ConsumerLimits
Definition nats.h:583
+
jsRetentionPolicy Retention
Definition nats.h:522
+
int64_t MaxMsgs
Definition nats.h:524
+
int64_t MaxConsumers
Definition nats.h:523
+
natsMetadata Metadata
Configuration options introduced in 2.10.
Definition nats.h:579
+
uint64_t FirstSeq
Definition nats.h:581
+
const char * Name
Definition nats.h:518
+
bool NoAck
Definition nats.h:532
+
jsStreamSource ** Sources
Definition nats.h:537
+
int32_t MaxMsgSize
Definition nats.h:528
+
jsRePublish * RePublish
Definition nats.h:549
+
bool MirrorDirect
Definition nats.h:554
+
int64_t Duplicates
Definition nats.h:534
+
int64_t MaxMsgsPerSubject
Definition nats.h:527
+
int64_t MaxAge
Definition nats.h:526
+
int SubjectsLen
Definition nats.h:521
+
bool AllowRollup
Definition nats.h:546
+
jsStreamSource * Mirror
Definition nats.h:536
+
jsPlacement * Placement
Definition nats.h:535
+
int64_t MaxBytes
Definition nats.h:525
+
int64_t Replicas
Definition nats.h:531
+
bool Sealed
Seal a stream so no messages can get our or in.
Definition nats.h:539
+
bool DenyDelete
Restrict the ability to delete messages.
Definition nats.h:540
+
Definition nats.h:433
+
int MaxAckPending
Definition nats.h:435
+
int64_t InactiveThreshold
Definition nats.h:434
+
Definition nats.h:729
+
jsStreamSourceInfo ** Sources
Definition nats.h:735
+
int64_t Created
UTC time expressed as number of nanoseconds since epoch.
Definition nats.h:731
+
jsStreamAlternate ** Alternates
Definition nats.h:737
+
jsStreamState State
Definition nats.h:732
+
jsClusterInfo * Cluster
Definition nats.h:733
+
jsStreamSourceInfo * Mirror
Definition nats.h:734
+
int AlternatesLen
Definition nats.h:738
+
jsStreamConfig * Config
Definition nats.h:730
+
int SourcesLen
Definition nats.h:736
+
Definition nats.h:750
+
jsStreamInfo ** List
Definition nats.h:751
+
int Count
Definition nats.h:752
+
Definition nats.h:764
+
char ** List
Definition nats.h:765
+
int Count
Definition nats.h:766
+
Definition nats.h:394
+
jsExternalStream * External
Definition nats.h:399
+
int64_t OptStartTime
UTC time expressed as number of nanoseconds since epoch.
Definition nats.h:397
+
const char * Name
Definition nats.h:395
+
const char * Domain
Definition nats.h:403
+
uint64_t OptStartSeq
Definition nats.h:396
+
const char * FilterSubject
Definition nats.h:398
+
Definition nats.h:700
+
const char * FilterSubject
Definition nats.h:705
+
int64_t Active
Definition nats.h:704
+
int SubjectTransformsLen
Definition nats.h:707
+
char * Name
Definition nats.h:701
+
jsExternalStream * External
Definition nats.h:702
+
uint64_t Lag
Definition nats.h:703
+
jsSubjectTransformConfig * SubjectTransforms
Definition nats.h:706
+
Definition nats.h:652
+
jsLostStreamData * Lost
Definition nats.h:664
+
uint64_t LastSeq
Definition nats.h:657
+
int64_t Consumers
Definition nats.h:665
+
int DeletedLen
Definition nats.h:663
+
uint64_t Msgs
Definition nats.h:653
+
jsStreamStateSubjects * Subjects
Definition nats.h:660
+
uint64_t FirstSeq
Definition nats.h:655
+
int64_t LastTime
UTC time expressed as number of nanoseconds since epoch.
Definition nats.h:658
+
int64_t NumSubjects
Definition nats.h:659
+
uint64_t * Deleted
Definition nats.h:662
+
uint64_t NumDeleted
Definition nats.h:661
+
uint64_t Bytes
Definition nats.h:654
+
int64_t FirstTime
UTC time expressed as number of nanoseconds since epoch.
Definition nats.h:656
+
Definition nats.h:603
+
uint64_t Msgs
Definition nats.h:605
+
const char * Subject
Definition nats.h:604
+
Definition nats.h:639
+
int Count
Definition nats.h:641
+
jsStreamStateSubject * List
Definition nats.h:640
+
Definition nats.h:904
+
bool ManualAck
If true, the user will have to acknowledge the messages.
Definition nats.h:949
+
const char * Consumer
If specified, the subscription will be bound to an existing consumer from the Stream without attempti...
Definition nats.h:921
+
const char * Stream
If specified, the consumer will be bound to this stream name.
Definition nats.h:911
+
bool Ordered
If true, this will be an ordered consumer.
Definition nats.h:961
+
const char * Queue
Queue name for queue subscriptions.
Definition nats.h:936
+
jsConsumerConfig Config
Consumer configuration.
Definition nats.h:954
+
Definition nats.h:423
+
const char * Destination
Definition nats.h:425
+
const char * Source
Definition nats.h:424
+
Definition nats.h:1064
+
const char * Name
Definition nats.h:1065
+
int64_t Streams
Definition nats.h:1068
+
uint64_t Store
Definition nats.h:1067
+
int64_t Consumers
Definition nats.h:1069
+
uint64_t Memory
Definition nats.h:1066
+
jsAccountLimits Limits
Definition nats.h:1070
+
Definition nats.h:1287
+
uint8_t History
Definition nats.h:1291
+
const char * Bucket
Definition nats.h:1288
+
int64_t MaxBytes
Definition nats.h:1293
+
int32_t MaxValueSize
Definition nats.h:1290
+
int Replicas
Definition nats.h:1295
+
const char * Description
Definition nats.h:1289
+
jsStreamSource * Mirror
Definition nats.h:1297
+
int64_t TTL
Definition nats.h:1292
+
jsStorageType StorageType
Definition nats.h:1294
+
jsRePublish * RePublish
Definition nats.h:1296
+
int SourcesLen
Definition nats.h:1299
+
jsStreamSource ** Sources
Definition nats.h:1298
+
A list of KeyValue store entries.
Definition nats.h:1357
+
kvEntry ** Entries
Definition nats.h:1358
+
int Count
Definition nats.h:1359
+
A list of KeyValue store keys.
Definition nats.h:1381
+
int Count
Definition nats.h:1383
+
char ** Keys
Definition nats.h:1382
+
Definition nats.h:1323
+
int64_t Timeout
Definition nats.h:1325
+
int64_t DeleteMarkersOlderThan
Definition nats.h:1335
+
Definition nats.h:1309
+
bool IgnoreDeletes
Definition nats.h:1310
+
bool IncludeHistory
Definition nats.h:1311
+
int64_t Timeout
How long to wait (in milliseconds) for some operations to complete.
Definition nats.h:1313
+
bool MetaOnly
Definition nats.h:1312
+
Definition nats.h:7437
+
const char * Name
The name of the endpoint.
Definition nats.h:7443
+
microRequestHandler Handler
The request handler for the endpoint.
Definition nats.h:7465
+
const char * Subject
The NATS subject the endpoint will listen on.
Definition nats.h:7454
+
natsMetadata Metadata
Definition nats.h:7460
+
void * State
A user-provided pointer to store with the endpoint (state/closure).
Definition nats.h:7471
+
Definition nats.h:7478
+
const char * Subject
The semantic version of the service.
Definition nats.h:7487
+
const char * Name
The name of the service.
Definition nats.h:7482
+
natsMetadata Metadata
Definition nats.h:7493
+
Definition nats.h:7500
+
const char * Subject
Definition nats.h:7502
+
int64_t NumRequests
The number of requests received by the endpoint.
Definition nats.h:7507
+
char LastErrorString[2048]
a copy of the last error message.
Definition nats.h:7533
+
int64_t ProcessingTimeSeconds
total request processing time (the seconds part).
Definition nats.h:7518
+
int64_t ProcessingTimeNanoseconds
total request processing time (the nanoseconds part).
Definition nats.h:7523
+
int64_t NumErrors
The number of errors, service-level and internal, associated with the endpoint.
Definition nats.h:7513
+
int64_t AverageProcessingTimeNanoseconds
average request processing time, in ns.
Definition nats.h:7528
+
const char * Name
Definition nats.h:7501
+
The Microservice top-level configuration object.
Definition nats.h:7543
+
const char * Description
The description of the service.
Definition nats.h:7559
+
void * State
A user-provided pointer to state data.
Definition nats.h:7610
+
const char * Version
The (semantic) version of the service.
Definition nats.h:7554
+
microErrorHandler ErrHandler
An error notification handler.
Definition nats.h:7591
+
natsMetadata Metadata
Metadata for the service, a JSON-encoded user-provided object, e.g. {"key":"value"}
Definition nats.h:7564
+
microRequestHandler StatsHandler
A custom stats handler.
Definition nats.h:7582
+
microDoneHandler DoneHandler
A callback handler for handling the final cleanup Done event, right before the service is destroyed.
Definition nats.h:7601
+
const char * Name
The name of the service.
Definition nats.h:7549
+
microEndpointConfig * Endpoint
The "main" (aka default) endpoint configuration.
Definition nats.h:7573
+
Definition nats.h:7619
+
natsMetadata Metadata
Metadata for the service, a JSON-encoded user-provided object, e.g. {"key":"value"}
Definition nats.h:7648
+
const char * Name
The name of the service.
Definition nats.h:7628
+
const char * Version
The semantic version of the service.
Definition nats.h:7633
+
const char * Type
Response type. Always "io.nats.micro.v1.info_response".
Definition nats.h:7623
+
const char * Id
The ID of the service instance responding to the request.
Definition nats.h:7643
+
microEndpointInfo * Endpoints
Endpoints.
Definition nats.h:7653
+
const char * Description
The description of the service.
Definition nats.h:7638
+
int EndpointsLen
The number of endpoints in the Endpoints array.
Definition nats.h:7658
+
Definition nats.h:7665
+
int64_t Started
The timestamp of when the service was started.
Definition nats.h:7689
+
int EndpointsLen
The number of endpoints in the endpoints array.
Definition nats.h:7699
+
microEndpointStats * Endpoints
The stats for each endpoint of the service.
Definition nats.h:7694
+
const char * Version
The semantic version of the service.
Definition nats.h:7679
+
const char * Name
The name of the service.
Definition nats.h:7674
+
const char * Type
Response type. Always "io.nats.micro.v1.stats_response".
Definition nats.h:7669
+
const char * Id
The ID of the service instance responding to the request.
Definition nats.h:7684
+
A type to represent user-provided metadata, a list of k=v pairs.
Definition nats.h:225
+
int Count
Definition nats.h:229
+
const char ** List
Definition nats.h:227
+
A list of NATS messages.
Definition nats.h:213
+
int Count
Definition nats.h:215
+
natsMsg ** Msgs
Definition nats.h:214
diff --git a/deps/nats.c/doc/html/navtree.css b/deps/nats.c/doc/html/navtree.css index c8a7766..69211d4 100644 --- a/deps/nats.c/doc/html/navtree.css +++ b/deps/nats.c/doc/html/navtree.css @@ -42,7 +42,6 @@ text-decoration:none; padding:0px; margin:0px; - outline:none; } #nav-tree .label { diff --git a/deps/nats.c/doc/html/navtree.js b/deps/nats.c/doc/html/navtree.js index 2798368..93dd3d4 100644 --- a/deps/nats.c/doc/html/navtree.js +++ b/deps/nats.c/doc/html/navtree.js @@ -94,7 +94,7 @@ function cachedLink() } } -function getScript(scriptName,func,show) +function getScript(scriptName,func) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement('script'); @@ -124,7 +124,7 @@ function createIndent(o,domNode,node,level) node.plus_img.innerHTML=arrowRight; node.expanded = false; } else { - expandNode(o, node, false, false); + expandNode(o, node, false, true); } } node.expandToggle.appendChild(imgNode); @@ -265,15 +265,15 @@ function showRoot() })(); } -function expandNode(o, node, imm, showRoot) +function expandNode(o, node, imm, setFocus) { if (node.childrenData && !node.expanded) { if (typeof(node.childrenData)==='string') { var varName = node.childrenData; getScript(node.relpath+varName,function(){ node.childrenData = getData(varName); - expandNode(o, node, imm, showRoot); - }, showRoot); + expandNode(o, node, imm, setFocus); + }); } else { if (!node.childrenVisited) { getNode(o, node); @@ -281,6 +281,9 @@ function expandNode(o, node, imm, showRoot) $(node.getChildrenUL()).slideDown("fast"); node.plus_img.innerHTML = arrowDown; node.expanded = true; + if (setFocus) { + $(node.expandToggle).focus(); + } } } } @@ -344,7 +347,7 @@ function showNode(o, node, index, hash) getScript(node.relpath+varName,function(){ node.childrenData = getData(varName); showNode(o,node,index,hash); - },true); + }); } else { if (!node.childrenVisited) { getNode(o, node); @@ -362,11 +365,11 @@ function showNode(o, node, index, hash) n.childrenData = getData(varName); node.expanded=false; showNode(o,node,index,hash); // retry with child node expanded - },true); + }); } else { var rootBase = stripPath(o.toroot.replace(/\..+$/, '')); if (rootBase=="index" || rootBase=="pages" || rootBase=="search") { - expandNode(o, n, true, true); + expandNode(o, n, true, false); } selectAndHighlight(hash,n); } @@ -444,7 +447,7 @@ function navTo(o,root,hash,relpath) if (navTreeSubIndices[i]) { gotoNode(o,i,root,hash,relpath); } - },true); + }); } } @@ -545,5 +548,12 @@ function initNavTree(toroot,relpath) navTo(o,toroot,hashUrl(),relpath); } }) + + $("div.toc a[href]").click(function(e) { + e.preventDefault(); + var docContent = $('#doc-content'); + var aname = $(this).attr("href"); + gotoAnchor($(aname),aname,true); + }) } /* @license-end */ diff --git a/deps/nats.c/doc/html/navtreedata.js b/deps/nats.c/doc/html/navtreedata.js index 2e6e1c4..ea0e32a 100644 --- a/deps/nats.c/doc/html/navtreedata.js +++ b/deps/nats.c/doc/html/navtreedata.js @@ -27,7 +27,7 @@ var NAVTREE = [ "NATS C Client with JetStream and Streaming support", "index.html", [ [ "NATS C client.", "index.html", "index" ], [ "Deprecated List", "deprecated.html", null ], - [ "Modules", "modules.html", "modules" ], + [ "Topics", "topics.html", "topics" ], [ "Classes", "annotated.html", [ [ "Class List", "annotated.html", "annotated_dup" ], [ "Class Index", "classes.html", null ], @@ -53,10 +53,10 @@ var NAVTREE = var NAVTREEINDEX = [ "annotated.html", -"group__libevent_functions.html#ga30c00f21a5251ee9fde09c1f2b429cd2", -"group__types_group.html#gga410f8fb053efa02b2ca1de0c02fa4b6dae874de4a787cfbec4c6d0eb1a3f05ebd", -"structjs_consumer_config.html#a2f0243899885dc97f304f48ca52b5356", -"structkv_keys_list.html#aa5cb40820a1a927375215e0a94ecfc18" +"group__kv_watcher.html#ga562c216a0199c30455af4c2da46000e5", +"group__sub_group.html#ga5a029a784c0a7f8b5800b48cc995db20", +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70ae7479c265d0e8cace4ab19a59cfcbbbb", +"structjs_stream_config.html#a7338c82c8cbfcd5f4bfb7ad34b1d8395" ]; var SYNCONMSG = 'click to disable panel synchronisation'; diff --git a/deps/nats.c/doc/html/navtreeindex0.js b/deps/nats.c/doc/html/navtreeindex0.js index 5c6c0ac..4a46295 100644 --- a/deps/nats.c/doc/html/navtreeindex0.js +++ b/deps/nats.c/doc/html/navtreeindex0.js @@ -25,6 +25,7 @@ var NAVTREEINDEX0 = "functions_r.html":[3,2,0,15], "functions_s.html":[3,2,0,16], "functions_t.html":[3,2,0,17], +"functions_v.html":[3,2,0,18], "functions_vars.html":[3,2,1], "functions_vars.html":[3,2,1,0], "functions_vars_b.html":[3,2,1,1], @@ -44,8 +45,9 @@ var NAVTREEINDEX0 = "functions_vars_r.html":[3,2,1,15], "functions_vars_s.html":[3,2,1,16], "functions_vars_t.html":[3,2,1,17], -"functions_vars_w.html":[3,2,1,18], -"functions_w.html":[3,2,0,18], +"functions_vars_v.html":[3,2,1,18], +"functions_vars_w.html":[3,2,1,19], +"functions_w.html":[3,2,0,19], "globals.html":[4,1,0], "globals.html":[4,1,0,0], "globals_defs.html":[4,1,5], @@ -54,11 +56,13 @@ var NAVTREEINDEX0 = "globals_func.html":[4,1,1], "globals_func.html":[4,1,1,0], "globals_func_k.html":[4,1,1,1], -"globals_func_n.html":[4,1,1,2], -"globals_func_s.html":[4,1,1,3], +"globals_func_m.html":[4,1,1,2], +"globals_func_n.html":[4,1,1,3], +"globals_func_s.html":[4,1,1,4], "globals_k.html":[4,1,0,1], -"globals_n.html":[4,1,0,2], -"globals_s.html":[4,1,0,3], +"globals_m.html":[4,1,0,2], +"globals_n.html":[4,1,0,3], +"globals_s.html":[4,1,0,4], "globals_type.html":[4,1,2], "group__callbacks_group.html":[2,1], "group__callbacks_group.html#ga245131e64f1d0dff7edc8ed874a07e9a":[2,1,10], @@ -124,7 +128,7 @@ var NAVTREEINDEX0 = "group__conn_sub_group.html#ga96fa115fd5b2ef7658884da80714b91c":[2,2,9,2,4], "group__conn_sub_group.html#gacb2c83b58b7909715424cbc327fdd404":[2,2,9,2,1], "group__conn_sub_group.html#gaefab965b5645798d47f9244f2b3fe3fb":[2,2,9,2,0], -"group__env_variables_group.html":[2,4], +"group__env_variables_group.html":[2,5], "group__func_group.html":[2,2], "group__inbox_group.html":[2,2,6], "group__inbox_group.html#gaa1ec779a0b7ead54b78da05533848b6d":[2,2,6,0], @@ -245,9 +249,5 @@ var NAVTREEINDEX0 = "group__kv_status.html#gaa747ad0a6182ec7a47fb47018c33d1c1":[2,2,14,3,3], "group__kv_status.html#gada6f22b5659b184762cea4f45d369ee5":[2,2,14,3,2], "group__kv_watcher.html":[2,2,14,2], -"group__kv_watcher.html#ga21bc39fa795f7c4f392bd6d4e66ea1d9":[2,2,14,2,2], -"group__kv_watcher.html#ga562c216a0199c30455af4c2da46000e5":[2,2,14,2,0], -"group__kv_watcher.html#ga73adf44114fedd62ef75ebd81839b65e":[2,2,14,2,1], -"group__libevent_functions.html":[2,5], -"group__libevent_functions.html#ga195d269473332931fd0fede0bac3309e":[2,5,0] +"group__kv_watcher.html#ga21bc39fa795f7c4f392bd6d4e66ea1d9":[2,2,14,2,2] }; diff --git a/deps/nats.c/doc/html/navtreeindex1.js b/deps/nats.c/doc/html/navtreeindex1.js index 011f0b9..9bece9e 100644 --- a/deps/nats.c/doc/html/navtreeindex1.js +++ b/deps/nats.c/doc/html/navtreeindex1.js @@ -1,9 +1,13 @@ var NAVTREEINDEX1 = { -"group__libevent_functions.html#ga30c00f21a5251ee9fde09c1f2b429cd2":[2,5,1], -"group__libevent_functions.html#ga7ac99f326a59e5663ff66f5023c87091":[2,5,3], -"group__libevent_functions.html#ga8a14ce23b4f6ba3bf63369961f9a5552":[2,5,2], -"group__libevent_functions.html#gaac76f5937329a8650f69c6bd8af36cd5":[2,5,4], +"group__kv_watcher.html#ga562c216a0199c30455af4c2da46000e5":[2,2,14,2,0], +"group__kv_watcher.html#ga73adf44114fedd62ef75ebd81839b65e":[2,2,14,2,1], +"group__libevent_functions.html":[2,6], +"group__libevent_functions.html#ga195d269473332931fd0fede0bac3309e":[2,6,0], +"group__libevent_functions.html#ga30c00f21a5251ee9fde09c1f2b429cd2":[2,6,1], +"group__libevent_functions.html#ga7ac99f326a59e5663ff66f5023c87091":[2,6,3], +"group__libevent_functions.html#ga8a14ce23b4f6ba3bf63369961f9a5552":[2,6,2], +"group__libevent_functions.html#gaac76f5937329a8650f69c6bd8af36cd5":[2,6,4], "group__library_group.html":[2,2,0], "group__library_group.html#ga0d8c3df1c0c4a3d340d8ff81355fb1e8":[2,2,0,1], "group__library_group.html#ga4a26d4caecb23348f6eee862c95fee7d":[2,2,0,0], @@ -20,13 +24,96 @@ var NAVTREEINDEX1 = "group__library_group.html#gaf75bb5b38bf32e6a8f43e54068625903":[2,2,0,14], "group__library_group.html#gaf781f246e2e0ab24623ca667c48dc3ba":[2,2,0,12], "group__library_group.html#gafe171baefa00a85b77205116e9f3e48a":[2,2,0,11], -"group__libuv_functions.html":[2,6], -"group__libuv_functions.html#ga1baf4a20b138dcf00807a8b830f4e02d":[2,6,1], -"group__libuv_functions.html#ga5d4b677cbe1cd132c37bc56dbfc6949e":[2,6,0], -"group__libuv_functions.html#ga85c722b2d2699a954362b20528f0aaac":[2,6,3], -"group__libuv_functions.html#ga86ac71cffe752effd7397740d80c3c42":[2,6,2], -"group__libuv_functions.html#ga8df663525fb59b882a0f3bd563083dc7":[2,6,5], -"group__libuv_functions.html#gafaa633c9067f485f330b72644277b07d":[2,6,4], +"group__libuv_functions.html":[2,7], +"group__libuv_functions.html#ga1baf4a20b138dcf00807a8b830f4e02d":[2,7,1], +"group__libuv_functions.html#ga5d4b677cbe1cd132c37bc56dbfc6949e":[2,7,0], +"group__libuv_functions.html#ga85c722b2d2699a954362b20528f0aaac":[2,7,3], +"group__libuv_functions.html#ga86ac71cffe752effd7397740d80c3c42":[2,7,2], +"group__libuv_functions.html#ga8df663525fb59b882a0f3bd563083dc7":[2,7,5], +"group__libuv_functions.html#gafaa633c9067f485f330b72644277b07d":[2,7,4], +"group__micro_callbacks.html":[2,3,1], +"group__micro_callbacks.html#ga7a40fbbb9b1102f0a7679f9dfcf6c0d6":[2,3,1,1], +"group__micro_callbacks.html#gab465a9b31672c63738e8f6b0a61c2e90":[2,3,1,0], +"group__micro_callbacks.html#gae0341a98388ffd1094472d2ced36d840":[2,3,1,2], +"group__micro_cleanup_functions.html":[2,3,4,5], +"group__micro_cleanup_functions.html#ga9b4756ed693ce4fc0f06375aa0d3d54c":[2,3,4,5,0], +"group__micro_cleanup_functions.html#gaabcbf8378e6221eea78493a26576c8ce":[2,3,4,5,1], +"group__micro_client_functions.html":[2,3,4,4], +"group__micro_client_functions.html#ga191be60c4f9bb88f83f73b5ce4e5e0bd":[2,3,4,4,0], +"group__micro_client_functions.html#ga62a528edb67328bd7c478b6338656e1a":[2,3,4,4,1], +"group__micro_client_functions.html#gac3be6a03f5846ac1bb06f091bea36a99":[2,3,4,4,2], +"group__micro_constants.html":[2,3,3], +"group__micro_constants.html#ga27bccc83509da632aec126d97c320fbb":[2,3,3,4], +"group__micro_constants.html#ga2ad15244b5f6541d0d30207bb71e2667":[2,3,3,0], +"group__micro_constants.html#ga3821f13d4cff7a22f7c8c21181847b44":[2,3,3,9], +"group__micro_constants.html#ga4284e07f1991b9807a1dadea4b0f6a67":[2,3,3,6], +"group__micro_constants.html#ga4f5f6337514aa735d486e9397bd9d0c0":[2,3,3,7], +"group__micro_constants.html#ga50e5fc6d460c30bc851dc5d45e938208":[2,3,3,1], +"group__micro_constants.html#ga71f630d0974d85530e7d04a3718dfafc":[2,3,3,3], +"group__micro_constants.html#ga8f052c5047750ee329d2fb496d977bad":[2,3,3,8], +"group__micro_constants.html#gaab340591dc3b52411f35f23c945b25f8":[2,3,3,2], +"group__micro_constants.html#gae1ba7c2a70df4daaeaba5fbebe9c0904":[2,3,3,5], +"group__micro_error_functions.html":[2,3,4,3], +"group__micro_error_functions.html#ga1bf0dc7e647ffd431bdca222d9246f07":[2,3,4,3,5], +"group__micro_error_functions.html#ga2648fe981670c5394bd058128ef6478c":[2,3,4,3,6], +"group__micro_error_functions.html#ga69edae8121c8a5a093c76ee2662bae54":[2,3,4,3,4], +"group__micro_error_functions.html#ga7732a5a63c3b452f8d78f4e41e726fe1":[2,3,4,3,1], +"group__micro_error_functions.html#ga7d7cf243a0d24ff38fbaf6afdfb461cd":[2,3,4,3,0], +"group__micro_error_functions.html#ga91dd255ecb0fc97fddb0b8abe4a3fc4c":[2,3,4,3,2], +"group__micro_error_functions.html#ga9694838e69616612ef98afe7a45cb58d":[2,3,4,3,7], +"group__micro_error_functions.html#gac557c5b7b565746d8c5521c726842641":[2,3,4,3,3], +"group__micro_error_functions.html#gad43118a9e9e48aefbde3b21c4bd9d36f":[2,3,4,3,8], +"group__micro_functions.html":[2,3,4], +"group__micro_group.html":[2,3], +"group__micro_group_functions.html":[2,3,4,1], +"group__micro_group_functions.html#ga0bdc873f98dd1cb6c88b5c14974d74a0":[2,3,4,1,0], +"group__micro_group_functions.html#gabc9641ad7ee7775c388c864f2ffa6883":[2,3,4,1,1], +"group__micro_request_functions.html":[2,3,4,2], +"group__micro_request_functions.html#ga285974d2b6bc4b1369d9a9aa495e8119":[2,3,4,2,11], +"group__micro_request_functions.html#ga3fd1eef10afd445f517d73f32c9d4fd0":[2,3,4,2,4], +"group__micro_request_functions.html#ga402e8ccd0602a27d333d50088f6a92a3":[2,3,4,2,15], +"group__micro_request_functions.html#ga6727593cc380ad418e1d45d232ffea5e":[2,3,4,2,13], +"group__micro_request_functions.html#ga695cf95ff0f596affecbd3954fd498cf":[2,3,4,2,3], +"group__micro_request_functions.html#ga6a6fa30291301abf54e25a24fde7e293":[2,3,4,2,0], +"group__micro_request_functions.html#ga6cf9c55a05fe1234ef264c25ca8294b3":[2,3,4,2,2], +"group__micro_request_functions.html#ga764c2ebab8816c4706d6e49e5cbe8320":[2,3,4,2,9], +"group__micro_request_functions.html#ga8947795096eb225b16af422026627efa":[2,3,4,2,12], +"group__micro_request_functions.html#ga9c50e895154b151d3c9dadd3502b80f9":[2,3,4,2,14], +"group__micro_request_functions.html#gab78f9e653c13c8bbbbaa74d50dd34aa4":[2,3,4,2,6], +"group__micro_request_functions.html#gab94d97619daf42590d7e6c6bd758b9ab":[2,3,4,2,17], +"group__micro_request_functions.html#gab999f2b9972c4339f6f78f491dfc6f3b":[2,3,4,2,5], +"group__micro_request_functions.html#gad28fb0245a4c6d3218e4d233c141d3ce":[2,3,4,2,7], +"group__micro_request_functions.html#gad50a68e2193da36d7b477a34f488840c":[2,3,4,2,1], +"group__micro_request_functions.html#gad73789e910856e6d3ece0ea95f1c8a54":[2,3,4,2,8], +"group__micro_request_functions.html#gae62bab929e8835da250870cfde2f22b2":[2,3,4,2,16], +"group__micro_request_functions.html#gae87e12447ebc9864d38268a15c370182":[2,3,4,2,10], +"group__micro_service_functions.html":[2,3,4,0], +"group__micro_service_functions.html#ga19b3b7126a1e2472a4970fc16b2f9fb4":[2,3,4,0,7], +"group__micro_service_functions.html#ga20bb55e101c42a3b7172ea055b3ea04f":[2,3,4,0,4], +"group__micro_service_functions.html#ga2986a9751147b6f77064b5739635c2c1":[2,3,4,0,0], +"group__micro_service_functions.html#ga32ff6b2fb38eafb4df8e6b1039ee5984":[2,3,4,0,3], +"group__micro_service_functions.html#ga35de7172dac67472ac3890bc955b9b42":[2,3,4,0,10], +"group__micro_service_functions.html#ga578c9af27fda603dc84e7ad736685bd8":[2,3,4,0,2], +"group__micro_service_functions.html#gac829b81893f09b1ed7c401147ed6b0c0":[2,3,4,0,8], +"group__micro_service_functions.html#gadcab5687b72ec24ef7ae647ea844ebc7":[2,3,4,0,1], +"group__micro_service_functions.html#gae7f5d4bde8ac12bde5ad48cebfad9e25":[2,3,4,0,5], +"group__micro_service_functions.html#gaecde4e29e2b963e73fe4a8ff2fce064a":[2,3,4,0,9], +"group__micro_service_functions.html#gaf58eddc84ef124c80a86d380075ef226":[2,3,4,0,6], +"group__micro_structs.html":[2,3,2], +"group__micro_types.html":[2,3,0], +"group__micro_types.html#ga033705d0404de94efb7a6444c6e91743":[2,3,0,11], +"group__micro_types.html#ga0a429a5ecfff69b212a3ba9abebcba53":[2,3,0,5], +"group__micro_types.html#ga1e46c0657cf42e83b366d224f380fb55":[2,3,0,10], +"group__micro_types.html#ga22c8eebaa1ca15ba0834b89cc1081130":[2,3,0,0], +"group__micro_types.html#ga2681ea21e9f5f6681b972bbb67e32133":[2,3,0,7], +"group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4":[2,3,0,8], +"group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7":[2,3,0,6], +"group__micro_types.html#ga550430b08d2e071e3901c6d720f4a039":[2,3,0,1], +"group__micro_types.html#ga7718d2f2c911e4cf677788f4ffe048cd":[2,3,0,3], +"group__micro_types.html#gadd4fcc67087b4d5f42015a7269cb6496":[2,3,0,4], +"group__micro_types.html#gaea03a1fb23faec1d7919054b27acfbc3":[2,3,0,2], +"group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28":[2,3,0,9], +"group__micro_types.html#gaf832de937edc57bcc3af5e1456b3760c":[2,3,0,12], "group__msg_group.html":[2,2,7], "group__msg_group.html#ga098e4fec1c5a71c00a0d092fbd6d1a21":[2,2,7,1], "group__msg_group.html#ga1a091d24f939d881bf04fba78b8995c2":[2,2,7,0], @@ -162,92 +249,5 @@ var NAVTREEINDEX1 = "group__sub_group.html#ga26c9736289d326fb7d6df7e2a0df72ab":[2,2,10,16], "group__sub_group.html#ga38f1e41fc7619101fc4aa52014dd5428":[2,2,10,0], "group__sub_group.html#ga476b7276d0b7f9946834d2bb2423e955":[2,2,10,10], -"group__sub_group.html#ga50a95dd96e9b714201679a015d62832f":[2,2,10,21], -"group__sub_group.html#ga5a029a784c0a7f8b5800b48cc995db20":[2,2,10,5], -"group__sub_group.html#ga5e6454bbc7a90b9694112d45bd8de903":[2,2,10,15], -"group__sub_group.html#ga6538a5d78dfb0f16514b94c8e74c11af":[2,2,10,1], -"group__sub_group.html#ga68a7cea89e75c529a7dd3bb77303dda4":[2,2,10,7], -"group__sub_group.html#ga786bb458981274fe717f266bd3b96d96":[2,2,10,8], -"group__sub_group.html#ga8a37b2d5290da3aecc05483d79e7e254":[2,2,10,4], -"group__sub_group.html#ga9834bd02f67a25ac084d5ad71e146019":[2,2,10,19], -"group__sub_group.html#ga9c26a3f9584e7804060a48ec1b7e2a68":[2,2,10,17], -"group__sub_group.html#gaca6262e2ef842caa701a9f233db72707":[2,2,10,9], -"group__sub_group.html#gadd4872b9fc5678a73f9ab04ce8428432":[2,2,10,6], -"group__sub_group.html#gaea632f845d473e7461b134c0e7bf4077":[2,2,10,20], -"group__sub_group.html#gaee87f8be0e6c2a4693ba2cea070583ba":[2,2,10,2], -"group__sub_group.html#gafe31911d8372db401d33856465421710":[2,2,10,13], -"group__types_group.html":[2,0], -"group__types_group.html#ga0125d394a3cbae2a1713eed8fab7f78e":[2,0,91], -"group__types_group.html#ga023712711f5c289663fc2223e83686d3":[2,0,97], -"group__types_group.html#ga0483b2197c0ddd9082b48c2dd3fe7cee":[2,0,66], -"group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a":[2,0,84], -"group__types_group.html#ga0e3a3b7cf89e7dfa955f0f8f3f1eb6e5":[2,0,83], -"group__types_group.html#ga117ed2c35f89ef3144540ed9cbadc818":[2,0,101], -"group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1":[2,0,96], -"group__types_group.html#ga1802a53c79e667f093bba033b16adc98":[2,0,100], -"group__types_group.html#ga1d48d3eb36b50c9ab6d8477dccf247d8":[2,0,76], -"group__types_group.html#ga1e54c2a1bc94834d1670875fc151f565":[2,0,64], -"group__types_group.html#ga1e938dab794089f9329d7b7ece8f3e9b":[2,0,59], -"group__types_group.html#ga206c3d4d6f4f6f96fd2cae53a3df31c1":[2,0,46], -"group__types_group.html#ga22c26dd5dd31df7982130ef203ad3490":[2,0,62], -"group__types_group.html#ga2629c9454996edf7914be36a9e44921b":[2,0,63], -"group__types_group.html#ga26fd6a73df327ca3c271e46ddefc8acf":[2,0,54], -"group__types_group.html#ga27e1a5d5b513f9eb7d61a17db71f8003":[2,0,70], -"group__types_group.html#ga2bfd6de6ffc84d767482b3dd57cb9271":[2,0,58], -"group__types_group.html#ga2cf5db7703b42d97abe56a3e83b2a87d":[2,0,95], -"group__types_group.html#ga2f21bb79884e56a5613d7fe76b11b1e5":[2,0,71], -"group__types_group.html#ga39011d30b295759b7f6ca0a7539dff8f":[2,0,69], -"group__types_group.html#ga410f8fb053efa02b2ca1de0c02fa4b6d":[2,0,98], -"group__types_group.html#ga49d1138fac9da8b85d00a367081e91c9":[2,0,50], -"group__types_group.html#ga526fa6d37e818784b94cdc1713f3a043":[2,0,87], -"group__types_group.html#ga55dce2fa9ecd215716cc9ceece7dfefa":[2,0,56], -"group__types_group.html#ga57a4b8c7109e2773878655722ce028aa":[2,0,42], -"group__types_group.html#ga57cdc53b29a4fedb5a4140b6e64a4fab":[2,0,77], -"group__types_group.html#ga6d594b091b4bb46192336413066a8edf":[2,0,88], -"group__types_group.html#ga7bbea3575d35dcdbfc9b766b04269eb7":[2,0,49], -"group__types_group.html#ga7f88b7d482488398074f9d1419a9b8c2":[2,0,99], -"group__types_group.html#ga85123afa00d522a249a5b2a8abd7e063":[2,0,81], -"group__types_group.html#ga8650faf52b0b6b23df376eebeb9d0354":[2,0,103], -"group__types_group.html#ga87158ec63b4f90f69e20451624ea01d8":[2,0,43], -"group__types_group.html#ga89db3bd6bf11af3ac5eb3ab560d16332":[2,0,104], -"group__types_group.html#ga8fcb50e6e7312834791f9e237d28e873":[2,0,102], -"group__types_group.html#ga90e8de23c4468005488bde690a2ffe9d":[2,0,90], -"group__types_group.html#ga9e826493769d23086cfccefe95cdf64c":[2,0,93], -"group__types_group.html#gaa889f706cce285adb9cea8aba0b76866":[2,0,75], -"group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1":[2,0,48], -"group__types_group.html#gaaf92318ce94a1ae3547c9a7af5a3f4f6":[2,0,60], -"group__types_group.html#gab2f33f57188a550f2f747d4f27bc24bd":[2,0,61], -"group__types_group.html#gab36492d9d4370337cfed80edce4144e0":[2,0,92], -"group__types_group.html#gab4c43c87d81917aab748a50eee028449":[2,0,52], -"group__types_group.html#gab991313d33ce270a882e4d0756c138f6":[2,0,53], -"group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e":[2,0,45], -"group__types_group.html#gac32f992fe797a1f7befc7dc3452640b6":[2,0,89], -"group__types_group.html#gaccfaac2079656ffd40d003e4de5d2280":[2,0,68], -"group__types_group.html#gace471cd2cef1df797b2a1c6b485049bd":[2,0,67], -"group__types_group.html#gace9595b1a5ce3f7a13670367fd293b4a":[2,0,78], -"group__types_group.html#gad00ab4381eec504ada3272aa9ff8adb2":[2,0,73], -"group__types_group.html#gad057a0107367ce5727975f3daf63ff75":[2,0,74], -"group__types_group.html#gad3a0dd2dac950d5709ee5772b104fc80":[2,0,86], -"group__types_group.html#gad489fb4074f27427560ca71797db6191":[2,0,85], -"group__types_group.html#gadad3bf72baae970662248d82d9b05d0a":[2,0,72], -"group__types_group.html#gadb7c287bc86b92765fbe45a066b96f40":[2,0,80], -"group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a":[2,0,44], -"group__types_group.html#gae4dae869fb614536f0f027c2e2660cc5":[2,0,94], -"group__types_group.html#gae8b57d9c40364f97a705f3e61a1156b0":[2,0,57], -"group__types_group.html#gaef6601477f6456bebc229f7f38982a6c":[2,0,51], -"group__types_group.html#gaf11e6664c1f335a5287af71c703935fa":[2,0,82], -"group__types_group.html#gaf1d5e436c5d41c5b9b96d84e3d2bc86f":[2,0,79], -"group__types_group.html#gaf4d31a4dc83b2805422beafb1f8fa000":[2,0,65], -"group__types_group.html#gaf80828510450faf84bbf456e94f5b784":[2,0,55], -"group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec":[2,0,41], -"group__types_group.html#gafd5523161ec3783e79719cb9a9a66b5b":[2,0,47], -"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818a06299d9c8262a16306ba6cc16d293c5e":[2,0,101,3], -"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818a33317133d42f21bf5919827a691543f6":[2,0,101,4], -"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818a82b8d36e17391212398984f92db9c381":[2,0,101,2], -"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818abb50ebcd2fbafe27038c966121b9407b":[2,0,101,5], -"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818abbd81d6c4e0f17f30e2186f1335e991d":[2,0,101,1], -"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818ac692ba1363103768ac4bb58695549758":[2,0,101,0], -"group__types_group.html#gga1802a53c79e667f093bba033b16adc98a1d9dad1854cf374b22e3688b98284dec":[2,0,100,0], -"group__types_group.html#gga1802a53c79e667f093bba033b16adc98a428ed10448726ad01c1db77a7f748314":[2,0,100,1], -"group__types_group.html#gga410f8fb053efa02b2ca1de0c02fa4b6da6a2aa02f32acec6526d81f6e974e690f":[2,0,98,0] +"group__sub_group.html#ga50a95dd96e9b714201679a015d62832f":[2,2,10,21] }; diff --git a/deps/nats.c/doc/html/navtreeindex2.js b/deps/nats.c/doc/html/navtreeindex2.js index 89fc82b..f7756f7 100644 --- a/deps/nats.c/doc/html/navtreeindex2.js +++ b/deps/nats.c/doc/html/navtreeindex2.js @@ -1,21 +1,114 @@ var NAVTREEINDEX2 = { -"group__types_group.html#gga410f8fb053efa02b2ca1de0c02fa4b6dae874de4a787cfbec4c6d0eb1a3f05ebd":[2,0,98,1], -"group__types_group.html#gga410f8fb053efa02b2ca1de0c02fa4b6daf7e6581e69572691b01d1294a3c3a478":[2,0,98,2], -"group__types_group.html#gga7f88b7d482488398074f9d1419a9b8c2a99d7f2d740af26c340c0a4e2b72fb6ab":[2,0,99,1], -"group__types_group.html#gga7f88b7d482488398074f9d1419a9b8c2abb31b828421634f1e6a1ef9359bc91f6":[2,0,99,0], -"group__types_group.html#gga8650faf52b0b6b23df376eebeb9d0354a2c4a1e2b75f31dd69a89b541d75afa44":[2,0,103,0], -"group__types_group.html#gga8650faf52b0b6b23df376eebeb9d0354a6ee3851dac5c90a61492193dd55931f5":[2,0,103,1], -"group__types_group.html#gga89db3bd6bf11af3ac5eb3ab560d16332a0b7a6bef67e4220f5f0c4075f2ed16b6":[2,0,104,0], -"group__types_group.html#gga89db3bd6bf11af3ac5eb3ab560d16332a4efb91331f3307128c75af5b23362f83":[2,0,104,2], -"group__types_group.html#gga89db3bd6bf11af3ac5eb3ab560d16332acc0e1da3c292cb7eb19d909c9dfd788a":[2,0,104,1], -"group__types_group.html#gga89db3bd6bf11af3ac5eb3ab560d16332aee19ab8144bf518e251ea2004309b657":[2,0,104,3], -"group__types_group.html#gga8fcb50e6e7312834791f9e237d28e873a02d46a6395933c55c95ee5194bb6b80e":[2,0,102,0], -"group__types_group.html#gga8fcb50e6e7312834791f9e237d28e873a1232af28bf4e4b82e962174f1432ed4a":[2,0,102,2], -"group__types_group.html#gga8fcb50e6e7312834791f9e237d28e873afd91fe31cf57c68863ca3090b07c296c":[2,0,102,1], -"group__wildcards_group.html":[2,3], -"index.html":[0], +"group__sub_group.html#ga5a029a784c0a7f8b5800b48cc995db20":[2,2,10,5], +"group__sub_group.html#ga5e6454bbc7a90b9694112d45bd8de903":[2,2,10,15], +"group__sub_group.html#ga6538a5d78dfb0f16514b94c8e74c11af":[2,2,10,1], +"group__sub_group.html#ga68a7cea89e75c529a7dd3bb77303dda4":[2,2,10,7], +"group__sub_group.html#ga786bb458981274fe717f266bd3b96d96":[2,2,10,8], +"group__sub_group.html#ga8a37b2d5290da3aecc05483d79e7e254":[2,2,10,4], +"group__sub_group.html#ga9834bd02f67a25ac084d5ad71e146019":[2,2,10,19], +"group__sub_group.html#ga9c26a3f9584e7804060a48ec1b7e2a68":[2,2,10,17], +"group__sub_group.html#gaca6262e2ef842caa701a9f233db72707":[2,2,10,9], +"group__sub_group.html#gadd4872b9fc5678a73f9ab04ce8428432":[2,2,10,6], +"group__sub_group.html#gaea632f845d473e7461b134c0e7bf4077":[2,2,10,20], +"group__sub_group.html#gaee87f8be0e6c2a4693ba2cea070583ba":[2,2,10,2], +"group__sub_group.html#gafe31911d8372db401d33856465421710":[2,2,10,13], +"group__types_group.html":[2,0], +"group__types_group.html#ga0125d394a3cbae2a1713eed8fab7f78e":[2,0,97], +"group__types_group.html#ga023712711f5c289663fc2223e83686d3":[2,0,103], +"group__types_group.html#ga0483b2197c0ddd9082b48c2dd3fe7cee":[2,0,72], +"group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a":[2,0,90], +"group__types_group.html#ga0e3a3b7cf89e7dfa955f0f8f3f1eb6e5":[2,0,89], +"group__types_group.html#ga10d2999dc673ed95e131e6ce5181f720":[2,0,107], +"group__types_group.html#ga117ed2c35f89ef3144540ed9cbadc818":[2,0,108], +"group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1":[2,0,102], +"group__types_group.html#ga1802a53c79e667f093bba033b16adc98":[2,0,106], +"group__types_group.html#ga1d48d3eb36b50c9ab6d8477dccf247d8":[2,0,82], +"group__types_group.html#ga1e54c2a1bc94834d1670875fc151f565":[2,0,70], +"group__types_group.html#ga1e938dab794089f9329d7b7ece8f3e9b":[2,0,65], +"group__types_group.html#ga206c3d4d6f4f6f96fd2cae53a3df31c1":[2,0,49], +"group__types_group.html#ga22c26dd5dd31df7982130ef203ad3490":[2,0,68], +"group__types_group.html#ga2629c9454996edf7914be36a9e44921b":[2,0,69], +"group__types_group.html#ga26fd6a73df327ca3c271e46ddefc8acf":[2,0,60], +"group__types_group.html#ga27e1a5d5b513f9eb7d61a17db71f8003":[2,0,76], +"group__types_group.html#ga2bfd6de6ffc84d767482b3dd57cb9271":[2,0,64], +"group__types_group.html#ga2cf5db7703b42d97abe56a3e83b2a87d":[2,0,101], +"group__types_group.html#ga2f21bb79884e56a5613d7fe76b11b1e5":[2,0,77], +"group__types_group.html#ga39011d30b295759b7f6ca0a7539dff8f":[2,0,75], +"group__types_group.html#ga3b454f3c6ac697a3cdc5bdd3c9ece12b":[2,0,51], +"group__types_group.html#ga410f8fb053efa02b2ca1de0c02fa4b6d":[2,0,104], +"group__types_group.html#ga49d1138fac9da8b85d00a367081e91c9":[2,0,54], +"group__types_group.html#ga526fa6d37e818784b94cdc1713f3a043":[2,0,93], +"group__types_group.html#ga55dce2fa9ecd215716cc9ceece7dfefa":[2,0,62], +"group__types_group.html#ga57a4b8c7109e2773878655722ce028aa":[2,0,45], +"group__types_group.html#ga57cdc53b29a4fedb5a4140b6e64a4fab":[2,0,83], +"group__types_group.html#ga6d594b091b4bb46192336413066a8edf":[2,0,94], +"group__types_group.html#ga7bbea3575d35dcdbfc9b766b04269eb7":[2,0,53], +"group__types_group.html#ga7f88b7d482488398074f9d1419a9b8c2":[2,0,105], +"group__types_group.html#ga85123afa00d522a249a5b2a8abd7e063":[2,0,87], +"group__types_group.html#ga8650faf52b0b6b23df376eebeb9d0354":[2,0,110], +"group__types_group.html#ga87158ec63b4f90f69e20451624ea01d8":[2,0,46], +"group__types_group.html#ga89db3bd6bf11af3ac5eb3ab560d16332":[2,0,111], +"group__types_group.html#ga8fcb50e6e7312834791f9e237d28e873":[2,0,109], +"group__types_group.html#ga90e8de23c4468005488bde690a2ffe9d":[2,0,96], +"group__types_group.html#ga9e826493769d23086cfccefe95cdf64c":[2,0,99], +"group__types_group.html#gaa889f706cce285adb9cea8aba0b76866":[2,0,81], +"group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1":[2,0,52], +"group__types_group.html#gaaf92318ce94a1ae3547c9a7af5a3f4f6":[2,0,66], +"group__types_group.html#gab2f33f57188a550f2f747d4f27bc24bd":[2,0,67], +"group__types_group.html#gab36492d9d4370337cfed80edce4144e0":[2,0,98], +"group__types_group.html#gab4c43c87d81917aab748a50eee028449":[2,0,56], +"group__types_group.html#gab991313d33ce270a882e4d0756c138f6":[2,0,57], +"group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e":[2,0,48], +"group__types_group.html#gac3148248f38749f6ba70471b7a6b96e1":[2,0,58], +"group__types_group.html#gac32f992fe797a1f7befc7dc3452640b6":[2,0,95], +"group__types_group.html#gaccfaac2079656ffd40d003e4de5d2280":[2,0,74], +"group__types_group.html#gace471cd2cef1df797b2a1c6b485049bd":[2,0,73], +"group__types_group.html#gace9595b1a5ce3f7a13670367fd293b4a":[2,0,84], +"group__types_group.html#gad00ab4381eec504ada3272aa9ff8adb2":[2,0,79], +"group__types_group.html#gad057a0107367ce5727975f3daf63ff75":[2,0,80], +"group__types_group.html#gad3a0dd2dac950d5709ee5772b104fc80":[2,0,92], +"group__types_group.html#gad489fb4074f27427560ca71797db6191":[2,0,91], +"group__types_group.html#gadad3bf72baae970662248d82d9b05d0a":[2,0,78], +"group__types_group.html#gadb76a02c18655461dbd3ee266502338c":[2,0,59], +"group__types_group.html#gadb7c287bc86b92765fbe45a066b96f40":[2,0,86], +"group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a":[2,0,47], +"group__types_group.html#gae4dae869fb614536f0f027c2e2660cc5":[2,0,100], +"group__types_group.html#gae8b57d9c40364f97a705f3e61a1156b0":[2,0,63], +"group__types_group.html#gaef6601477f6456bebc229f7f38982a6c":[2,0,55], +"group__types_group.html#gaf11e6664c1f335a5287af71c703935fa":[2,0,88], +"group__types_group.html#gaf1d5e436c5d41c5b9b96d84e3d2bc86f":[2,0,85], +"group__types_group.html#gaf4d31a4dc83b2805422beafb1f8fa000":[2,0,71], +"group__types_group.html#gaf80828510450faf84bbf456e94f5b784":[2,0,61], +"group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec":[2,0,44], +"group__types_group.html#gafd5523161ec3783e79719cb9a9a66b5b":[2,0,50], +"group__types_group.html#gga10d2999dc673ed95e131e6ce5181f720a97bd071285006dc90dc4600a25f85e89":[2,0,107,0], +"group__types_group.html#gga10d2999dc673ed95e131e6ce5181f720afab4e3a974823f4438292b2405349d4a":[2,0,107,1], +"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818a06299d9c8262a16306ba6cc16d293c5e":[2,0,108,3], +"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818a33317133d42f21bf5919827a691543f6":[2,0,108,4], +"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818a82b8d36e17391212398984f92db9c381":[2,0,108,2], +"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818abb50ebcd2fbafe27038c966121b9407b":[2,0,108,5], +"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818abbd81d6c4e0f17f30e2186f1335e991d":[2,0,108,1], +"group__types_group.html#gga117ed2c35f89ef3144540ed9cbadc818ac692ba1363103768ac4bb58695549758":[2,0,108,0], +"group__types_group.html#gga1802a53c79e667f093bba033b16adc98a1d9dad1854cf374b22e3688b98284dec":[2,0,106,0], +"group__types_group.html#gga1802a53c79e667f093bba033b16adc98a428ed10448726ad01c1db77a7f748314":[2,0,106,1], +"group__types_group.html#gga410f8fb053efa02b2ca1de0c02fa4b6da6a2aa02f32acec6526d81f6e974e690f":[2,0,104,0], +"group__types_group.html#gga410f8fb053efa02b2ca1de0c02fa4b6dae874de4a787cfbec4c6d0eb1a3f05ebd":[2,0,104,1], +"group__types_group.html#gga410f8fb053efa02b2ca1de0c02fa4b6daf7e6581e69572691b01d1294a3c3a478":[2,0,104,2], +"group__types_group.html#gga7f88b7d482488398074f9d1419a9b8c2a99d7f2d740af26c340c0a4e2b72fb6ab":[2,0,105,1], +"group__types_group.html#gga7f88b7d482488398074f9d1419a9b8c2abb31b828421634f1e6a1ef9359bc91f6":[2,0,105,0], +"group__types_group.html#gga8650faf52b0b6b23df376eebeb9d0354a2c4a1e2b75f31dd69a89b541d75afa44":[2,0,110,0], +"group__types_group.html#gga8650faf52b0b6b23df376eebeb9d0354a6ee3851dac5c90a61492193dd55931f5":[2,0,110,1], +"group__types_group.html#gga89db3bd6bf11af3ac5eb3ab560d16332a0b7a6bef67e4220f5f0c4075f2ed16b6":[2,0,111,0], +"group__types_group.html#gga89db3bd6bf11af3ac5eb3ab560d16332a4efb91331f3307128c75af5b23362f83":[2,0,111,2], +"group__types_group.html#gga89db3bd6bf11af3ac5eb3ab560d16332acc0e1da3c292cb7eb19d909c9dfd788a":[2,0,111,1], +"group__types_group.html#gga89db3bd6bf11af3ac5eb3ab560d16332aee19ab8144bf518e251ea2004309b657":[2,0,111,3], +"group__types_group.html#gga8fcb50e6e7312834791f9e237d28e873a02d46a6395933c55c95ee5194bb6b80e":[2,0,109,0], +"group__types_group.html#gga8fcb50e6e7312834791f9e237d28e873a1232af28bf4e4b82e962174f1432ed4a":[2,0,109,2], +"group__types_group.html#gga8fcb50e6e7312834791f9e237d28e873afd91fe31cf57c68863ca3090b07c296c":[2,0,109,1], +"group__wildcards_group.html":[2,4], "index.html":[], +"index.html":[0], "index.html#faq_sec":[0,2], "index.html#install_sec":[0,1], "index.html#intro_sec":[0,0], @@ -24,7 +117,6 @@ var NAVTREEINDEX2 = "libevent_8h_source.html":[4,0,0,0,0], "libuv_8h.html":[4,0,0,0,1], "libuv_8h_source.html":[4,0,0,0,1], -"modules.html":[2], "nats_8h.html":[4,0,0,1], "nats_8h.html#a1c0a11996b44abc16a4f444ee4c1cb94":[4,0,0,1,11], "nats_8h.html#a3776aa9985557f0c6e382b01d2e3f602":[4,0,0,1,14], @@ -37,7 +129,7 @@ var NAVTREEINDEX2 = "nats_8h.html#acc62d11b7e67fe3feb74acdfa4a6e8ac":[4,0,0,1,9], "nats_8h.html#ad22dce8f66bae9b3e1027790d9c95c09":[4,0,0,1,8], "nats_8h.html#ae18fb15ea8130a650e904e5153eb30d5":[4,0,0,1,12], -"nats_8h.html#af798865ac824e5959987de0fe8d07383":[4,0,0,1,15], +"nats_8h.html#af798865ac824e5959987de0fe8d07383":[4,0,0,1,26], "nats_8h_source.html":[4,0,0,1], "pages.html":[], "status_8h.html":[4,0,0,2], @@ -157,97 +249,5 @@ var NAVTREEINDEX2 = "status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70ad1ec102705e46b5343c2680162f58f49":[4,0,0,2,2,21], "status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70adc58d142e277166a57672812df6f2c3e":[4,0,0,2,2,68], "status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70ae3ac6ea1656f4fcc750ba2ab1649fb57":[4,0,0,2,2,26], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70ae4eaa258a64f5c12d7fe50ce4c9c6de5":[4,0,0,2,2,13], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70ae7479c265d0e8cace4ab19a59cfcbbbb":[4,0,0,2,2,38], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70ae9b8b81043fea45985f8c29f108594fb":[4,0,0,2,2,3], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70aea055a7802194f8f1e802a8fc461f83a":[4,0,0,2,2,20], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70aea64a5a017836108cf3da113ad57b6f9":[4,0,0,2,2,2], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70aeaeb1f487667a8d7643cc97bf7b3892a":[4,0,0,2,2,43], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af0506e3abc3846721ae15755c2a1eb47":[4,0,0,2,2,94], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af1efbfa8ad648bf47b4304ea58b0df8c":[4,0,0,2,2,4], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af68cc43ff7ed51f5557329c35fba949c":[4,0,0,2,2,56], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af7c1cf2c692140c4b28ebfc47acb0c41":[4,0,0,2,2,113], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af86c9c188aaa34a76eee96de9bf6e989":[4,0,0,2,2,10], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70afc70c6a72061d9c26017a5cf5dec729b":[4,0,0,2,2,79], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70afcfb372eb2a607f821ad110815acf9d7":[4,0,0,2,2,31], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70afe9c20cdb1e88744d9a5f52977e95d1c":[4,0,0,2,2,74], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70aff9a4fe19078ac3e814989442beaa3a6":[4,0,0,2,2,14], -"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70affa3c8139019a077fac6d403d7ed0522":[4,0,0,2,2,108], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80":[4,0,0,2,1], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a07fdbda44f43cef9866a75b25053c2ae":[4,0,0,2,1,32], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a0aa3d1e18a2a217149fa8b1a306c9b08":[4,0,0,2,1,8], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a113ffbe9a1f243582c38ebd876cb736d":[4,0,0,2,1,2], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a22fa4802a34bac497f23e269a20a52f2":[4,0,0,2,1,35], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a273e92a0ff3b7eaf946b4b7fa6cc6c6c":[4,0,0,2,1,17], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a317fb9be1a80f6b1877f96a9a2db16ad":[4,0,0,2,1,23], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a37d80c8232775339a32805fe93e0ea7f":[4,0,0,2,1,36], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a40a08ae6ae17deaf390b1d0d7550791c":[4,0,0,2,1,1], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a44e8b2590369fb01a1479719c97c2b6f":[4,0,0,2,1,3], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a47034d8889521bbd300f45fdc19e1127":[4,0,0,2,1,6], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a473ea6cfa03490838fafee8730b48a2a":[4,0,0,2,1,11], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a476d7bcf9a593b749e435f20a9156eff":[4,0,0,2,1,5], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a49a1ea653ce112b3c53eedebcd60811d":[4,0,0,2,1,31], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a62ff6f5cc64399631defc0119731b514":[4,0,0,2,1,24], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a71b57630aebf5c20eecdab832c2a9235":[4,0,0,2,1,16], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a790c08a7d33e3aefce07c04120c4c19e":[4,0,0,2,1,15], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a7cb64f52c8d91d6ade3db6bc82a96c42":[4,0,0,2,1,27], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a827072fc245a99a60691e1e4b173ca86":[4,0,0,2,1,18], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a85c29dbfa6b06ffef3418cc9947ffff7":[4,0,0,2,1,4], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a892183c32b4929388bb75dc62230ddf3":[4,0,0,2,1,29], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a8a0d239cfdfa30fe730afea65941779b":[4,0,0,2,1,33], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a8a4e298931ba0698a72e397b1b57c885":[4,0,0,2,1,30], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a984189ec4cfe3e7647268c99f7e49ec9":[4,0,0,2,1,25], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9a6f40b7803639ac18bdf532e93e5ad5":[4,0,0,2,1,22], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9bb78b4f245d2870040d25c450febd4b":[4,0,0,2,1,19], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9cee6c417868ecaa69f99ff4f6576990":[4,0,0,2,1,0], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80aa76d5e3ce051bc7510be90e73663c93d":[4,0,0,2,1,7], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80aab97324e40ccfe1360080c651c330e62":[4,0,0,2,1,34], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ab88994c9ea9889ac4d9d656d62f550ed":[4,0,0,2,1,26], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80abc76f1b31fdac4525583cc19588240dc":[4,0,0,2,1,9], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80abef517217119e8446a8e3382e1f37eb3":[4,0,0,2,1,10], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ac3abc147873fe999c86431f9222eebf5":[4,0,0,2,1,12], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ad0229a12b17d3d12a28efed6213720d8":[4,0,0,2,1,13], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ae1d2c1366dbed428f6589f057acc507d":[4,0,0,2,1,14], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ae47047f2fac5f2f2a434fc501e5c3d4e":[4,0,0,2,1,28], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ae93ff5b7fe31f8570308385d92d317b0":[4,0,0,2,1,20], -"status_8h.html#a36c934157b663b7b5fb5d6609c897c80af820300473609092a3e97a71b5af9ff9":[4,0,0,2,1,21], -"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51":[4,0,0,2,0], -"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51a08f92960811d1ff05b91a0870b4ecb92":[4,0,0,2,0,0], -"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51a0dafab74b55f98cfc1d00e4d1ef38725":[4,0,0,2,0,2], -"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51a7e4d95cb29122f06e17ca4aff55cc736":[4,0,0,2,0,1], -"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51aa78753a4de2d0379078bb09cdc1acdb2":[4,0,0,2,0,3], -"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51ab6f9d121707673a61cbe2c591f64fbf1":[4,0,0,2,0,5], -"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51ac6b8b7f138f6ca285fe1f4da707b2100":[4,0,0,2,0,6], -"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51acfdc4826e08ce4b59f901952038e9206":[4,0,0,2,0,4], -"status_8h_source.html":[4,0,0,2], -"structjs_a_p_i_stats.html":[2,0,26], -"structjs_a_p_i_stats.html#a1545170bebb347d0ea1254f51c3027cf":[2,0,26,0], -"structjs_a_p_i_stats.html#a84e85ad9d94dbe9afd1101388574255d":[2,0,26,1], -"structjs_account_info.html":[2,0,29], -"structjs_account_info.html#a1237c3f19a42a3203825971b429312e9":[2,0,29,3], -"structjs_account_info.html#a17317abf03effdcdedc2003fca8adc71":[2,0,29,2], -"structjs_account_info.html#a21c14ca283400c684b18e61a534b6724":[2,0,29,8], -"structjs_account_info.html#a448578d621e878267ad5f1792002a665":[2,0,29,0], -"structjs_account_info.html#a94ab71c69b7883c2731ae8741ddc1e94":[2,0,29,5], -"structjs_account_info.html#aad93cf4bb6c1fbb09ae8545c03f315a9":[2,0,29,6], -"structjs_account_info.html#ab654d5c7456bb62df1808deb32a620fc":[2,0,29,7], -"structjs_account_info.html#ab6ba03298e1863132550b9b08d06048c":[2,0,29,4], -"structjs_account_info.html#ad1c254c5b8f11f57062a4e2d5fb10ae3":[2,0,29,1], -"structjs_account_limits.html":[2,0,27], -"structjs_account_limits.html#a38875d969274b0f0fcefc6b04ce56eb8":[2,0,27,5], -"structjs_account_limits.html#a4710a10950857a322c2a3ad6f946ded2":[2,0,27,2], -"structjs_account_limits.html#a4abf1972690c20d73bd314f2059e8013":[2,0,27,4], -"structjs_account_limits.html#a6169f29101d51d48eed0803b719e6338":[2,0,27,3], -"structjs_account_limits.html#a6fff014c46739410ecf298b0cf643b30":[2,0,27,1], -"structjs_account_limits.html#a7bfc63e6f49ce724663ee534c5efdfa4":[2,0,27,0], -"structjs_account_limits.html#a858edf99ee1c60354bdba4e59293fb6a":[2,0,27,7], -"structjs_account_limits.html#a8cca06ab72b715c02a6a2c72b59f6a52":[2,0,27,6], -"structjs_cluster_info.html":[2,0,12], -"structjs_cluster_info.html#a237a639579def1345e02f1490a510ed5":[2,0,12,3], -"structjs_cluster_info.html#a2e13d7ec417574100c938c4df78e5484":[2,0,12,0], -"structjs_cluster_info.html#a8dfcae3bc348a5b595b509e3f3d3500b":[2,0,12,2], -"structjs_cluster_info.html#af7d85652b52f56fa1eedce8f45fe6a19":[2,0,12,1], -"structjs_consumer_config.html":[2,0,18], -"structjs_consumer_config.html#a046177256938d6a601c629f9fd82f888":[2,0,18,27], -"structjs_consumer_config.html#a201217d93cfed17eb4d3e2d9579b826a":[2,0,18,0] +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70ae4eaa258a64f5c12d7fe50ce4c9c6de5":[4,0,0,2,2,13] }; diff --git a/deps/nats.c/doc/html/navtreeindex3.js b/deps/nats.c/doc/html/navtreeindex3.js index a4ca128..32c158f 100644 --- a/deps/nats.c/doc/html/navtreeindex3.js +++ b/deps/nats.c/doc/html/navtreeindex3.js @@ -1,253 +1,253 @@ var NAVTREEINDEX3 = { -"structjs_consumer_config.html#a2f0243899885dc97f304f48ca52b5356":[2,0,18,4], -"structjs_consumer_config.html#a30d4142bac47ab6dc583c5ee193704e6":[2,0,18,19], -"structjs_consumer_config.html#a351b388a36ccb7978e6e85a6f4fc0816":[2,0,18,13], -"structjs_consumer_config.html#a364127e68bf0d3bf13efdc0b416667f4":[2,0,18,3], -"structjs_consumer_config.html#a36a14d666d99bdade87a5e21a25491d6":[2,0,18,2], -"structjs_consumer_config.html#a36cf121162cf0b40edf051991d851ee0":[2,0,18,1], -"structjs_consumer_config.html#a43f40b8eef0074b4146fb945b4645584":[2,0,18,14], -"structjs_consumer_config.html#a484c64b6c54f6f758f54315470ed20d0":[2,0,18,17], -"structjs_consumer_config.html#a4e86deefe08854b9a82b4908397aad32":[2,0,18,20], -"structjs_consumer_config.html#a651a94b9b78668dde830dc7869610e67":[2,0,18,7], -"structjs_consumer_config.html#a74a026cdd92c538bcf84297f4468bb21":[2,0,18,22], -"structjs_consumer_config.html#a802ea3bf0669395bee28611f4ecede80":[2,0,18,5], -"structjs_consumer_config.html#a8472d49fae908ab0291b4d62c8411b76":[2,0,18,15], -"structjs_consumer_config.html#a8a311af614dfae1b0f4e4af7db467aab":[2,0,18,6], -"structjs_consumer_config.html#a95aa4184ed77f69b7674756572da1ded":[2,0,18,23], -"structjs_consumer_config.html#aa2d0aff64a2c46122d0f0fe89e8ae011":[2,0,18,9], -"structjs_consumer_config.html#aa71aa3dfe5826466be301097b1bae04d":[2,0,18,21], -"structjs_consumer_config.html#ac439828c3bedb8826a1e92de13280d53":[2,0,18,18], -"structjs_consumer_config.html#acfba6d6ecb6323fd8ffe6c0bb4fbffae":[2,0,18,26], -"structjs_consumer_config.html#ad2f6ca3f2d0f977aedb8687c462c1cfc":[2,0,18,10], -"structjs_consumer_config.html#ad47e15e1d6a4a8b0b155f9d3d5873c95":[2,0,18,8], -"structjs_consumer_config.html#ade510daf7c5d67553d2cd20b64ab9939":[2,0,18,12], -"structjs_consumer_config.html#ae0765f3b5effe365187d3cf809c6ed3c":[2,0,18,24], -"structjs_consumer_config.html#aeb2336d480e3885385d1b08410e89892":[2,0,18,16], -"structjs_consumer_config.html#af56ab7708b11e85e0b9115d152d281ca":[2,0,18,11], -"structjs_consumer_config.html#af6376a6009124c25d7016bc548f3855d":[2,0,18,25], -"structjs_consumer_info.html":[2,0,23], -"structjs_consumer_info.html#a15f2d68fbf126acc1907ba9462ad9ee9":[2,0,23,4], -"structjs_consumer_info.html#a2f63940ca1f024ad3840418c2f6a1ae1":[2,0,23,3], -"structjs_consumer_info.html#a31282cdc72000a91af03f89899740bfa":[2,0,23,11], -"structjs_consumer_info.html#a57e4a4139310c50a1f3d51af67197af0":[2,0,23,8], -"structjs_consumer_info.html#a670d38f2e9ba5c354ca3560a8064d00c":[2,0,23,2], -"structjs_consumer_info.html#a6f4401563a9fd102226d82cdc6136e32":[2,0,23,10], -"structjs_consumer_info.html#a882bebeb7af80fcce088afdf2c98de50":[2,0,23,6], -"structjs_consumer_info.html#a8f21939613163a7c0ebfb521aa471260":[2,0,23,0], -"structjs_consumer_info.html#a932bf14ebb9ce167af8975e3b1f8d001":[2,0,23,7], -"structjs_consumer_info.html#a9359aea7cd05a27b2a15f8a35cdb1008":[2,0,23,1], -"structjs_consumer_info.html#ab69c36ae092df9b0663b675a5abbab55":[2,0,23,5], -"structjs_consumer_info.html#aeaefd5a500996013b1ce13d8872e869b":[2,0,23,9], -"structjs_consumer_info_list.html":[2,0,24], -"structjs_consumer_info_list.html#a75354882af5e11959b198a70bde14db8":[2,0,24,0], -"structjs_consumer_info_list.html#a813c908362a6426a929133f7c0d3395f":[2,0,24,1], -"structjs_consumer_names_list.html":[2,0,25], -"structjs_consumer_names_list.html#a0bccbad8ac5d335a0ed89970a58900fb":[2,0,25,1], -"structjs_consumer_names_list.html#aa4b3cf17902a2d580cc3a230bfa5d309":[2,0,25,0], -"structjs_consumer_sequence_mismatch.html":[2,0,19], -"structjs_consumer_sequence_mismatch.html#aad6a17af1719c023c38a6fd254b73f8e":[2,0,19,0], -"structjs_consumer_sequence_mismatch.html#ac1df353001d853c8a56cef9f82fb831c":[2,0,19,2], -"structjs_consumer_sequence_mismatch.html#adb383429dadb1ab0e1f7d013bc546a28":[2,0,19,1], -"structjs_direct_get_msg_options.html":[2,0,33], -"structjs_direct_get_msg_options.html#a16ce7908a3d1690b8ae8bc22350ac238":[2,0,33,1], -"structjs_direct_get_msg_options.html#a60211d7499cfecdd6e61e6c73af1a2f5":[2,0,33,0], -"structjs_direct_get_msg_options.html#aae968f31cdda96fa3c5e9374a36b9630":[2,0,33,2], -"structjs_external_stream.html":[2,0,3], -"structjs_external_stream.html#a26ca427f3c5be1cae579ddccc16432d3":[2,0,3,1], -"structjs_external_stream.html#a2eaf2c0c3e77c269f44e254af8b24e96":[2,0,3,0], -"structjs_fetch_request.html":[2,0,34], -"structjs_fetch_request.html#a3298db691c2ecb9725cc029e2c35d6d1":[2,0,34,2], -"structjs_fetch_request.html#a84f06b60e25decb2674996f0cb315f63":[2,0,34,1], -"structjs_fetch_request.html#ac3351138ce8ac3b321ac1eb78887116e":[2,0,34,0], -"structjs_fetch_request.html#ae251eebb1998a39fe3b898302b58293d":[2,0,34,3], -"structjs_fetch_request.html#ae8e73c7cc2e2a2d2502407c9b1522496":[2,0,34,4], -"structjs_lost_stream_data.html":[2,0,7], -"structjs_lost_stream_data.html#a5d2e87697526033c842a7f955776dfda":[2,0,7,0], -"structjs_lost_stream_data.html#a841fcadca3f66e9170a51080dc1acf30":[2,0,7,2], -"structjs_lost_stream_data.html#abdc373ed7fc9b7cf161c13da1913fc9a":[2,0,7,1], -"structjs_msg_meta_data.html":[2,0,30], -"structjs_msg_meta_data.html#a02f1bbd37e9650ed6bfda0210f038e30":[2,0,30,2], -"structjs_msg_meta_data.html#a23d5fd1992033164c73d5c2a16a4e321":[2,0,30,0], -"structjs_msg_meta_data.html#a32e2a9438d2dc769f7f64d2f8897abc4":[2,0,30,4], -"structjs_msg_meta_data.html#a388e38ccea591181436d199dc7c2f8ea":[2,0,30,6], -"structjs_msg_meta_data.html#a6dcc2a442984b0ca070b3d8077192127":[2,0,30,5], -"structjs_msg_meta_data.html#a9a50965fac061a9728b160702d3f56ff":[2,0,30,1], -"structjs_msg_meta_data.html#abab9ed5600a3629ea6d6c78170d7d5e9":[2,0,30,3], -"structjs_options.html":[2,0,35], -"structjs_options.html#a5ce5c11cc9b9df2b6bc47cd77d7b1dc4":[2,0,35,5], -"structjs_options.html#a7fd42e1f83da5861e716137c16f8b72f":[2,0,35,4], -"structjs_options.html#ab06e45296fccf0fe6152e083e38d916f":[2,0,35,2], -"structjs_options.html#ae4df6c9c01c0ea9ab0e6d5a6ec8af74e":[2,0,35,3], -"structjs_options.html#ae50544ee0ef8dd7d02ef9802805807ae":[2,0,35,6], -"structjs_options_1_1js_options_publish_async.html":[2,0,35,0], -"structjs_options_1_1js_options_publish_async.html#a0a180995c49990ca277e449b7d43616b":[2,0,35,0,3], -"structjs_options_1_1js_options_publish_async.html#a508140119f40a2c056d4ee8c0cd55df9":[2,0,35,0,1], -"structjs_options_1_1js_options_publish_async.html#a60c95f10797c04ea2e625759c6936ec9":[2,0,35,0,2], -"structjs_options_1_1js_options_publish_async.html#a784a0029c30e82ff37c39ae6c276bc81":[2,0,35,0,4], -"structjs_options_1_1js_options_publish_async.html#ada58fefe0ed40157b5f5d44b9dd175f9":[2,0,35,0,5], -"structjs_options_1_1js_options_publish_async.html#add8dd21cbab2d5df19688c26365fe4d1":[2,0,35,0,0], -"structjs_options_1_1js_options_stream.html":[2,0,35,1], -"structjs_options_1_1js_options_stream.html#a2ca89c298b4df1f5e3e0a44e205c789c":[2,0,35,1,3], -"structjs_options_1_1js_options_stream.html#afe680264223b434ca6959f9e122af029":[2,0,35,1,2], -"structjs_options_1_1js_options_stream_1_1js_options_stream_info.html":[2,0,35,1,0], -"structjs_options_1_1js_options_stream_1_1js_options_stream_info.html#a73f847afe18f56eaaf6788900270bef7":[2,0,35,1,0,0], -"structjs_options_1_1js_options_stream_1_1js_options_stream_info.html#af874e0f5aa15fb2a41504631ed786e6d":[2,0,35,1,0,1], -"structjs_options_1_1js_options_stream_1_1js_options_stream_purge.html":[2,0,35,1,1], -"structjs_options_1_1js_options_stream_1_1js_options_stream_purge.html#a0d61e5d3c9c518f455549086ababe7f6":[2,0,35,1,1,1], -"structjs_options_1_1js_options_stream_1_1js_options_stream_purge.html#a882c1ce1e636817450893caa72aa4eda":[2,0,35,1,1,2], -"structjs_options_1_1js_options_stream_1_1js_options_stream_purge.html#aa99e6ee3bef1c22243f01544181315fe":[2,0,35,1,1,0], -"structjs_peer_info.html":[2,0,11], -"structjs_peer_info.html#a3f3e09c5996858ec5faca2dc7fa5224e":[2,0,11,2], -"structjs_peer_info.html#a49a2623963dad653a6d7996c750056c9":[2,0,11,4], -"structjs_peer_info.html#a8441d023932c388953197f7ea39402fe":[2,0,11,3], -"structjs_peer_info.html#abf29230ce03a1c14d50227663e07de6a":[2,0,11,0], -"structjs_peer_info.html#ad8cecd039a8ad1c68daba89007b055d4":[2,0,11,1], -"structjs_placement.html":[2,0,2], -"structjs_placement.html#a35644f07531409518521b1b4fa28c9e3":[2,0,2,2], -"structjs_placement.html#ad8c83588d57f0e30959cfb6f3d5d61bf":[2,0,2,0], -"structjs_placement.html#af078a85b744b9ff3771bb2da6005b90d":[2,0,2,1], -"structjs_pub_ack.html":[2,0,31], -"structjs_pub_ack.html#a01d302d5e1a2e71487a8c74c3fed1691":[2,0,31,1], -"structjs_pub_ack.html#a0381a49ff62e8fac7a52cad6a5eb7243":[2,0,31,3], -"structjs_pub_ack.html#a0b73200c0b035db3c9c96421706d51b0":[2,0,31,2], -"structjs_pub_ack.html#a4fd5e6cdb7217d72c553afcc75358893":[2,0,31,0], -"structjs_pub_ack_err.html":[2,0,32], -"structjs_pub_ack_err.html#a156ca2f779d132ffa8c519124cf9739b":[2,0,32,0], -"structjs_pub_ack_err.html#a406e39e818f93bc59ac18cbdf035baf5":[2,0,32,1], -"structjs_pub_ack_err.html#aa558fd192cc6d6c02ad891445ec5aa8a":[2,0,32,2], -"structjs_pub_ack_err.html#ad1a85e6ff4046d7df33c1e24323ddc87":[2,0,32,3], -"structjs_pub_options.html":[2,0,1], -"structjs_pub_options.html#a095391b33a261586fc02eaf013b65e61":[2,0,1,3], -"structjs_pub_options.html#a1b242c9311b904a2e5337417b5c6d143":[2,0,1,0], -"structjs_pub_options.html#a3b02b60b05caa6d242079a4c26b181bf":[2,0,1,4], -"structjs_pub_options.html#a740a7edee8c832a75b75fded6046ba90":[2,0,1,6], -"structjs_pub_options.html#ac7ac74d2557d772c3092288dacf3711f":[2,0,1,2], -"structjs_pub_options.html#ac8708487360b784f7dd5d7a21e5617c0":[2,0,1,1], -"structjs_pub_options.html#aeefec1d2c7644562d23b87e55bf2e253":[2,0,1,5], -"structjs_re_publish.html":[2,0,5], -"structjs_re_publish.html#a16ebc4cdae4a407cf4e32aad212888db":[2,0,5,2], -"structjs_re_publish.html#a1acb593929fd69bbe0f4dc8300dfaeb2":[2,0,5,0], -"structjs_re_publish.html#a662b2e57d237b171b2b61509f7e1023a":[2,0,5,1], -"structjs_sequence_info.html":[2,0,22], -"structjs_sequence_info.html#a4e94c91650b7db253645515fee4c3b05":[2,0,22,2], -"structjs_sequence_info.html#ab52c55c1d0edd20e064870b490b4b990":[2,0,22,1], -"structjs_sequence_info.html#ae4416a5d766e07db207e563668edd06f":[2,0,22,0], -"structjs_sequence_pair.html":[2,0,21], -"structjs_sequence_pair.html#a6d205effd29f8994f0028bfaf2e8d816":[2,0,21,0], -"structjs_sequence_pair.html#ab051e0815302c48ba6122bd18d9d76f7":[2,0,21,1], -"structjs_stream_alternate.html":[2,0,14], -"structjs_stream_alternate.html#a07f36f98c7dcdf435f803e4f0ccaac57":[2,0,14,0], -"structjs_stream_alternate.html#a3e85014d03dd425435ed5a0b6a5dfb1d":[2,0,14,2], -"structjs_stream_alternate.html#a7c25ab1a427b78c4e1ba58ff7cdb5a8f":[2,0,14,1], -"structjs_stream_config.html":[2,0,6], -"structjs_stream_config.html#a0b44ea5251ef20bf5b5658bcfbea832d":[2,0,6,11], -"structjs_stream_config.html#a0c5f3354073dbe72650e3db7f59a47af":[2,0,6,2], -"structjs_stream_config.html#a28630f6f07ca02553c5d5718d7c29721":[2,0,6,26], -"structjs_stream_config.html#a34960d6acc710c2f32b563f4bb7c9c0a":[2,0,6,20], -"structjs_stream_config.html#a3fb7d5e1a09829fe742749da880afe4a":[2,0,6,28], -"structjs_stream_config.html#a4f9f422d2e9e7389860291ab19bd7f10":[2,0,6,1], -"structjs_stream_config.html#a50f866f0e73c4ff0a5f43b354a059fa9":[2,0,6,15], -"structjs_stream_config.html#a575ffbaa85b0300032963296b090583a":[2,0,6,23], -"structjs_stream_config.html#a59c34091f336eafa77da2991c852c0d8":[2,0,6,12], -"structjs_stream_config.html#a5ebc95b76afafa5e7a129953ba1bb3c7":[2,0,6,4], -"structjs_stream_config.html#a60a5184d1d97b056dbb31ac6a5b3d82d":[2,0,6,6], -"structjs_stream_config.html#a7338c82c8cbfcd5f4bfb7ad34b1d8395":[2,0,6,5], -"structjs_stream_config.html#a7fe3d5086f1c660a6999ae40ecd370e5":[2,0,6,0], -"structjs_stream_config.html#a8e358fbc569a1c6d49c704e6dbdf8609":[2,0,6,14], -"structjs_stream_config.html#a8f0ee08922e5b2108082b5b9e4a6284b":[2,0,6,19], -"structjs_stream_config.html#a93a2336a57b6bfb792d530fd13a90641":[2,0,6,10], -"structjs_stream_config.html#a95ab0061b6e935b129a4a9c133e6b11c":[2,0,6,25], -"structjs_stream_config.html#a9d67ddcc7c54c345dd60ed5e59234f1e":[2,0,6,27], -"structjs_stream_config.html#a9e0ff10273d0182f885615b4f7d1cc20":[2,0,6,16], -"structjs_stream_config.html#aa167c7547d13bf2a01510a375ad38340":[2,0,6,9], -"structjs_stream_config.html#aa538765ad97d343d60212ebd9894661e":[2,0,6,8], -"structjs_stream_config.html#ab2186aae798df6c222b3fa69e31597e1":[2,0,6,3], -"structjs_stream_config.html#aba71cdb342181f52bb9f7ff5f770a1fa":[2,0,6,24], -"structjs_stream_config.html#acdba5b22e4e60fd81a54769a7d09bc51":[2,0,6,18], -"structjs_stream_config.html#acee6c66afc78d79c2f518eed89177efb":[2,0,6,17], -"structjs_stream_config.html#ad75e47d4293441bd5ddbc5eaf01e0451":[2,0,6,7], -"structjs_stream_config.html#adbf2c948cf8091b149603b918ef49ffc":[2,0,6,13], -"structjs_stream_config.html#aede3fd2ab13d230eda14c96f9997e1b7":[2,0,6,21], -"structjs_stream_config.html#af2d42dd29b9a35257937aeeb53c9f287":[2,0,6,22], -"structjs_stream_info.html":[2,0,15], -"structjs_stream_info.html#a2e7ca48a93fe57265609e7e0cd3fa386":[2,0,15,5], -"structjs_stream_info.html#a578ce52a275c690dd4627c1d119c7838":[2,0,15,1], -"structjs_stream_info.html#a720c4ff9090bafda50000843810ab1bb":[2,0,15,7], -"structjs_stream_info.html#a766ac56dec3bd19fa5b9861fb5f64397":[2,0,15,2], -"structjs_stream_info.html#a8d10d6fdc3f713ac726c72cae06a209a":[2,0,15,3], -"structjs_stream_info.html#ab71aae7e4f6c62e2a09a3a52c9e4fa2a":[2,0,15,4], -"structjs_stream_info.html#ad37a5fd700bd5df54e5002c7de51c3ad":[2,0,15,8], -"structjs_stream_info.html#adcc402d28e0ee443419e9b549da233c6":[2,0,15,0], -"structjs_stream_info.html#af14110cb1f8e16e3dade8d9f7c2fd672":[2,0,15,6], -"structjs_stream_info_list.html":[2,0,16], -"structjs_stream_info_list.html#a7b096ee7a25363f231f56419a244daef":[2,0,16,0], -"structjs_stream_info_list.html#a8bc8490af12bb4f7a245605aecde62c2":[2,0,16,1], -"structjs_stream_names_list.html":[2,0,17], -"structjs_stream_names_list.html#a1875a7e449759dfc2a40b0eb74de0acf":[2,0,17,0], -"structjs_stream_names_list.html#ab1385b6333537306d0462946c26cde4f":[2,0,17,1], -"structjs_stream_source.html":[2,0,4], -"structjs_stream_source.html#a295458d156af5373bb3f5ab06612a888":[2,0,4,4], -"structjs_stream_source.html#a67eb1dac41b2d826a923cfb23baa24a5":[2,0,4,2], -"structjs_stream_source.html#a7d9e5c064866b3f0b5601193c5885ec3":[2,0,4,0], -"structjs_stream_source.html#aa304239ee823ef87fcb53ebb0c077e7b":[2,0,4,5], -"structjs_stream_source.html#ad6948b7a34c202f324b6d2beb32fe5ed":[2,0,4,1], -"structjs_stream_source.html#af787b51dde9d77626f33860564eb08c3":[2,0,4,3], -"structjs_stream_source_info.html":[2,0,13], -"structjs_stream_source_info.html#a28b8cc0a9d487672955d3a3fa03de247":[2,0,13,3], -"structjs_stream_source_info.html#a6db3c6ff8a465a45f8bd5c7bdf5f6c04":[2,0,13,0], -"structjs_stream_source_info.html#a7eb19dd2637079fd1e970a2b38d33e05":[2,0,13,1], -"structjs_stream_source_info.html#ab2ee0ca3ecd98c2df6d4e9bd88686863":[2,0,13,2], -"structjs_stream_state.html":[2,0,10], -"structjs_stream_state.html#a1adf8991f31fc4db9d6907a0316f8eec":[2,0,10,11], -"structjs_stream_state.html#a22da809fe7a1ec3101841e86d6708827":[2,0,10,4], -"structjs_stream_state.html#a27f4cfb85c0f1b0c5c7ad5275bd25d85":[2,0,10,12], -"structjs_stream_state.html#a34a08a64c97269165630bf2e0c78c2c0":[2,0,10,10], -"structjs_stream_state.html#a495269fe83c6bbf2023cca94add0a888":[2,0,10,0], -"structjs_stream_state.html#a4af56e8bee7262ab050f2a25114c5909":[2,0,10,7], -"structjs_stream_state.html#a55bb6719163acef7fdb6d0bc3ae8d5da":[2,0,10,2], -"structjs_stream_state.html#a67cbd0d8b43d8c05c8b4cd6b0e44dab0":[2,0,10,5], -"structjs_stream_state.html#aaa43db17641826e7c6ecc1954f641960":[2,0,10,6], -"structjs_stream_state.html#abcf4d3c581c06d820f1ad21d640bef3f":[2,0,10,9], -"structjs_stream_state.html#acbec2f01830b56cb4c0bf54ae5170e51":[2,0,10,8], -"structjs_stream_state.html#ae603fa6ecfb63c93b61272b7d1b8fb4d":[2,0,10,1], -"structjs_stream_state.html#afb7a708022faff518c060b33e99b04b0":[2,0,10,3], -"structjs_stream_state_subject.html":[2,0,8], -"structjs_stream_state_subject.html#a8b9b2edc5afe82b7b3bc7dbdd67a4384":[2,0,8,1], -"structjs_stream_state_subject.html#aa766824a7f8b69db592971af3262640e":[2,0,8,0], -"structjs_stream_state_subjects.html":[2,0,9], -"structjs_stream_state_subjects.html#ab88e2026f518b6cdffd3901b5e5cd374":[2,0,9,1], -"structjs_stream_state_subjects.html#aef3d1e886b16961daa84c43650fa80c0":[2,0,9,0], -"structjs_sub_options.html":[2,0,20], -"structjs_sub_options.html#a21a905c49dfab61729d8674702d196b2":[2,0,20,3], -"structjs_sub_options.html#a7aa5b8439ed288b858943f28c291cb36":[2,0,20,1], -"structjs_sub_options.html#a856a6af4a7ff5aa2e736338091e69484":[2,0,20,0], -"structjs_sub_options.html#a95c5d2db8ca97d644042d436de119be4":[2,0,20,5], -"structjs_sub_options.html#aaf4b620d112a31f51a20389c5405805d":[2,0,20,2], -"structjs_sub_options.html#acab25d71a2efe26bb3b084071435c2b5":[2,0,20,4], -"structjs_tier.html":[2,0,28], -"structjs_tier.html#a1ed542b9acccbe7761839f33c43053a6":[2,0,28,0], -"structjs_tier.html#a3f9234fde387faf3775d841aa797a6ea":[2,0,28,3], -"structjs_tier.html#ab16c426e1c35d8c0fd6c460c43580a39":[2,0,28,2], -"structjs_tier.html#ac33ce862c041572d10184e7fa0dd0bfe":[2,0,28,4], -"structjs_tier.html#aeff4a4cb86e10d8d7749d6ff69f97ed1":[2,0,28,1], -"structjs_tier.html#af2edbabd5e078b1e31dd73d44fd507d3":[2,0,28,5], -"structkv_config.html":[2,0,36], -"structkv_config.html#a0ec6b3afbfdaa33436e2ae748e986e98":[2,0,36,3], -"structkv_config.html#a11b636da727c17566d5ab1274f69fee5":[2,0,36,0], -"structkv_config.html#a1bc37777aa91b8b57a70e7647670cd12":[2,0,36,5], -"structkv_config.html#a281156a9df0130abad7f3b2728ac35a5":[2,0,36,2], -"structkv_config.html#a48f0f70383eff868321f9c94ae1a87cd":[2,0,36,7], -"structkv_config.html#a941e9cad2bab67f093bf4d9567b4749a":[2,0,36,1], -"structkv_config.html#ac86ca661d283627bccecf70cd286c8f8":[2,0,36,9], -"structkv_config.html#ad2f5503e2f2522cb52e0ba1b86983dba":[2,0,36,4], -"structkv_config.html#ad5db9a58224d93ab86b4cfc4c46f1897":[2,0,36,6], -"structkv_config.html#ae172d3e442eef1a57cd7cf266d9e8951":[2,0,36,8], -"structkv_config.html#af1d95d5434b10e929d6ce6fa6129a789":[2,0,36,11], -"structkv_config.html#afbfd6725c0b0c9fb661a96c06d788ac9":[2,0,36,10], -"structkv_entry_list.html":[2,0,39], -"structkv_entry_list.html#a179d4d3e5844d005be1ed9134b969a50":[2,0,39,0], -"structkv_entry_list.html#a82da55d42e1a6862d3b0034dfc6f321f":[2,0,39,1], -"structkv_keys_list.html":[2,0,40], -"structkv_keys_list.html#a625f7b34784e024a538359efd9a97265":[2,0,40,1] +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70ae7479c265d0e8cace4ab19a59cfcbbbb":[4,0,0,2,2,38], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70ae9b8b81043fea45985f8c29f108594fb":[4,0,0,2,2,3], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70aea055a7802194f8f1e802a8fc461f83a":[4,0,0,2,2,20], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70aea64a5a017836108cf3da113ad57b6f9":[4,0,0,2,2,2], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70aeaeb1f487667a8d7643cc97bf7b3892a":[4,0,0,2,2,43], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af0506e3abc3846721ae15755c2a1eb47":[4,0,0,2,2,94], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af1efbfa8ad648bf47b4304ea58b0df8c":[4,0,0,2,2,4], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af68cc43ff7ed51f5557329c35fba949c":[4,0,0,2,2,56], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af7c1cf2c692140c4b28ebfc47acb0c41":[4,0,0,2,2,113], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70af86c9c188aaa34a76eee96de9bf6e989":[4,0,0,2,2,10], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70afc70c6a72061d9c26017a5cf5dec729b":[4,0,0,2,2,79], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70afcfb372eb2a607f821ad110815acf9d7":[4,0,0,2,2,31], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70afe9c20cdb1e88744d9a5f52977e95d1c":[4,0,0,2,2,74], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70aff9a4fe19078ac3e814989442beaa3a6":[4,0,0,2,2,14], +"status_8h.html#a10731415ffcd3e2330df10c4d5fd3d70affa3c8139019a077fac6d403d7ed0522":[4,0,0,2,2,108], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80":[4,0,0,2,1], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a07fdbda44f43cef9866a75b25053c2ae":[4,0,0,2,1,32], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a0aa3d1e18a2a217149fa8b1a306c9b08":[4,0,0,2,1,8], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a113ffbe9a1f243582c38ebd876cb736d":[4,0,0,2,1,2], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a22fa4802a34bac497f23e269a20a52f2":[4,0,0,2,1,35], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a273e92a0ff3b7eaf946b4b7fa6cc6c6c":[4,0,0,2,1,17], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a317fb9be1a80f6b1877f96a9a2db16ad":[4,0,0,2,1,23], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a37d80c8232775339a32805fe93e0ea7f":[4,0,0,2,1,36], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a40a08ae6ae17deaf390b1d0d7550791c":[4,0,0,2,1,1], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a44e8b2590369fb01a1479719c97c2b6f":[4,0,0,2,1,3], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a47034d8889521bbd300f45fdc19e1127":[4,0,0,2,1,6], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a473ea6cfa03490838fafee8730b48a2a":[4,0,0,2,1,11], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a476d7bcf9a593b749e435f20a9156eff":[4,0,0,2,1,5], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a49a1ea653ce112b3c53eedebcd60811d":[4,0,0,2,1,31], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a62ff6f5cc64399631defc0119731b514":[4,0,0,2,1,24], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a71b57630aebf5c20eecdab832c2a9235":[4,0,0,2,1,16], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a790c08a7d33e3aefce07c04120c4c19e":[4,0,0,2,1,15], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a7cb64f52c8d91d6ade3db6bc82a96c42":[4,0,0,2,1,27], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a827072fc245a99a60691e1e4b173ca86":[4,0,0,2,1,18], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a85c29dbfa6b06ffef3418cc9947ffff7":[4,0,0,2,1,4], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a892183c32b4929388bb75dc62230ddf3":[4,0,0,2,1,29], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a8a0d239cfdfa30fe730afea65941779b":[4,0,0,2,1,33], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a8a4e298931ba0698a72e397b1b57c885":[4,0,0,2,1,30], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a984189ec4cfe3e7647268c99f7e49ec9":[4,0,0,2,1,25], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9a6f40b7803639ac18bdf532e93e5ad5":[4,0,0,2,1,22], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9bb78b4f245d2870040d25c450febd4b":[4,0,0,2,1,19], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9cee6c417868ecaa69f99ff4f6576990":[4,0,0,2,1,0], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80aa76d5e3ce051bc7510be90e73663c93d":[4,0,0,2,1,7], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80aab97324e40ccfe1360080c651c330e62":[4,0,0,2,1,34], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ab88994c9ea9889ac4d9d656d62f550ed":[4,0,0,2,1,26], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80abc76f1b31fdac4525583cc19588240dc":[4,0,0,2,1,9], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80abef517217119e8446a8e3382e1f37eb3":[4,0,0,2,1,10], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ac3abc147873fe999c86431f9222eebf5":[4,0,0,2,1,12], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ad0229a12b17d3d12a28efed6213720d8":[4,0,0,2,1,13], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ae1d2c1366dbed428f6589f057acc507d":[4,0,0,2,1,14], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ae47047f2fac5f2f2a434fc501e5c3d4e":[4,0,0,2,1,28], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80ae93ff5b7fe31f8570308385d92d317b0":[4,0,0,2,1,20], +"status_8h.html#a36c934157b663b7b5fb5d6609c897c80af820300473609092a3e97a71b5af9ff9":[4,0,0,2,1,21], +"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51":[4,0,0,2,0], +"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51a08f92960811d1ff05b91a0870b4ecb92":[4,0,0,2,0,0], +"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51a0dafab74b55f98cfc1d00e4d1ef38725":[4,0,0,2,0,2], +"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51a7e4d95cb29122f06e17ca4aff55cc736":[4,0,0,2,0,1], +"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51aa78753a4de2d0379078bb09cdc1acdb2":[4,0,0,2,0,3], +"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51ab6f9d121707673a61cbe2c591f64fbf1":[4,0,0,2,0,5], +"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51ac6b8b7f138f6ca285fe1f4da707b2100":[4,0,0,2,0,6], +"status_8h.html#a6d667c1f8dd289a7e0f39bf10e800b51acfdc4826e08ce4b59f901952038e9206":[4,0,0,2,0,4], +"status_8h_source.html":[4,0,0,2], +"structjs_a_p_i_stats.html":[2,0,29], +"structjs_a_p_i_stats.html#a1545170bebb347d0ea1254f51c3027cf":[2,0,29,0], +"structjs_a_p_i_stats.html#a84e85ad9d94dbe9afd1101388574255d":[2,0,29,1], +"structjs_account_info.html":[2,0,32], +"structjs_account_info.html#a1237c3f19a42a3203825971b429312e9":[2,0,32,3], +"structjs_account_info.html#a17317abf03effdcdedc2003fca8adc71":[2,0,32,2], +"structjs_account_info.html#a21c14ca283400c684b18e61a534b6724":[2,0,32,8], +"structjs_account_info.html#a448578d621e878267ad5f1792002a665":[2,0,32,0], +"structjs_account_info.html#a94ab71c69b7883c2731ae8741ddc1e94":[2,0,32,5], +"structjs_account_info.html#aad93cf4bb6c1fbb09ae8545c03f315a9":[2,0,32,6], +"structjs_account_info.html#ab654d5c7456bb62df1808deb32a620fc":[2,0,32,7], +"structjs_account_info.html#ab6ba03298e1863132550b9b08d06048c":[2,0,32,4], +"structjs_account_info.html#ad1c254c5b8f11f57062a4e2d5fb10ae3":[2,0,32,1], +"structjs_account_limits.html":[2,0,30], +"structjs_account_limits.html#a38875d969274b0f0fcefc6b04ce56eb8":[2,0,30,5], +"structjs_account_limits.html#a4710a10950857a322c2a3ad6f946ded2":[2,0,30,2], +"structjs_account_limits.html#a4abf1972690c20d73bd314f2059e8013":[2,0,30,4], +"structjs_account_limits.html#a6169f29101d51d48eed0803b719e6338":[2,0,30,3], +"structjs_account_limits.html#a6fff014c46739410ecf298b0cf643b30":[2,0,30,1], +"structjs_account_limits.html#a7bfc63e6f49ce724663ee534c5efdfa4":[2,0,30,0], +"structjs_account_limits.html#a858edf99ee1c60354bdba4e59293fb6a":[2,0,30,7], +"structjs_account_limits.html#a8cca06ab72b715c02a6a2c72b59f6a52":[2,0,30,6], +"structjs_cluster_info.html":[2,0,15], +"structjs_cluster_info.html#a237a639579def1345e02f1490a510ed5":[2,0,15,3], +"structjs_cluster_info.html#a2e13d7ec417574100c938c4df78e5484":[2,0,15,0], +"structjs_cluster_info.html#a8dfcae3bc348a5b595b509e3f3d3500b":[2,0,15,2], +"structjs_cluster_info.html#af7d85652b52f56fa1eedce8f45fe6a19":[2,0,15,1], +"structjs_consumer_config.html":[2,0,21], +"structjs_consumer_config.html#a046177256938d6a601c629f9fd82f888":[2,0,21,27], +"structjs_consumer_config.html#a201217d93cfed17eb4d3e2d9579b826a":[2,0,21,0], +"structjs_consumer_config.html#a2a6cdec5efe7542496f8b8cccb539643":[2,0,21,29], +"structjs_consumer_config.html#a2f0243899885dc97f304f48ca52b5356":[2,0,21,4], +"structjs_consumer_config.html#a30d4142bac47ab6dc583c5ee193704e6":[2,0,21,19], +"structjs_consumer_config.html#a351b388a36ccb7978e6e85a6f4fc0816":[2,0,21,13], +"structjs_consumer_config.html#a364127e68bf0d3bf13efdc0b416667f4":[2,0,21,3], +"structjs_consumer_config.html#a36a14d666d99bdade87a5e21a25491d6":[2,0,21,2], +"structjs_consumer_config.html#a36cf121162cf0b40edf051991d851ee0":[2,0,21,1], +"structjs_consumer_config.html#a43f40b8eef0074b4146fb945b4645584":[2,0,21,14], +"structjs_consumer_config.html#a484c64b6c54f6f758f54315470ed20d0":[2,0,21,17], +"structjs_consumer_config.html#a4e86deefe08854b9a82b4908397aad32":[2,0,21,20], +"structjs_consumer_config.html#a651a94b9b78668dde830dc7869610e67":[2,0,21,7], +"structjs_consumer_config.html#a74a026cdd92c538bcf84297f4468bb21":[2,0,21,22], +"structjs_consumer_config.html#a802ea3bf0669395bee28611f4ecede80":[2,0,21,5], +"structjs_consumer_config.html#a8472d49fae908ab0291b4d62c8411b76":[2,0,21,15], +"structjs_consumer_config.html#a8a311af614dfae1b0f4e4af7db467aab":[2,0,21,6], +"structjs_consumer_config.html#a8bfc0284c57028bf9cf809205d989959":[2,0,21,30], +"structjs_consumer_config.html#a95aa4184ed77f69b7674756572da1ded":[2,0,21,23], +"structjs_consumer_config.html#aa2d0aff64a2c46122d0f0fe89e8ae011":[2,0,21,9], +"structjs_consumer_config.html#aa71aa3dfe5826466be301097b1bae04d":[2,0,21,21], +"structjs_consumer_config.html#ac439828c3bedb8826a1e92de13280d53":[2,0,21,18], +"structjs_consumer_config.html#acfba6d6ecb6323fd8ffe6c0bb4fbffae":[2,0,21,26], +"structjs_consumer_config.html#ad2f6ca3f2d0f977aedb8687c462c1cfc":[2,0,21,10], +"structjs_consumer_config.html#ad47e15e1d6a4a8b0b155f9d3d5873c95":[2,0,21,8], +"structjs_consumer_config.html#ada703eb1db0288d8a937126d6d856c6f":[2,0,21,28], +"structjs_consumer_config.html#ade510daf7c5d67553d2cd20b64ab9939":[2,0,21,12], +"structjs_consumer_config.html#ae0765f3b5effe365187d3cf809c6ed3c":[2,0,21,24], +"structjs_consumer_config.html#aeb2336d480e3885385d1b08410e89892":[2,0,21,16], +"structjs_consumer_config.html#af56ab7708b11e85e0b9115d152d281ca":[2,0,21,11], +"structjs_consumer_config.html#af6376a6009124c25d7016bc548f3855d":[2,0,21,25], +"structjs_consumer_info.html":[2,0,26], +"structjs_consumer_info.html#a15f2d68fbf126acc1907ba9462ad9ee9":[2,0,26,4], +"structjs_consumer_info.html#a2f63940ca1f024ad3840418c2f6a1ae1":[2,0,26,3], +"structjs_consumer_info.html#a31282cdc72000a91af03f89899740bfa":[2,0,26,11], +"structjs_consumer_info.html#a57e4a4139310c50a1f3d51af67197af0":[2,0,26,8], +"structjs_consumer_info.html#a670d38f2e9ba5c354ca3560a8064d00c":[2,0,26,2], +"structjs_consumer_info.html#a6f4401563a9fd102226d82cdc6136e32":[2,0,26,10], +"structjs_consumer_info.html#a882bebeb7af80fcce088afdf2c98de50":[2,0,26,6], +"structjs_consumer_info.html#a8f21939613163a7c0ebfb521aa471260":[2,0,26,0], +"structjs_consumer_info.html#a932bf14ebb9ce167af8975e3b1f8d001":[2,0,26,7], +"structjs_consumer_info.html#a9359aea7cd05a27b2a15f8a35cdb1008":[2,0,26,1], +"structjs_consumer_info.html#ab69c36ae092df9b0663b675a5abbab55":[2,0,26,5], +"structjs_consumer_info.html#aeaefd5a500996013b1ce13d8872e869b":[2,0,26,9], +"structjs_consumer_info_list.html":[2,0,27], +"structjs_consumer_info_list.html#a75354882af5e11959b198a70bde14db8":[2,0,27,0], +"structjs_consumer_info_list.html#a813c908362a6426a929133f7c0d3395f":[2,0,27,1], +"structjs_consumer_names_list.html":[2,0,28], +"structjs_consumer_names_list.html#a0bccbad8ac5d335a0ed89970a58900fb":[2,0,28,1], +"structjs_consumer_names_list.html#aa4b3cf17902a2d580cc3a230bfa5d309":[2,0,28,0], +"structjs_consumer_sequence_mismatch.html":[2,0,22], +"structjs_consumer_sequence_mismatch.html#aad6a17af1719c023c38a6fd254b73f8e":[2,0,22,0], +"structjs_consumer_sequence_mismatch.html#ac1df353001d853c8a56cef9f82fb831c":[2,0,22,2], +"structjs_consumer_sequence_mismatch.html#adb383429dadb1ab0e1f7d013bc546a28":[2,0,22,1], +"structjs_direct_get_msg_options.html":[2,0,36], +"structjs_direct_get_msg_options.html#a16ce7908a3d1690b8ae8bc22350ac238":[2,0,36,1], +"structjs_direct_get_msg_options.html#a60211d7499cfecdd6e61e6c73af1a2f5":[2,0,36,0], +"structjs_direct_get_msg_options.html#aae968f31cdda96fa3c5e9374a36b9630":[2,0,36,2], +"structjs_external_stream.html":[2,0,4], +"structjs_external_stream.html#a26ca427f3c5be1cae579ddccc16432d3":[2,0,4,1], +"structjs_external_stream.html#a2eaf2c0c3e77c269f44e254af8b24e96":[2,0,4,0], +"structjs_fetch_request.html":[2,0,37], +"structjs_fetch_request.html#a3298db691c2ecb9725cc029e2c35d6d1":[2,0,37,2], +"structjs_fetch_request.html#a84f06b60e25decb2674996f0cb315f63":[2,0,37,1], +"structjs_fetch_request.html#ac3351138ce8ac3b321ac1eb78887116e":[2,0,37,0], +"structjs_fetch_request.html#ae251eebb1998a39fe3b898302b58293d":[2,0,37,3], +"structjs_fetch_request.html#ae8e73c7cc2e2a2d2502407c9b1522496":[2,0,37,4], +"structjs_lost_stream_data.html":[2,0,10], +"structjs_lost_stream_data.html#a5d2e87697526033c842a7f955776dfda":[2,0,10,0], +"structjs_lost_stream_data.html#a841fcadca3f66e9170a51080dc1acf30":[2,0,10,2], +"structjs_lost_stream_data.html#abdc373ed7fc9b7cf161c13da1913fc9a":[2,0,10,1], +"structjs_msg_meta_data.html":[2,0,33], +"structjs_msg_meta_data.html#a02f1bbd37e9650ed6bfda0210f038e30":[2,0,33,2], +"structjs_msg_meta_data.html#a23d5fd1992033164c73d5c2a16a4e321":[2,0,33,0], +"structjs_msg_meta_data.html#a32e2a9438d2dc769f7f64d2f8897abc4":[2,0,33,4], +"structjs_msg_meta_data.html#a388e38ccea591181436d199dc7c2f8ea":[2,0,33,6], +"structjs_msg_meta_data.html#a6dcc2a442984b0ca070b3d8077192127":[2,0,33,5], +"structjs_msg_meta_data.html#a9a50965fac061a9728b160702d3f56ff":[2,0,33,1], +"structjs_msg_meta_data.html#abab9ed5600a3629ea6d6c78170d7d5e9":[2,0,33,3], +"structjs_options.html":[2,0,38], +"structjs_options.html#a5ce5c11cc9b9df2b6bc47cd77d7b1dc4":[2,0,38,5], +"structjs_options.html#a7fd42e1f83da5861e716137c16f8b72f":[2,0,38,4], +"structjs_options.html#ab06e45296fccf0fe6152e083e38d916f":[2,0,38,2], +"structjs_options.html#ae4df6c9c01c0ea9ab0e6d5a6ec8af74e":[2,0,38,3], +"structjs_options.html#ae50544ee0ef8dd7d02ef9802805807ae":[2,0,38,6], +"structjs_options_1_1js_options_publish_async.html":[2,0,38,0], +"structjs_options_1_1js_options_publish_async.html#a0a180995c49990ca277e449b7d43616b":[2,0,38,0,3], +"structjs_options_1_1js_options_publish_async.html#a508140119f40a2c056d4ee8c0cd55df9":[2,0,38,0,1], +"structjs_options_1_1js_options_publish_async.html#a60c95f10797c04ea2e625759c6936ec9":[2,0,38,0,2], +"structjs_options_1_1js_options_publish_async.html#a784a0029c30e82ff37c39ae6c276bc81":[2,0,38,0,4], +"structjs_options_1_1js_options_publish_async.html#ada58fefe0ed40157b5f5d44b9dd175f9":[2,0,38,0,5], +"structjs_options_1_1js_options_publish_async.html#add8dd21cbab2d5df19688c26365fe4d1":[2,0,38,0,0], +"structjs_options_1_1js_options_stream.html":[2,0,38,1], +"structjs_options_1_1js_options_stream.html#a2ca89c298b4df1f5e3e0a44e205c789c":[2,0,38,1,3], +"structjs_options_1_1js_options_stream.html#afe680264223b434ca6959f9e122af029":[2,0,38,1,2], +"structjs_options_1_1js_options_stream_1_1js_options_stream_info.html":[2,0,38,1,0], +"structjs_options_1_1js_options_stream_1_1js_options_stream_info.html#a73f847afe18f56eaaf6788900270bef7":[2,0,38,1,0,0], +"structjs_options_1_1js_options_stream_1_1js_options_stream_info.html#af874e0f5aa15fb2a41504631ed786e6d":[2,0,38,1,0,1], +"structjs_options_1_1js_options_stream_1_1js_options_stream_purge.html":[2,0,38,1,1], +"structjs_options_1_1js_options_stream_1_1js_options_stream_purge.html#a0d61e5d3c9c518f455549086ababe7f6":[2,0,38,1,1,1], +"structjs_options_1_1js_options_stream_1_1js_options_stream_purge.html#a882c1ce1e636817450893caa72aa4eda":[2,0,38,1,1,2], +"structjs_options_1_1js_options_stream_1_1js_options_stream_purge.html#aa99e6ee3bef1c22243f01544181315fe":[2,0,38,1,1,0], +"structjs_peer_info.html":[2,0,14], +"structjs_peer_info.html#a3f3e09c5996858ec5faca2dc7fa5224e":[2,0,14,2], +"structjs_peer_info.html#a49a2623963dad653a6d7996c750056c9":[2,0,14,4], +"structjs_peer_info.html#a8441d023932c388953197f7ea39402fe":[2,0,14,3], +"structjs_peer_info.html#abf29230ce03a1c14d50227663e07de6a":[2,0,14,0], +"structjs_peer_info.html#ad8cecd039a8ad1c68daba89007b055d4":[2,0,14,1], +"structjs_placement.html":[2,0,3], +"structjs_placement.html#a35644f07531409518521b1b4fa28c9e3":[2,0,3,2], +"structjs_placement.html#ad8c83588d57f0e30959cfb6f3d5d61bf":[2,0,3,0], +"structjs_placement.html#af078a85b744b9ff3771bb2da6005b90d":[2,0,3,1], +"structjs_pub_ack.html":[2,0,34], +"structjs_pub_ack.html#a01d302d5e1a2e71487a8c74c3fed1691":[2,0,34,1], +"structjs_pub_ack.html#a0381a49ff62e8fac7a52cad6a5eb7243":[2,0,34,3], +"structjs_pub_ack.html#a0b73200c0b035db3c9c96421706d51b0":[2,0,34,2], +"structjs_pub_ack.html#a4fd5e6cdb7217d72c553afcc75358893":[2,0,34,0], +"structjs_pub_ack_err.html":[2,0,35], +"structjs_pub_ack_err.html#a156ca2f779d132ffa8c519124cf9739b":[2,0,35,0], +"structjs_pub_ack_err.html#a406e39e818f93bc59ac18cbdf035baf5":[2,0,35,1], +"structjs_pub_ack_err.html#aa558fd192cc6d6c02ad891445ec5aa8a":[2,0,35,2], +"structjs_pub_ack_err.html#ad1a85e6ff4046d7df33c1e24323ddc87":[2,0,35,3], +"structjs_pub_options.html":[2,0,2], +"structjs_pub_options.html#a095391b33a261586fc02eaf013b65e61":[2,0,2,3], +"structjs_pub_options.html#a1b242c9311b904a2e5337417b5c6d143":[2,0,2,0], +"structjs_pub_options.html#a3b02b60b05caa6d242079a4c26b181bf":[2,0,2,4], +"structjs_pub_options.html#a740a7edee8c832a75b75fded6046ba90":[2,0,2,6], +"structjs_pub_options.html#ac7ac74d2557d772c3092288dacf3711f":[2,0,2,2], +"structjs_pub_options.html#ac8708487360b784f7dd5d7a21e5617c0":[2,0,2,1], +"structjs_pub_options.html#aeefec1d2c7644562d23b87e55bf2e253":[2,0,2,5], +"structjs_re_publish.html":[2,0,6], +"structjs_re_publish.html#a16ebc4cdae4a407cf4e32aad212888db":[2,0,6,2], +"structjs_re_publish.html#a1acb593929fd69bbe0f4dc8300dfaeb2":[2,0,6,0], +"structjs_re_publish.html#a662b2e57d237b171b2b61509f7e1023a":[2,0,6,1], +"structjs_sequence_info.html":[2,0,25], +"structjs_sequence_info.html#a4e94c91650b7db253645515fee4c3b05":[2,0,25,2], +"structjs_sequence_info.html#ab52c55c1d0edd20e064870b490b4b990":[2,0,25,1], +"structjs_sequence_info.html#ae4416a5d766e07db207e563668edd06f":[2,0,25,0], +"structjs_sequence_pair.html":[2,0,24], +"structjs_sequence_pair.html#a6d205effd29f8994f0028bfaf2e8d816":[2,0,24,0], +"structjs_sequence_pair.html#ab051e0815302c48ba6122bd18d9d76f7":[2,0,24,1], +"structjs_stream_alternate.html":[2,0,17], +"structjs_stream_alternate.html#a07f36f98c7dcdf435f803e4f0ccaac57":[2,0,17,0], +"structjs_stream_alternate.html#a3e85014d03dd425435ed5a0b6a5dfb1d":[2,0,17,2], +"structjs_stream_alternate.html#a7c25ab1a427b78c4e1ba58ff7cdb5a8f":[2,0,17,1], +"structjs_stream_config.html":[2,0,9], +"structjs_stream_config.html#a0b44ea5251ef20bf5b5658bcfbea832d":[2,0,9,11], +"structjs_stream_config.html#a0c5f3354073dbe72650e3db7f59a47af":[2,0,9,2], +"structjs_stream_config.html#a0ce1d0a7c1f0576151f505724ae393d1":[2,0,9,32], +"structjs_stream_config.html#a28630f6f07ca02553c5d5718d7c29721":[2,0,9,26], +"structjs_stream_config.html#a34960d6acc710c2f32b563f4bb7c9c0a":[2,0,9,20], +"structjs_stream_config.html#a3fb7d5e1a09829fe742749da880afe4a":[2,0,9,28], +"structjs_stream_config.html#a406554aaf1e16eed4abade52f7ca5e61":[2,0,9,30], +"structjs_stream_config.html#a4f9f422d2e9e7389860291ab19bd7f10":[2,0,9,1], +"structjs_stream_config.html#a50f866f0e73c4ff0a5f43b354a059fa9":[2,0,9,15], +"structjs_stream_config.html#a575ffbaa85b0300032963296b090583a":[2,0,9,23], +"structjs_stream_config.html#a59c34091f336eafa77da2991c852c0d8":[2,0,9,12], +"structjs_stream_config.html#a5ce51cb5a36febda30bb444a0f59c2d1":[2,0,9,33], +"structjs_stream_config.html#a5ebc95b76afafa5e7a129953ba1bb3c7":[2,0,9,4], +"structjs_stream_config.html#a60a5184d1d97b056dbb31ac6a5b3d82d":[2,0,9,6] }; diff --git a/deps/nats.c/doc/html/navtreeindex4.js b/deps/nats.c/doc/html/navtreeindex4.js index 44a546d..778b149 100644 --- a/deps/nats.c/doc/html/navtreeindex4.js +++ b/deps/nats.c/doc/html/navtreeindex4.js @@ -1,15 +1,174 @@ var NAVTREEINDEX4 = { -"structkv_keys_list.html#aa5cb40820a1a927375215e0a94ecfc18":[2,0,40,0], -"structkv_purge_options.html":[2,0,38], -"structkv_purge_options.html#a245c2def0f3aabe617219772cf7680a8":[2,0,38,0], -"structkv_purge_options.html#a47fed1e95073666cbe441aba7c149da6":[2,0,38,1], -"structkv_watch_options.html":[2,0,37], -"structkv_watch_options.html#a0535edd21b26affc0057575bafc21a07":[2,0,37,0], -"structkv_watch_options.html#a08274f08ae96e14d9ded326e4e665649":[2,0,37,1], -"structkv_watch_options.html#a56183d56585697d058c7eeb20bdddb66":[2,0,37,3], -"structkv_watch_options.html#ac9094bce4f3c6513431ba32fb49e5605":[2,0,37,2], +"structjs_stream_config.html#a7338c82c8cbfcd5f4bfb7ad34b1d8395":[2,0,9,5], +"structjs_stream_config.html#a7aa4849b0f555c9de6b6da953929a565":[2,0,9,29], +"structjs_stream_config.html#a7ed5e8e5a8d367b25751b9708d0e395b":[2,0,9,31], +"structjs_stream_config.html#a7fe3d5086f1c660a6999ae40ecd370e5":[2,0,9,0], +"structjs_stream_config.html#a8e358fbc569a1c6d49c704e6dbdf8609":[2,0,9,14], +"structjs_stream_config.html#a8f0ee08922e5b2108082b5b9e4a6284b":[2,0,9,19], +"structjs_stream_config.html#a93a2336a57b6bfb792d530fd13a90641":[2,0,9,10], +"structjs_stream_config.html#a95ab0061b6e935b129a4a9c133e6b11c":[2,0,9,25], +"structjs_stream_config.html#a9d67ddcc7c54c345dd60ed5e59234f1e":[2,0,9,27], +"structjs_stream_config.html#a9e0ff10273d0182f885615b4f7d1cc20":[2,0,9,16], +"structjs_stream_config.html#aa167c7547d13bf2a01510a375ad38340":[2,0,9,9], +"structjs_stream_config.html#aa538765ad97d343d60212ebd9894661e":[2,0,9,8], +"structjs_stream_config.html#ab2186aae798df6c222b3fa69e31597e1":[2,0,9,3], +"structjs_stream_config.html#aba71cdb342181f52bb9f7ff5f770a1fa":[2,0,9,24], +"structjs_stream_config.html#acdba5b22e4e60fd81a54769a7d09bc51":[2,0,9,18], +"structjs_stream_config.html#acee6c66afc78d79c2f518eed89177efb":[2,0,9,17], +"structjs_stream_config.html#ad75e47d4293441bd5ddbc5eaf01e0451":[2,0,9,7], +"structjs_stream_config.html#adbf2c948cf8091b149603b918ef49ffc":[2,0,9,13], +"structjs_stream_config.html#aede3fd2ab13d230eda14c96f9997e1b7":[2,0,9,21], +"structjs_stream_config.html#af2d42dd29b9a35257937aeeb53c9f287":[2,0,9,22], +"structjs_stream_consumer_limits.html":[2,0,8], +"structjs_stream_consumer_limits.html#a04a6c89366cf75dbf76e43c786b133a4":[2,0,8,1], +"structjs_stream_consumer_limits.html#aaf4fdc51f35f27690c05c410d185e5d1":[2,0,8,0], +"structjs_stream_info.html":[2,0,18], +"structjs_stream_info.html#a2e7ca48a93fe57265609e7e0cd3fa386":[2,0,18,5], +"structjs_stream_info.html#a578ce52a275c690dd4627c1d119c7838":[2,0,18,1], +"structjs_stream_info.html#a720c4ff9090bafda50000843810ab1bb":[2,0,18,7], +"structjs_stream_info.html#a766ac56dec3bd19fa5b9861fb5f64397":[2,0,18,2], +"structjs_stream_info.html#a8d10d6fdc3f713ac726c72cae06a209a":[2,0,18,3], +"structjs_stream_info.html#ab71aae7e4f6c62e2a09a3a52c9e4fa2a":[2,0,18,4], +"structjs_stream_info.html#ad37a5fd700bd5df54e5002c7de51c3ad":[2,0,18,8], +"structjs_stream_info.html#adcc402d28e0ee443419e9b549da233c6":[2,0,18,0], +"structjs_stream_info.html#af14110cb1f8e16e3dade8d9f7c2fd672":[2,0,18,6], +"structjs_stream_info_list.html":[2,0,19], +"structjs_stream_info_list.html#a7b096ee7a25363f231f56419a244daef":[2,0,19,0], +"structjs_stream_info_list.html#a8bc8490af12bb4f7a245605aecde62c2":[2,0,19,1], +"structjs_stream_names_list.html":[2,0,20], +"structjs_stream_names_list.html#a1875a7e449759dfc2a40b0eb74de0acf":[2,0,20,0], +"structjs_stream_names_list.html#ab1385b6333537306d0462946c26cde4f":[2,0,20,1], +"structjs_stream_source.html":[2,0,5], +"structjs_stream_source.html#a295458d156af5373bb3f5ab06612a888":[2,0,5,4], +"structjs_stream_source.html#a67eb1dac41b2d826a923cfb23baa24a5":[2,0,5,2], +"structjs_stream_source.html#a7d9e5c064866b3f0b5601193c5885ec3":[2,0,5,0], +"structjs_stream_source.html#aa304239ee823ef87fcb53ebb0c077e7b":[2,0,5,5], +"structjs_stream_source.html#ad6948b7a34c202f324b6d2beb32fe5ed":[2,0,5,1], +"structjs_stream_source.html#af787b51dde9d77626f33860564eb08c3":[2,0,5,3], +"structjs_stream_source_info.html":[2,0,16], +"structjs_stream_source_info.html#a0c0f08cd9dc97a5df116356bfebb8824":[2,0,16,4], +"structjs_stream_source_info.html#a28b8cc0a9d487672955d3a3fa03de247":[2,0,16,3], +"structjs_stream_source_info.html#a6c150fb59dd91a954e0877937a5498d5":[2,0,16,6], +"structjs_stream_source_info.html#a6db3c6ff8a465a45f8bd5c7bdf5f6c04":[2,0,16,0], +"structjs_stream_source_info.html#a7eb19dd2637079fd1e970a2b38d33e05":[2,0,16,1], +"structjs_stream_source_info.html#ab2ee0ca3ecd98c2df6d4e9bd88686863":[2,0,16,2], +"structjs_stream_source_info.html#ad16f78fb770402bf3a2e15387b02e7da":[2,0,16,5], +"structjs_stream_state.html":[2,0,13], +"structjs_stream_state.html#a1adf8991f31fc4db9d6907a0316f8eec":[2,0,13,11], +"structjs_stream_state.html#a22da809fe7a1ec3101841e86d6708827":[2,0,13,4], +"structjs_stream_state.html#a27f4cfb85c0f1b0c5c7ad5275bd25d85":[2,0,13,12], +"structjs_stream_state.html#a34a08a64c97269165630bf2e0c78c2c0":[2,0,13,10], +"structjs_stream_state.html#a495269fe83c6bbf2023cca94add0a888":[2,0,13,0], +"structjs_stream_state.html#a4af56e8bee7262ab050f2a25114c5909":[2,0,13,7], +"structjs_stream_state.html#a55bb6719163acef7fdb6d0bc3ae8d5da":[2,0,13,2], +"structjs_stream_state.html#a67cbd0d8b43d8c05c8b4cd6b0e44dab0":[2,0,13,5], +"structjs_stream_state.html#aaa43db17641826e7c6ecc1954f641960":[2,0,13,6], +"structjs_stream_state.html#abcf4d3c581c06d820f1ad21d640bef3f":[2,0,13,9], +"structjs_stream_state.html#acbec2f01830b56cb4c0bf54ae5170e51":[2,0,13,8], +"structjs_stream_state.html#ae603fa6ecfb63c93b61272b7d1b8fb4d":[2,0,13,1], +"structjs_stream_state.html#afb7a708022faff518c060b33e99b04b0":[2,0,13,3], +"structjs_stream_state_subject.html":[2,0,11], +"structjs_stream_state_subject.html#a8b9b2edc5afe82b7b3bc7dbdd67a4384":[2,0,11,1], +"structjs_stream_state_subject.html#aa766824a7f8b69db592971af3262640e":[2,0,11,0], +"structjs_stream_state_subjects.html":[2,0,12], +"structjs_stream_state_subjects.html#ab88e2026f518b6cdffd3901b5e5cd374":[2,0,12,1], +"structjs_stream_state_subjects.html#aef3d1e886b16961daa84c43650fa80c0":[2,0,12,0], +"structjs_sub_options.html":[2,0,23], +"structjs_sub_options.html#a21a905c49dfab61729d8674702d196b2":[2,0,23,3], +"structjs_sub_options.html#a7aa5b8439ed288b858943f28c291cb36":[2,0,23,1], +"structjs_sub_options.html#a856a6af4a7ff5aa2e736338091e69484":[2,0,23,0], +"structjs_sub_options.html#a95c5d2db8ca97d644042d436de119be4":[2,0,23,5], +"structjs_sub_options.html#aaf4b620d112a31f51a20389c5405805d":[2,0,23,2], +"structjs_sub_options.html#acab25d71a2efe26bb3b084071435c2b5":[2,0,23,4], +"structjs_subject_transform_config.html":[2,0,7], +"structjs_subject_transform_config.html#a17ccd4ff50cbfdc3e077ea76fa1f0720":[2,0,7,1], +"structjs_subject_transform_config.html#a88f31069ce9bb75bcd8c34c32a204299":[2,0,7,0], +"structjs_tier.html":[2,0,31], +"structjs_tier.html#a1ed542b9acccbe7761839f33c43053a6":[2,0,31,0], +"structjs_tier.html#a3f9234fde387faf3775d841aa797a6ea":[2,0,31,3], +"structjs_tier.html#ab16c426e1c35d8c0fd6c460c43580a39":[2,0,31,2], +"structjs_tier.html#ac33ce862c041572d10184e7fa0dd0bfe":[2,0,31,4], +"structjs_tier.html#aeff4a4cb86e10d8d7749d6ff69f97ed1":[2,0,31,1], +"structjs_tier.html#af2edbabd5e078b1e31dd73d44fd507d3":[2,0,31,5], +"structkv_config.html":[2,0,39], +"structkv_config.html#a0ec6b3afbfdaa33436e2ae748e986e98":[2,0,39,3], +"structkv_config.html#a11b636da727c17566d5ab1274f69fee5":[2,0,39,0], +"structkv_config.html#a1bc37777aa91b8b57a70e7647670cd12":[2,0,39,5], +"structkv_config.html#a281156a9df0130abad7f3b2728ac35a5":[2,0,39,2], +"structkv_config.html#a48f0f70383eff868321f9c94ae1a87cd":[2,0,39,7], +"structkv_config.html#a941e9cad2bab67f093bf4d9567b4749a":[2,0,39,1], +"structkv_config.html#ac86ca661d283627bccecf70cd286c8f8":[2,0,39,9], +"structkv_config.html#ad2f5503e2f2522cb52e0ba1b86983dba":[2,0,39,4], +"structkv_config.html#ad5db9a58224d93ab86b4cfc4c46f1897":[2,0,39,6], +"structkv_config.html#ae172d3e442eef1a57cd7cf266d9e8951":[2,0,39,8], +"structkv_config.html#af1d95d5434b10e929d6ce6fa6129a789":[2,0,39,11], +"structkv_config.html#afbfd6725c0b0c9fb661a96c06d788ac9":[2,0,39,10], +"structkv_entry_list.html":[2,0,42], +"structkv_entry_list.html#a179d4d3e5844d005be1ed9134b969a50":[2,0,42,0], +"structkv_entry_list.html#a82da55d42e1a6862d3b0034dfc6f321f":[2,0,42,1], +"structkv_keys_list.html":[2,0,43], +"structkv_keys_list.html#a625f7b34784e024a538359efd9a97265":[2,0,43,1], +"structkv_keys_list.html#aa5cb40820a1a927375215e0a94ecfc18":[2,0,43,0], +"structkv_purge_options.html":[2,0,41], +"structkv_purge_options.html#a245c2def0f3aabe617219772cf7680a8":[2,0,41,0], +"structkv_purge_options.html#a47fed1e95073666cbe441aba7c149da6":[2,0,41,1], +"structkv_watch_options.html":[2,0,40], +"structkv_watch_options.html#a0535edd21b26affc0057575bafc21a07":[2,0,40,0], +"structkv_watch_options.html#a08274f08ae96e14d9ded326e4e665649":[2,0,40,1], +"structkv_watch_options.html#a56183d56585697d058c7eeb20bdddb66":[2,0,40,3], +"structkv_watch_options.html#ac9094bce4f3c6513431ba32fb49e5605":[2,0,40,2], +"structmicro__endpoint__config__s.html":[2,3,2,0], +"structmicro__endpoint__config__s.html#a1a47fe3be59a271217bcb4341cddecae":[2,3,2,0,0], +"structmicro__endpoint__config__s.html#a4a916af910a5eb88abf3f0aa60082667":[2,3,2,0,3], +"structmicro__endpoint__config__s.html#a6c58e0e9c1da670da4a38993a613eb7d":[2,3,2,0,1], +"structmicro__endpoint__config__s.html#a7aee4ab9e29512c0b6ee12ba233c0fb7":[2,3,2,0,2], +"structmicro__endpoint__config__s.html#ae9a1cf8dc159a651869e33c1f5cab3eb":[2,3,2,0,4], +"structmicro__endpoint__info__s.html":[2,3,2,1], +"structmicro__endpoint__info__s.html#a94d9e2e4c19e17f06c827577cd967502":[2,3,2,1,1], +"structmicro__endpoint__info__s.html#ab8b3d1a96e19424fc7f367f2e0dc8175":[2,3,2,1,0], +"structmicro__endpoint__info__s.html#aef2820ecb742b9ce9a643d39343df740":[2,3,2,1,2], +"structmicro__endpoint__stats__s.html":[2,3,2,2], +"structmicro__endpoint__stats__s.html#a08745ca3e151b1d7d5c064659975f4d6":[2,3,2,2,1], +"structmicro__endpoint__stats__s.html#a1adfdb3c1641301b419ccf136cbaa927":[2,3,2,2,2], +"structmicro__endpoint__stats__s.html#a2adef3bbd175d542387fe47b9a156e6c":[2,3,2,2,7], +"structmicro__endpoint__stats__s.html#a3e971e78657d71f28477476a560162dd":[2,3,2,2,4], +"structmicro__endpoint__stats__s.html#a532060ae39ed420c3f84244163b4590b":[2,3,2,2,5], +"structmicro__endpoint__stats__s.html#a85ead23cb79aeb6e5c9b4409544412db":[2,3,2,2,3], +"structmicro__endpoint__stats__s.html#acc74c3df96d5f8595521a57dd0eb0cde":[2,3,2,2,6], +"structmicro__endpoint__stats__s.html#acfcec95bf83819e8dfe64a4babf62f8e":[2,3,2,2,0], +"structmicro__service__config__s.html":[2,3,2,3], +"structmicro__service__config__s.html#a090e884af689503d9c2fcb086a5478e6":[2,3,2,3,2], +"structmicro__service__config__s.html#a0a0ae007824f6f53fbb0cb4b940c5ad2":[2,3,2,3,8], +"structmicro__service__config__s.html#a20d3780b9452237119aee56853216b03":[2,3,2,3,1], +"structmicro__service__config__s.html#a4069a6987c910fb4f045b233b6befc27":[2,3,2,3,6], +"structmicro__service__config__s.html#a4a5a97a4181a4870353f9e139cca72fc":[2,3,2,3,3], +"structmicro__service__config__s.html#a8385ccdaef440f9406a876868663ec56":[2,3,2,3,5], +"structmicro__service__config__s.html#ab349d30e0f637d449c0af865234a0985":[2,3,2,3,7], +"structmicro__service__config__s.html#acb82e165927f5e5c404beb4f3120a8e2":[2,3,2,3,0], +"structmicro__service__config__s.html#ae13d06757417aabf01619090ab83f977":[2,3,2,3,4], +"structmicro__service__info__s.html":[2,3,2,4], +"structmicro__service__info__s.html#a292990d3fd1d94e48fd91e5556a2c091":[2,3,2,4,5], +"structmicro__service__info__s.html#a3ac45f2dd5827f95160b1d7899dcf9b7":[2,3,2,4,1], +"structmicro__service__info__s.html#a46ad1eddcbed5db1af32add59a910369":[2,3,2,4,2], +"structmicro__service__info__s.html#a47188c4f3a9cc6fdd1151dd59db4b1fe":[2,3,2,4,0], +"structmicro__service__info__s.html#a9368a61ebb6cf74a27ea261d7517d9c2":[2,3,2,4,4], +"structmicro__service__info__s.html#ac65a0b0e98971c334080b022f71e482d":[2,3,2,4,6], +"structmicro__service__info__s.html#ad1b5706234217f33fdac3435ca920b39":[2,3,2,4,3], +"structmicro__service__info__s.html#afa11d35ca9aa8c19bc95409727479cd7":[2,3,2,4,7], +"structmicro__service__stats__s.html":[2,3,2,5], +"structmicro__service__stats__s.html#a53e7ea532c4bc4f9a9c4322b28060a4e":[2,3,2,5,4], +"structmicro__service__stats__s.html#a88ca92be3498c27f5519c8ddbd2dc9df":[2,3,2,5,6], +"structmicro__service__stats__s.html#aa1ac7f9fd93c943ab8619e625976e567":[2,3,2,5,5], +"structmicro__service__stats__s.html#ace4844493f3a27ce7b1accb2d1bb4da5":[2,3,2,5,2], +"structmicro__service__stats__s.html#ae81f531e8fb5f4fe6bba9552743985ca":[2,3,2,5,1], +"structmicro__service__stats__s.html#af37a4da72bb1e1ad292dd1caa6a309a2":[2,3,2,5,0], +"structmicro__service__stats__s.html#afbc7f9586df0c4d8969736e76284bb20":[2,3,2,5,3], +"structnats_metadata.html":[2,0,1], +"structnats_metadata.html#a5412b3c7d4c67cc45f8d27df25851411":[2,0,1,1], +"structnats_metadata.html#af29f95d80bf99ab77601518b143b1dd5":[2,0,1,0], "structnats_msg_list.html":[2,0,0], "structnats_msg_list.html#a5c48bf6b9e7f1d889d7ad31694911750":[2,0,0,1], -"structnats_msg_list.html#aa123668879f1c9c11c9be7bd81a205c5":[2,0,0,0] +"structnats_msg_list.html#aa123668879f1c9c11c9be7bd81a205c5":[2,0,0,0], +"topics.html":[2] }; diff --git a/deps/nats.c/doc/html/pages.html b/deps/nats.c/doc/html/pages.html index 575ba6c..660dece 100644 --- a/deps/nats.c/doc/html/pages.html +++ b/deps/nats.c/doc/html/pages.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Related Pages @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@
- + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + +
diff --git a/deps/nats.c/doc/html/structjs_a_p_i_stats-members.html b/deps/nats.c/doc/html/structjs_a_p_i_stats-members.html index bef869f..95a9de5 100644 --- a/deps/nats.c/doc/html/structjs_a_p_i_stats-members.html +++ b/deps/nats.c/doc/html/structjs_a_p_i_stats-members.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Member List @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
jsStreamConsumerLimits Member List
+
+
+ +

This is the complete list of members for jsStreamConsumerLimits, including all inherited members.

+ + + +
InactiveThresholdjsStreamConsumerLimits
MaxAckPendingjsStreamConsumerLimits
+
+ + + + + diff --git a/deps/nats.c/doc/html/structjs_stream_consumer_limits.html b/deps/nats.c/doc/html/structjs_stream_consumer_limits.html new file mode 100644 index 0000000..68ae8eb --- /dev/null +++ b/deps/nats.c/doc/html/structjs_stream_consumer_limits.html @@ -0,0 +1,157 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: jsStreamConsumerLimits Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
jsStreamConsumerLimits Struct Reference
+
+
+ +

#include <nats.h>

+ + + + + + +

+Public Attributes

int64_t InactiveThreshold
 
int MaxAckPending
 
+

Detailed Description

+

SubjectTransformConfig is for applying a subject transform (to matching messages) before doing anything else when a new message is received

+

Member Data Documentation

+ +

◆ InactiveThreshold

+ +
+
+ + + + +
int64_t jsStreamConsumerLimits::InactiveThreshold
+
+ +
+
+ +

◆ MaxAckPending

+ +
+
+ + + + +
int jsStreamConsumerLimits::MaxAckPending
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + + diff --git a/deps/nats.c/doc/html/structjs_stream_consumer_limits.js b/deps/nats.c/doc/html/structjs_stream_consumer_limits.js new file mode 100644 index 0000000..0ba0bc4 --- /dev/null +++ b/deps/nats.c/doc/html/structjs_stream_consumer_limits.js @@ -0,0 +1,5 @@ +var structjs_stream_consumer_limits = +[ + [ "InactiveThreshold", "structjs_stream_consumer_limits.html#aaf4fdc51f35f27690c05c410d185e5d1", null ], + [ "MaxAckPending", "structjs_stream_consumer_limits.html#a04a6c89366cf75dbf76e43c786b133a4", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/structjs_stream_info-members.html b/deps/nats.c/doc/html/structjs_stream_info-members.html index 6a10528..670009d 100644 --- a/deps/nats.c/doc/html/structjs_stream_info-members.html +++ b/deps/nats.c/doc/html/structjs_stream_info-members.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Member List @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
jsSubjectTransformConfig Member List
+
+
+ +

This is the complete list of members for jsSubjectTransformConfig, including all inherited members.

+ + + +
DestinationjsSubjectTransformConfig
SourcejsSubjectTransformConfig
+
+ + + + + diff --git a/deps/nats.c/doc/html/structjs_subject_transform_config.html b/deps/nats.c/doc/html/structjs_subject_transform_config.html new file mode 100644 index 0000000..68f6d05 --- /dev/null +++ b/deps/nats.c/doc/html/structjs_subject_transform_config.html @@ -0,0 +1,157 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: jsSubjectTransformConfig Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
jsSubjectTransformConfig Struct Reference
+
+
+ +

#include <nats.h>

+ + + + + + +

+Public Attributes

const char * Source
 
const char * Destination
 
+

Detailed Description

+

SubjectTransformConfig is for applying a subject transform (to matching messages) before doing anything else when a new message is received

+

Member Data Documentation

+ +

◆ Source

+ +
+
+ + + + +
const char* jsSubjectTransformConfig::Source
+
+ +
+
+ +

◆ Destination

+ +
+
+ + + + +
const char* jsSubjectTransformConfig::Destination
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + + diff --git a/deps/nats.c/doc/html/structjs_subject_transform_config.js b/deps/nats.c/doc/html/structjs_subject_transform_config.js new file mode 100644 index 0000000..bfcfead --- /dev/null +++ b/deps/nats.c/doc/html/structjs_subject_transform_config.js @@ -0,0 +1,5 @@ +var structjs_subject_transform_config = +[ + [ "Source", "structjs_subject_transform_config.html#a88f31069ce9bb75bcd8c34c32a204299", null ], + [ "Destination", "structjs_subject_transform_config.html#a17ccd4ff50cbfdc3e077ea76fa1f0720", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/structjs_tier-members.html b/deps/nats.c/doc/html/structjs_tier-members.html index dcf0566..00a6b8c 100644 --- a/deps/nats.c/doc/html/structjs_tier-members.html +++ b/deps/nats.c/doc/html/structjs_tier-members.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Member List @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
micro_endpoint_config_s Member List
+
+ +
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__endpoint__config__s.html b/deps/nats.c/doc/html/structmicro__endpoint__config__s.html new file mode 100644 index 0000000..06d6ecd --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__endpoint__config__s.html @@ -0,0 +1,213 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: micro_endpoint_config_s Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
micro_endpoint_config_s Struct Reference
+
+
+ +

#include <nats.h>

+ + + + + + + + + + + + + + + + +

+Public Attributes

const char * Name
 The name of the endpoint.
 
const char * Subject
 The NATS subject the endpoint will listen on.
 
natsMetadata Metadata
 
microRequestHandler Handler
 The request handler for the endpoint.
 
void * State
 A user-provided pointer to store with the endpoint (state/closure).
 
+

Detailed Description

+

The Microservice endpoint configuration object.

+

Member Data Documentation

+ +

◆ Name

+ +
+
+ + + + +
const char* micro_endpoint_config_s::Name
+
+

Used in the service stats to list endpoints by name. Must not be empty.

+ +
+
+ +

◆ Subject

+ +
+
+ + + + +
const char* micro_endpoint_config_s::Subject
+
+

Wildcards are allowed. If Subject is empty, it attempts to default to Name, provided it is a valid subject.

+

For endpoints added to a group, the subject is automatically prefixed with the group's prefix.

+ +
+
+ +

◆ Metadata

+ +
+
+ + + + +
natsMetadata micro_endpoint_config_s::Metadata
+
+

@briefMetadata for the endpoint, a JSON-encoded user-provided object, e.g. {"key":"value"}

+ +
+
+ +

◆ Handler

+ +
+
+ + + + +
microRequestHandler micro_endpoint_config_s::Handler
+
+ +
+
+ +

◆ State

+ +
+
+ + + + +
void* micro_endpoint_config_s::State
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__endpoint__config__s.js b/deps/nats.c/doc/html/structmicro__endpoint__config__s.js new file mode 100644 index 0000000..41daa20 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__endpoint__config__s.js @@ -0,0 +1,8 @@ +var structmicro__endpoint__config__s = +[ + [ "Name", "structmicro__endpoint__config__s.html#a1a47fe3be59a271217bcb4341cddecae", null ], + [ "Subject", "structmicro__endpoint__config__s.html#a6c58e0e9c1da670da4a38993a613eb7d", null ], + [ "Metadata", "structmicro__endpoint__config__s.html#a7aee4ab9e29512c0b6ee12ba233c0fb7", null ], + [ "Handler", "structmicro__endpoint__config__s.html#a4a916af910a5eb88abf3f0aa60082667", null ], + [ "State", "structmicro__endpoint__config__s.html#ae9a1cf8dc159a651869e33c1f5cab3eb", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/structmicro__endpoint__info__s-members.html b/deps/nats.c/doc/html/structmicro__endpoint__info__s-members.html new file mode 100644 index 0000000..b4b0bf7 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__endpoint__info__s-members.html @@ -0,0 +1,115 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
micro_endpoint_info_s Member List
+
+
+ +

This is the complete list of members for micro_endpoint_info_s, including all inherited members.

+ + + + +
Metadatamicro_endpoint_info_s
Namemicro_endpoint_info_s
Subjectmicro_endpoint_info_s
+
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__endpoint__info__s.html b/deps/nats.c/doc/html/structmicro__endpoint__info__s.html new file mode 100644 index 0000000..0f627ce --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__endpoint__info__s.html @@ -0,0 +1,176 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: micro_endpoint_info_s Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
micro_endpoint_info_s Struct Reference
+
+
+ +

#include <nats.h>

+ + + + + + + + + + +

+Public Attributes

const char * Name
 The name of the service.
 
const char * Subject
 The semantic version of the service.
 
natsMetadata Metadata
 
+

Detailed Description

+

microEndpointInfo is the struct for the endpoint's static metadata.

+

Member Data Documentation

+ +

◆ Name

+ +
+
+ + + + +
const char* micro_endpoint_info_s::Name
+
+ +
+
+ +

◆ Subject

+ +
+
+ + + + +
const char* micro_endpoint_info_s::Subject
+
+ +
+
+ +

◆ Metadata

+ +
+
+ + + + +
natsMetadata micro_endpoint_info_s::Metadata
+
+

@briefMetadata for the endpoint, a JSON-encoded user-provided object, e.g. {"key":"value"}

+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__endpoint__info__s.js b/deps/nats.c/doc/html/structmicro__endpoint__info__s.js new file mode 100644 index 0000000..6dc7753 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__endpoint__info__s.js @@ -0,0 +1,6 @@ +var structmicro__endpoint__info__s = +[ + [ "Name", "structmicro__endpoint__info__s.html#ab8b3d1a96e19424fc7f367f2e0dc8175", null ], + [ "Subject", "structmicro__endpoint__info__s.html#a94d9e2e4c19e17f06c827577cd967502", null ], + [ "Metadata", "structmicro__endpoint__info__s.html#aef2820ecb742b9ce9a643d39343df740", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/structmicro__endpoint__stats__s-members.html b/deps/nats.c/doc/html/structmicro__endpoint__stats__s-members.html new file mode 100644 index 0000000..ac471cb --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__endpoint__stats__s-members.html @@ -0,0 +1,120 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
micro_endpoint_stats_s Member List
+
+ +
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__endpoint__stats__s.html b/deps/nats.c/doc/html/structmicro__endpoint__stats__s.html new file mode 100644 index 0000000..a5b7a0c --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__endpoint__stats__s.html @@ -0,0 +1,259 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: micro_endpoint_stats_s Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
micro_endpoint_stats_s Struct Reference
+
+
+ +

#include <nats.h>

+ + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

const char * Name
 
const char * Subject
 
int64_t NumRequests
 The number of requests received by the endpoint.
 
int64_t NumErrors
 The number of errors, service-level and internal, associated with the endpoint.
 
int64_t ProcessingTimeSeconds
 total request processing time (the seconds part).
 
int64_t ProcessingTimeNanoseconds
 total request processing time (the nanoseconds part).
 
int64_t AverageProcessingTimeNanoseconds
 average request processing time, in ns.
 
char LastErrorString [2048]
 a copy of the last error message.
 
+

Detailed Description

+

The Microservice endpoint stats struct.

+

Member Data Documentation

+ +

◆ Name

+ +
+
+ + + + +
const char* micro_endpoint_stats_s::Name
+
+ +
+
+ +

◆ Subject

+ +
+
+ + + + +
const char* micro_endpoint_stats_s::Subject
+
+ +
+
+ +

◆ NumRequests

+ +
+
+ + + + +
int64_t micro_endpoint_stats_s::NumRequests
+
+ +
+
+ +

◆ NumErrors

+ +
+
+ + + + +
int64_t micro_endpoint_stats_s::NumErrors
+
+ +
+
+ +

◆ ProcessingTimeSeconds

+ +
+
+ + + + +
int64_t micro_endpoint_stats_s::ProcessingTimeSeconds
+
+ +
+
+ +

◆ ProcessingTimeNanoseconds

+ +
+
+ + + + +
int64_t micro_endpoint_stats_s::ProcessingTimeNanoseconds
+
+ +
+
+ +

◆ AverageProcessingTimeNanoseconds

+ +
+
+ + + + +
int64_t micro_endpoint_stats_s::AverageProcessingTimeNanoseconds
+
+ +
+
+ +

◆ LastErrorString

+ +
+
+ + + + +
char micro_endpoint_stats_s::LastErrorString[2048]
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__endpoint__stats__s.js b/deps/nats.c/doc/html/structmicro__endpoint__stats__s.js new file mode 100644 index 0000000..faf1d00 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__endpoint__stats__s.js @@ -0,0 +1,11 @@ +var structmicro__endpoint__stats__s = +[ + [ "Name", "structmicro__endpoint__stats__s.html#acfcec95bf83819e8dfe64a4babf62f8e", null ], + [ "Subject", "structmicro__endpoint__stats__s.html#a08745ca3e151b1d7d5c064659975f4d6", null ], + [ "NumRequests", "structmicro__endpoint__stats__s.html#a1adfdb3c1641301b419ccf136cbaa927", null ], + [ "NumErrors", "structmicro__endpoint__stats__s.html#a85ead23cb79aeb6e5c9b4409544412db", null ], + [ "ProcessingTimeSeconds", "structmicro__endpoint__stats__s.html#a3e971e78657d71f28477476a560162dd", null ], + [ "ProcessingTimeNanoseconds", "structmicro__endpoint__stats__s.html#a532060ae39ed420c3f84244163b4590b", null ], + [ "AverageProcessingTimeNanoseconds", "structmicro__endpoint__stats__s.html#acc74c3df96d5f8595521a57dd0eb0cde", null ], + [ "LastErrorString", "structmicro__endpoint__stats__s.html#a2adef3bbd175d542387fe47b9a156e6c", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/structmicro__service__config__s-members.html b/deps/nats.c/doc/html/structmicro__service__config__s-members.html new file mode 100644 index 0000000..21bea10 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__service__config__s-members.html @@ -0,0 +1,121 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
micro_service_config_s Member List
+
+ +
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__service__config__s.html b/deps/nats.c/doc/html/structmicro__service__config__s.html new file mode 100644 index 0000000..0af39c3 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__service__config__s.html @@ -0,0 +1,287 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: micro_service_config_s Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
micro_service_config_s Struct Reference
+
+
+ +

The Microservice top-level configuration object. + More...

+ +

#include <nats.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

const char * Name
 The name of the service.
 
const char * Version
 The (semantic) version of the service.
 
const char * Description
 The description of the service.
 
natsMetadata Metadata
 Metadata for the service, a JSON-encoded user-provided object, e.g. {"key":"value"}
 
microEndpointConfigEndpoint
 The "main" (aka default) endpoint configuration.
 
microRequestHandler StatsHandler
 A custom stats handler.
 
microErrorHandler ErrHandler
 An error notification handler.
 
microDoneHandler DoneHandler
 A callback handler for handling the final cleanup Done event, right before the service is destroyed.
 
void * State
 A user-provided pointer to state data.
 
+

Detailed Description

+

The service is created with a clone of the config and all of its values, so the original can be freed or modified after calling micro_AddService.

+

Member Data Documentation

+ +

◆ Name

+ +
+
+ + + + +
const char* micro_service_config_s::Name
+
+

It can be used to compose monitoring messages specific to this service.

+ +
+
+ +

◆ Version

+ +
+
+ + + + +
const char* micro_service_config_s::Version
+
+ +
+
+ +

◆ Description

+ +
+
+ + + + +
const char* micro_service_config_s::Description
+
+ +
+
+ +

◆ Metadata

+ +
+
+ + + + +
natsMetadata micro_service_config_s::Metadata
+
+ +
+
+ +

◆ Endpoint

+ +
+
+ + + + +
microEndpointConfig* micro_service_config_s::Endpoint
+
+

It is the default in that it does not require calling microService_AddEndpoint, it is added automatically when creating the service.

+ +
+
+ +

◆ StatsHandler

+ +
+
+ + + + +
microRequestHandler micro_service_config_s::StatsHandler
+
+

It will be called to output the service's stats. It replaces the default stats handler but can pull the service stats using microService_GetStats function, then marshal them itself, as appropriate.

+ +
+
+ +

◆ ErrHandler

+ +
+
+ + + + +
microErrorHandler micro_service_config_s::ErrHandler
+
+

It will be called asynchonously upon internal errors. It does not get called for application-level errors, successfully sent out by the microservice.

+ +
+
+ +

◆ DoneHandler

+ +
+
+ + + + +
microDoneHandler micro_service_config_s::DoneHandler
+
+

It will be called directly from microService_Stop method, so it may be executed in any of the user threads or in the async callback thread if the service stops itself on connection closed or an error event.

+ +
+
+ +

◆ State

+ +
+
+ + + + +
void* micro_service_config_s::State
+
+

A closure that is accessible from the request, stats, and internal event handlers. Please note that handlers are invoked on separate threads, consider thread-safe mechanisms of accessing the data.

+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__service__config__s.js b/deps/nats.c/doc/html/structmicro__service__config__s.js new file mode 100644 index 0000000..dcaf2bd --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__service__config__s.js @@ -0,0 +1,12 @@ +var structmicro__service__config__s = +[ + [ "Name", "structmicro__service__config__s.html#acb82e165927f5e5c404beb4f3120a8e2", null ], + [ "Version", "structmicro__service__config__s.html#a20d3780b9452237119aee56853216b03", null ], + [ "Description", "structmicro__service__config__s.html#a090e884af689503d9c2fcb086a5478e6", null ], + [ "Metadata", "structmicro__service__config__s.html#a4a5a97a4181a4870353f9e139cca72fc", null ], + [ "Endpoint", "structmicro__service__config__s.html#ae13d06757417aabf01619090ab83f977", null ], + [ "StatsHandler", "structmicro__service__config__s.html#a8385ccdaef440f9406a876868663ec56", null ], + [ "ErrHandler", "structmicro__service__config__s.html#a4069a6987c910fb4f045b233b6befc27", null ], + [ "DoneHandler", "structmicro__service__config__s.html#ab349d30e0f637d449c0af865234a0985", null ], + [ "State", "structmicro__service__config__s.html#a0a0ae007824f6f53fbb0cb4b940c5ad2", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/structmicro__service__info__s-members.html b/deps/nats.c/doc/html/structmicro__service__info__s-members.html new file mode 100644 index 0000000..6010d62 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__service__info__s-members.html @@ -0,0 +1,120 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
micro_service_info_s Member List
+
+ +
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__service__info__s.html b/deps/nats.c/doc/html/structmicro__service__info__s.html new file mode 100644 index 0000000..d18d1a3 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__service__info__s.html @@ -0,0 +1,261 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: micro_service_info_s Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
micro_service_info_s Struct Reference
+
+
+ +

#include <nats.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

const char * Type
 Response type. Always "io.nats.micro.v1.info_response".
 
const char * Name
 The name of the service.
 
const char * Version
 The semantic version of the service.
 
const char * Description
 The description of the service.
 
const char * Id
 The ID of the service instance responding to the request.
 
natsMetadata Metadata
 Metadata for the service, a JSON-encoded user-provided object, e.g. {"key":"value"}
 
microEndpointInfoEndpoints
 Endpoints.
 
int EndpointsLen
 The number of endpoints in the Endpoints array.
 
+

Detailed Description

+

microServiceInfo is the struct returned by microService_GetInfo function. It is also accessible by sending a $SRV.INFO.<service-name>[.<id>] request to the service.

+

Member Data Documentation

+ +

◆ Type

+ +
+
+ + + + +
const char* micro_service_info_s::Type
+
+ +
+
+ +

◆ Name

+ +
+
+ + + + +
const char* micro_service_info_s::Name
+
+ +
+
+ +

◆ Version

+ +
+
+ + + + +
const char* micro_service_info_s::Version
+
+ +
+
+ +

◆ Description

+ +
+
+ + + + +
const char* micro_service_info_s::Description
+
+ +
+
+ +

◆ Id

+ +
+
+ + + + +
const char* micro_service_info_s::Id
+
+ +
+
+ +

◆ Metadata

+ +
+
+ + + + +
natsMetadata micro_service_info_s::Metadata
+
+ +
+
+ +

◆ Endpoints

+ +
+
+ + + + +
microEndpointInfo* micro_service_info_s::Endpoints
+
+ +
+
+ +

◆ EndpointsLen

+ +
+
+ + + + +
int micro_service_info_s::EndpointsLen
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__service__info__s.js b/deps/nats.c/doc/html/structmicro__service__info__s.js new file mode 100644 index 0000000..12b983f --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__service__info__s.js @@ -0,0 +1,11 @@ +var structmicro__service__info__s = +[ + [ "Type", "structmicro__service__info__s.html#a47188c4f3a9cc6fdd1151dd59db4b1fe", null ], + [ "Name", "structmicro__service__info__s.html#a3ac45f2dd5827f95160b1d7899dcf9b7", null ], + [ "Version", "structmicro__service__info__s.html#a46ad1eddcbed5db1af32add59a910369", null ], + [ "Description", "structmicro__service__info__s.html#ad1b5706234217f33fdac3435ca920b39", null ], + [ "Id", "structmicro__service__info__s.html#a9368a61ebb6cf74a27ea261d7517d9c2", null ], + [ "Metadata", "structmicro__service__info__s.html#a292990d3fd1d94e48fd91e5556a2c091", null ], + [ "Endpoints", "structmicro__service__info__s.html#ac65a0b0e98971c334080b022f71e482d", null ], + [ "EndpointsLen", "structmicro__service__info__s.html#afa11d35ca9aa8c19bc95409727479cd7", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/structmicro__service__stats__s-members.html b/deps/nats.c/doc/html/structmicro__service__stats__s-members.html new file mode 100644 index 0000000..5119683 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__service__stats__s-members.html @@ -0,0 +1,119 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
micro_service_stats_s Member List
+
+ +
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__service__stats__s.html b/deps/nats.c/doc/html/structmicro__service__stats__s.html new file mode 100644 index 0000000..d131307 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__service__stats__s.html @@ -0,0 +1,244 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: micro_service_stats_s Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
micro_service_stats_s Struct Reference
+
+
+ +

#include <nats.h>

+ + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

const char * Type
 Response type. Always "io.nats.micro.v1.stats_response".
 
const char * Name
 The name of the service.
 
const char * Version
 The semantic version of the service.
 
const char * Id
 The ID of the service instance responding to the request.
 
int64_t Started
 The timestamp of when the service was started.
 
microEndpointStatsEndpoints
 The stats for each endpoint of the service.
 
int EndpointsLen
 The number of endpoints in the endpoints array.
 
+

Detailed Description

+

The Microservice stats struct.

+

Member Data Documentation

+ +

◆ Type

+ +
+
+ + + + +
const char* micro_service_stats_s::Type
+
+ +
+
+ +

◆ Name

+ +
+
+ + + + +
const char* micro_service_stats_s::Name
+
+ +
+
+ +

◆ Version

+ +
+
+ + + + +
const char* micro_service_stats_s::Version
+
+ +
+
+ +

◆ Id

+ +
+
+ + + + +
const char* micro_service_stats_s::Id
+
+ +
+
+ +

◆ Started

+ +
+
+ + + + +
int64_t micro_service_stats_s::Started
+
+ +
+
+ +

◆ Endpoints

+ +
+
+ + + + +
microEndpointStats* micro_service_stats_s::Endpoints
+
+ +
+
+ +

◆ EndpointsLen

+ +
+
+ + + + +
int micro_service_stats_s::EndpointsLen
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + + diff --git a/deps/nats.c/doc/html/structmicro__service__stats__s.js b/deps/nats.c/doc/html/structmicro__service__stats__s.js new file mode 100644 index 0000000..daaa566 --- /dev/null +++ b/deps/nats.c/doc/html/structmicro__service__stats__s.js @@ -0,0 +1,10 @@ +var structmicro__service__stats__s = +[ + [ "Type", "structmicro__service__stats__s.html#af37a4da72bb1e1ad292dd1caa6a309a2", null ], + [ "Name", "structmicro__service__stats__s.html#ae81f531e8fb5f4fe6bba9552743985ca", null ], + [ "Version", "structmicro__service__stats__s.html#ace4844493f3a27ce7b1accb2d1bb4da5", null ], + [ "Id", "structmicro__service__stats__s.html#afbc7f9586df0c4d8969736e76284bb20", null ], + [ "Started", "structmicro__service__stats__s.html#a53e7ea532c4bc4f9a9c4322b28060a4e", null ], + [ "Endpoints", "structmicro__service__stats__s.html#aa1ac7f9fd93c943ab8619e625976e567", null ], + [ "EndpointsLen", "structmicro__service__stats__s.html#a88ca92be3498c27f5519c8ddbd2dc9df", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/structnats_metadata-members.html b/deps/nats.c/doc/html/structnats_metadata-members.html new file mode 100644 index 0000000..fd2cd49 --- /dev/null +++ b/deps/nats.c/doc/html/structnats_metadata-members.html @@ -0,0 +1,114 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
natsMetadata Member List
+
+
+ +

This is the complete list of members for natsMetadata, including all inherited members.

+ + + +
CountnatsMetadata
ListnatsMetadata
+
+ + + + + diff --git a/deps/nats.c/doc/html/structnats_metadata.html b/deps/nats.c/doc/html/structnats_metadata.html new file mode 100644 index 0000000..9f33d5f --- /dev/null +++ b/deps/nats.c/doc/html/structnats_metadata.html @@ -0,0 +1,160 @@ + + + + + + + +NATS C Client with JetStream and Streaming support: natsMetadata Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
natsMetadata Struct Reference
+
+
+ +

A type to represent user-provided metadata, a list of k=v pairs. + More...

+ +

#include <nats.h>

+ + + + + + +

+Public Attributes

const char ** List
 
int Count
 
+

Detailed Description

+

Used in JetStream, microservice configuration.

+

Member Data Documentation

+ +

◆ List

+ +
+
+ + + + +
const char** natsMetadata::List
+
+ +
+
+ +

◆ Count

+ +
+
+ + + + +
int natsMetadata::Count
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + + diff --git a/deps/nats.c/doc/html/structnats_metadata.js b/deps/nats.c/doc/html/structnats_metadata.js new file mode 100644 index 0000000..0c8d284 --- /dev/null +++ b/deps/nats.c/doc/html/structnats_metadata.js @@ -0,0 +1,5 @@ +var structnats_metadata = +[ + [ "List", "structnats_metadata.html#af29f95d80bf99ab77601518b143b1dd5", null ], + [ "Count", "structnats_metadata.html#a5412b3c7d4c67cc45f8d27df25851411", null ] +]; \ No newline at end of file diff --git a/deps/nats.c/doc/html/structnats_msg_list-members.html b/deps/nats.c/doc/html/structnats_msg_list-members.html index 536f47e..5b494e1 100644 --- a/deps/nats.c/doc/html/structnats_msg_list-members.html +++ b/deps/nats.c/doc/html/structnats_msg_list-members.html @@ -4,7 +4,7 @@ - + NATS C Client with JetStream and Streaming support: Member List @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + @@ -26,7 +26,7 @@
NATS C Client with JetStream and Streaming support -  3.6.1 +  3.7.0
The nats.io C Client, Supported by Synadia Communications Inc.
@@ -35,7 +35,7 @@ - + + + + + + + + + + + + +
+
+ + + + + + +
+
NATS C Client with JetStream and Streaming support +  3.7.0 +
+
The nats.io C Client, Supported by Synadia Communications Inc.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Topics
+
+ +
+ + + + + diff --git a/deps/nats.c/doc/html/topics.js b/deps/nats.c/doc/html/topics.js new file mode 100644 index 0000000..08af933 --- /dev/null +++ b/deps/nats.c/doc/html/topics.js @@ -0,0 +1,11 @@ +var topics = +[ + [ "Types", "group__types_group.html", "group__types_group" ], + [ "Callbacks", "group__callbacks_group.html", "group__callbacks_group" ], + [ "Functions", "group__func_group.html", "group__func_group" ], + [ "EXPERIMENTAL - Microservices", "group__micro_group.html", "group__micro_group" ], + [ "Wildcards", "group__wildcards_group.html", null ], + [ "Environment Variables", "group__env_variables_group.html", null ], + [ "Libevent Adapter", "group__libevent_functions.html", "group__libevent_functions" ], + [ "Libuv Adapter", "group__libuv_functions.html", "group__libuv_functions" ] +]; \ No newline at end of file diff --git a/deps/nats.c/examples/examples.h b/deps/nats.c/examples/examples.h index 83670b5..e92e65e 100644 --- a/deps/nats.c/examples/examples.h +++ b/deps/nats.c/examples/examples.h @@ -1,4 +1,4 @@ -// Copyright 2015-2018 The NATS Authors +// Copyright 2015-2023 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -15,6 +15,7 @@ #define EXAMPLES_H_ #include +#include #include #include diff --git a/deps/nats.c/examples/micro-arithmetics.c b/deps/nats.c/examples/micro-arithmetics.c new file mode 100644 index 0000000..9e2eb53 --- /dev/null +++ b/deps/nats.c/examples/micro-arithmetics.c @@ -0,0 +1,147 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "examples.h" + +// Sequence NATS microservice example. +// +// This example illustrates multiple NATS microservices communicating with each +// other. Please see the main microservice, micro-sequence.c for a more detailed +// explanation. +// +// This specific microservice implements add, multiply, and divide operations. + +// arithmeticsOp is a type for a C function that implements am operation: add, +// multiply, divide. +typedef void (*arithmeticsOP)(long double *result, long double a1, long double a2); + +// handle_arithmetics_op is a helper function that wraps an implementation of an +// operation into a request handler. +static microError * +handle_arithmetics_op(microRequest *req, arithmeticsOP op) +{ + microError *err = NULL; + microArgs *args = NULL; + long double a1, a2, result; + char buf[1024]; + int len = 0; + + err = micro_ParseArgs(&args, microRequest_GetData(req), microRequest_GetDataLength(req)); + if ((err == NULL) && (microArgs_Count(args) != 2)) + { + err = micro_Errorf("invalid number of arguments, expected 2 got %d", microArgs_Count(args)); + } + if (err == NULL) + err = microArgs_GetFloat(&a1, args, 0); + if (err == NULL) + err = microArgs_GetFloat(&a2, args, 1); + if (err == NULL) + op(&result, a1, a2); + if (err == NULL) + len = snprintf(buf, sizeof(buf), "%Lf", result); + if (err == NULL) + err = microRequest_Respond(req, buf, len); + + microArgs_Destroy(args); + return microError_Wrapf(err, "failed to handle arithmetics operation"); +} + +static void add(long double *result, long double a1, long double a2) +{ + *result = a1 + a2; +} + +static void divide(long double *result, long double a1, long double a2) +{ + *result = a1 / a2; +} + +static void multiply(long double *result, long double a1, long double a2) +{ + *result = a1 * a2; +} + +// request handlers for each operation. +static microError *handle_add(microRequest *req) { return handle_arithmetics_op(req, add); } +static microError *handle_divide(microRequest *req) { return handle_arithmetics_op(req, divide); } +static microError *handle_multiply(microRequest *req) { return handle_arithmetics_op(req, multiply); } + +// main is the main entry point for the microservice. +int main(int argc, char **argv) +{ + natsStatus s = NATS_OK; + microError *err = NULL; + natsConnection *conn = NULL; + natsOptions *opts = NULL; + microService *m = NULL; + microGroup *g = NULL; + char errorbuf[1024]; + + microServiceConfig cfg = { + .Description = "Arithmetic operations - NATS microservice example in C", + .Name = "c-arithmetics", + .Version = "1.0.0", + }; + microEndpointConfig add_cfg = { + .Name = "add", + .Handler = handle_add, + }; + microEndpointConfig divide_cfg = { + .Name = "divide", + .Handler = handle_divide, + }; + microEndpointConfig multiply_cfg = { + .Name = "multiply", + .Handler = handle_multiply, + }; + + // Connect to NATS server + opts = parseArgs(argc, argv, ""); + s = natsConnection_Connect(&conn, opts); + if (s != NATS_OK) + { + printf("Error: %u - %s\n", s, natsStatus_GetText(s)); + nats_PrintLastErrorStack(stderr); + natsOptions_Destroy(opts); + return 1; + } + + // Create the Microservice that listens on nc. + err = micro_AddService(&m, conn, &cfg); + + // Add the endpoints for the functions. + if (err == NULL) + microService_AddGroup(&g, m, "op"); + if (err == NULL) + err = microGroup_AddEndpoint(g, &add_cfg); + if (err == NULL) + err = microGroup_AddEndpoint(g, &multiply_cfg); + if (err == NULL) + err = microGroup_AddEndpoint(g, ÷_cfg); + + // Run the service, until stopped. + if (err == NULL) + err = microService_Run(m); + + // Cleanup. + microService_Destroy(m); + natsOptions_Destroy(opts); + natsConnection_Destroy(conn); + if (err != NULL) + { + printf("Error: %s\n", microError_String(err, errorbuf, sizeof(errorbuf))); + microError_Destroy(err); + return 1; + } + return 0; +} diff --git a/deps/nats.c/examples/micro-func.c b/deps/nats.c/examples/micro-func.c new file mode 100644 index 0000000..0f62cb8 --- /dev/null +++ b/deps/nats.c/examples/micro-func.c @@ -0,0 +1,229 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "examples.h" + +// Sequence NATS microservice example. +// +// This example illustrates multiple NATS microservices communicating with each +// other. Please see the main microservice, micro-sequence.c for a more detailed +// explanation. +// +// This specific microservice implements factorial, fibonacci, and power2 +// functions. Instead of performing arithmetic operations locally, we call the +// arithmetics microservice to perform the operations. + +// functionHandler is a type for a C function that implements a "function", i.e. +// power2, factorial, etc. +typedef microError *(*functionHandler)(long double *result, natsConnection *conn, int n); + +// callArithmetics is a helper function that calls the arithmetics microservice. +static microError * +call_arithmetics(long double *result, natsConnection *nc, const char *subject, long double a1, long double a2) +{ + microError *err = NULL; + microClient *client = NULL; + natsMsg *response = NULL; + microArgs *args = NULL; + char buf[1024]; + int len; + + err = micro_NewClient(&client, nc, NULL); + if (err == NULL) + len = snprintf(buf, sizeof(buf), "%Lf %Lf", a1, a2); + if (err == NULL) + err = microClient_DoRequest(&response, client, subject, buf, len); + if (err == NULL) + err = micro_ParseArgs(&args, natsMsg_GetData(response), natsMsg_GetDataLength(response)); + if (err == NULL) + err = microArgs_GetFloat(result, args, 0); + + microClient_Destroy(client); + natsMsg_Destroy(response); + return err; +} + +// factorial implements the factorial(N) function. Calls the arithmetics service +// for all multiplications. +static microError * +factorial(long double *result, natsConnection *nc, int n) +{ + microError *err = NULL; + int i; + + if (n < 1) + return micro_Errorf("n=%d. must be greater than 0", n); + + *result = 1; + for (i = 1; i <= n; i++) + { + err = call_arithmetics(result, nc, "op.multiply", *result, i); + if (err != NULL) + return err; + } + return NULL; +} + +// fibonacci implements the fibonacci(N) function. Calls the arithmetics service +// for all additions. +static microError * +fibonacci(long double *result, natsConnection *nc, int n) +{ + microError *err = NULL; + int i; + long double n1, n2; + + if (n < 0) + return micro_Errorf("n=%d. must be non-negative", n); + + if (n < 2) + { + *result = n; + return NULL; + } + + for (i = 1, n1 = 0, n2 = 1; i <= n; i++) + { + err = call_arithmetics(result, nc, "op.add", n1, n2); + if (err != NULL) + return err; + n1 = n2; + n2 = *result; + } + return NULL; +} + +// power2 implements the 2**N function. Calls the arithmetics service +// for all multiplications. +static microError *power2(long double *result, natsConnection *nc, int n) +{ + microError *err = NULL; + int i; + + if (n < 1) + return micro_Errorf("n=%d. must be greater than 0", n); + + *result = 1; + for (i = 1; i <= n; i++) + { + err = call_arithmetics(result, nc, "op.multiply", *result, 2); + if (err != NULL) + return err; + } + return NULL; +} + +// handle_function_op is a helper function that wraps an implementation function +// like factorial, fibonacci, etc. into a request handler. +static microError * +handle_function_op(microRequest *req, functionHandler op) +{ + microError *err = NULL; + microArgs *args = NULL; + int n; + long double result; + char buf[1024]; + int len = 0; + + err = micro_ParseArgs(&args, microRequest_GetData(req), microRequest_GetDataLength(req)); + if ((err == NULL) && (microArgs_Count(args) != 1)) + { + err = micro_Errorf("Invalid number of arguments, expected 1 got %d", microArgs_Count(args)); + } + if (err == NULL) + err = microArgs_GetInt(&n, args, 0); + if (err == NULL) + err = op(&result, microRequest_GetConnection(req), n); + if (err == NULL) + len = snprintf(buf, sizeof(buf), "%Lf", result); + if (err == NULL) + err = microRequest_Respond(req, buf, len); + + microArgs_Destroy(args); + return err; +} + +// handle_... are the request handlers for each function. +static microError *handle_factorial(microRequest *req) { return handle_function_op(req, factorial); } +static microError *handle_fibonacci(microRequest *req) { return handle_function_op(req, fibonacci); } +static microError *handle_power2(microRequest *req) { return handle_function_op(req, power2); } + +// main is the main entry point for the microservice. +int main(int argc, char **argv) +{ + natsStatus s = NATS_OK; + microError *err = NULL; + natsOptions *opts = NULL; + natsConnection *conn = NULL; + microService *m = NULL; + microGroup *g = NULL; + char errorbuf[1024]; + + microServiceConfig cfg = { + .Description = "Functions - NATS microservice example in C", + .Name = "c-functions", + .Version = "1.0.0", + }; + microEndpointConfig factorial_cfg = { + .Name = "factorial", + .Handler = handle_factorial, + }; + microEndpointConfig fibonacci_cfg = { + .Name = "fibonacci", + .Handler = handle_fibonacci, + }; + microEndpointConfig power2_cfg = { + .Name = "power2", + .Handler = handle_power2, + }; + + // Connect to NATS server + opts = parseArgs(argc, argv, ""); + s = natsConnection_Connect(&conn, opts); + if (s != NATS_OK) + { + printf("Error: %u - %s\n", s, natsStatus_GetText(s)); + nats_PrintLastErrorStack(stderr); + natsOptions_Destroy(opts); + return 1; + } + + // Create the Microservice that listens on nc. + err = micro_AddService(&m, conn, &cfg); + + // Add the endpoints for the functions. + if (err == NULL) + err = microService_AddGroup(&g, m, "f"); + if (err == NULL) + err = microGroup_AddEndpoint(g, &factorial_cfg); + if (err == NULL) + err = microGroup_AddEndpoint(g, &fibonacci_cfg); + if (err == NULL) + err = microGroup_AddEndpoint(g, &power2_cfg); + + // Run the service, until stopped. + if (err == NULL) + err = microService_Run(m); + + // Cleanup. + microService_Destroy(m); + natsOptions_Destroy(opts); + natsConnection_Destroy(conn); + if (err != NULL) + { + printf("Error: %s\n", microError_String(err, errorbuf, sizeof(errorbuf))); + microError_Destroy(err); + return 1; + } + return 0; +} diff --git a/deps/nats.c/examples/micro-hello.c b/deps/nats.c/examples/micro-hello.c new file mode 100644 index 0000000..6eedbbf --- /dev/null +++ b/deps/nats.c/examples/micro-hello.c @@ -0,0 +1,93 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "examples.h" + +// Hello World! NATS microservice example. +// +// Requires NATS server and CLI, and the nats.c examples fully built. See +// https://github.com/nats-io/nats.c#building +// +// RUN: +// ```sh +// $NATS_SERVER & # NATS_SERVER points to the NATS server binary +// nats_pid=$! +// sleep 2 # wait for server to start +// ./examples/nats-micro-hello & +// hello_pid=$! +// sleep 2 # wait for microservice to start +// nats request 'hello' '' +// kill $hello_pid $nats_pid +// ``` +// +// OUTPUT: +// ``` +// 06:34:57 Sending request on "hello" +// 06:34:57 Received with rtt 1.08ms +// Hello, World! +// ``` + +#define HELLO "Hello, World!" + +static microError * +handle(microRequest *req) +{ + return microRequest_Respond(req, HELLO, sizeof(HELLO)); +} + +int main(int argc, char **argv) +{ + natsStatus s = NATS_OK; + microError *err = NULL; + natsConnection *conn = NULL; + natsOptions *opts = NULL; + microService *m = NULL; + char errorbuf[1024]; + + microEndpointConfig hello_cfg = { + .Name = "hello", + .Handler = handle, + }; + microServiceConfig cfg = { + .Description = "Hello World! - NATS microservice example in C", + .Name = "c-hello", + .Version = "1.0.0", + .Endpoint = &hello_cfg, + }; + + // Connect and start the services + opts = parseArgs(argc, argv, ""); + s = natsConnection_Connect(&conn, opts); + if (s != NATS_OK) + { + printf("Error: %u - %s\n", s, natsStatus_GetText(s)); + nats_PrintLastErrorStack(stderr); + natsOptions_Destroy(opts); + return 1; + } + + err = micro_AddService(&m, conn, &cfg); + if (err == NULL) + err = microService_Run(m); + + microService_Destroy(m); + natsOptions_Destroy(opts); + natsConnection_Destroy(conn); + if (err != NULL) + { + printf("Error: %s\n", microError_String(err, errorbuf, sizeof(errorbuf))); + microError_Destroy(err); + return 1; + } + return 0; +} diff --git a/deps/nats.c/examples/micro-sequence.c b/deps/nats.c/examples/micro-sequence.c new file mode 100644 index 0000000..3655f32 --- /dev/null +++ b/deps/nats.c/examples/micro-sequence.c @@ -0,0 +1,191 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "examples.h" + +// Sequence NATS microservice example. +// +// This example illustrates multiple NATS microservices communicating with each +// other. +// +// The main service (c-sequence) calculates the sum of 1/f(1) + 1/f(2)... up to +// N (included). It exposes one (default) endpoint, "sequence". The inputs are +// f (the function name) and N. name, can be "factorial", "fibonacci", or +// "power2"). +// +// c-sequence parses the request, then calculates the sequence by calling the +// c-functions microservice to calculate f(1), f(2), etc. The c-functions +// service in turn uses c-arithmetics microservice for all arithmetic +// operations. +// +// Requires NATS server and CLI, and the nats.c examples fully built. See +// https://github.com/nats-io/nats.c#building +// +// RUN: +// ```sh +// $NATS_SERVER & # NATS_SERVER points to the NATS server binary +// nats_pid=$! +// sleep 2 # wait for server to start +// ./examples/nats-micro-sequence & +// sequence_pid=$! +// ./examples/nats-micro-func & +// func_pid=$! +// ./examples/nats-micro-arithmetics & +// arithmetics_pid=$! +// sleep 2 # wait for microservice to start +// nats request -r 'sequence' '"factorial" 10' +// nats request -r 'sequence' '"power2" 10' +// nats request -r 'sequence' '"fibonacci" 10' +// kill $sequence_pid $func_pid $arithmetics_pid $nats_pid +// ``` +// +// OUTPUT: +// ``` +// 2.718282 +// 1.999023 +// 3.341705 +// ``` + +static microError * +call_function(long double *result, natsConnection *nc, const char *subject, int n) +{ + microError *err = NULL; + microClient *client = NULL; + natsMsg *response = NULL; + microArgs *args = NULL; + char buf[256]; + char sbuf[256]; + int len; + + len = snprintf(buf, sizeof(buf), "%d", n); + snprintf(sbuf, sizeof(sbuf), "f.%s", subject); + err = micro_NewClient(&client, nc, NULL); + if (err == NULL) + err = microClient_DoRequest(&response, client, sbuf, buf, len); + if (err == NULL) + err = micro_ParseArgs(&args, natsMsg_GetData(response), natsMsg_GetDataLength(response)); + if (err == NULL) + err = microArgs_GetFloat(result, args, 0); + + microClient_Destroy(client); + natsMsg_Destroy(response); + return err; +} + +// calculates the sum of X/f(1) + X/f(2)... up to N (included). The inputs are X +// (float), f name (string), and N (int). E.g.: '10.0 "power2" 10' will +// calculate 10/2 + 10/4 + 10/8 + 10/16 + 10/32 + 10/64 + 10/128 + 10/256 + +// 10/512 + 10/1024 = 20.998046875 +static microError *handle_sequence(microRequest *req) +{ + microError *err = NULL; + natsConnection *nc = microRequest_GetConnection(req); + microArgs *args = NULL; + int n = 0; + int i; + const char *function; + long double initialValue = 1.0; + long double value = 1.0; + long double denominator = 0; + char result[64]; + int result_len = 0; + + err = micro_ParseArgs(&args, microRequest_GetData(req), microRequest_GetDataLength(req)); + if ((err == NULL) && (microArgs_Count(args) != 2)) + { + err = micro_Errorf("Invalid number of arguments, expected 2 got %d", microArgs_Count(args)); + } + + if (err == NULL) + err = microArgs_GetString(&function, args, 0); + if ((err == NULL) && + (strcmp(function, "factorial") != 0) && + (strcmp(function, "power2") != 0) && + (strcmp(function, "fibonacci") != 0)) + { + err = micro_Errorf("Invalid function name '%s', must be 'factorial', 'power2', or 'fibonacci'", function); + } + if (err == NULL) + err = microArgs_GetInt(&n, args, 1); + if ((err == NULL) && (n < 1)) + { + err = micro_Errorf("Invalid number of iterations %d, must be at least 1", n); + } + + for (i = 1; (err == NULL) && (i <= n); i++) + { + if (err == NULL) + err = call_function(&denominator, nc, function, i); + if ((err == NULL) && (denominator == 0)) + { + err = micro_Errorf("division by zero at step %d", i); + } + if (err == NULL) + value = value + initialValue / denominator; + } + + if (err == NULL) + result_len = snprintf(result, sizeof(result), "%Lf", value); + if (err == NULL) + err = microRequest_Respond(req, result, result_len); + + microArgs_Destroy(args); + return err; +} + +int main(int argc, char **argv) +{ + natsStatus s = NATS_OK; + microError *err = NULL; + natsConnection *conn = NULL; + natsOptions *opts = NULL; + microService *m = NULL; + char errorbuf[1024]; + + microEndpointConfig sequence_cfg = { + .Subject = "sequence", + .Name = "sequence-service", + .Handler = handle_sequence, + }; + microServiceConfig cfg = { + .Description = "Sequence adder - NATS microservice example in C", + .Name = "c-sequence", + .Version = "1.0.0", + .Endpoint = &sequence_cfg, + }; + + opts = parseArgs(argc, argv, ""); + s = natsConnection_Connect(&conn, opts); + if (s != NATS_OK) + { + printf("Error: %u - %s\n", s, natsStatus_GetText(s)); + nats_PrintLastErrorStack(stderr); + natsOptions_Destroy(opts); + return 1; + } + + err = micro_AddService(&m, conn, &cfg); + if (err == NULL) + err = microService_Run(m); + + microService_Destroy(m); + natsOptions_Destroy(opts); + natsConnection_Destroy(conn); + if (err != NULL) + { + printf("Error: %s\n", microError_String(err, errorbuf, sizeof(errorbuf))); + microError_Destroy(err); + return 1; + } + return 0; +} diff --git a/deps/nats.c/examples/micro-stats.c b/deps/nats.c/examples/micro-stats.c new file mode 100644 index 0000000..8a5b272 --- /dev/null +++ b/deps/nats.c/examples/micro-stats.c @@ -0,0 +1,152 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include "examples.h" + +typedef struct service_state_s +{ + // in a real application this should be protected by a mutex. In this + // example, the main control flow provides synchronization. + int odd_count; +} service_state_t; + +static microError * +handle_default(microRequest *req) +{ + char buf[64]; + const char *response = "odd"; + int n; + service_state_t *state = microRequest_GetServiceState(req); + + snprintf(buf, sizeof(buf), "%.*s", microRequest_GetDataLength(req), microRequest_GetData(req)); + n = atoi(buf); + if (n % 2 != 0) + { + // this should be protected by a mutex in a real application. + state->odd_count++; + + response = "even"; + } + return microRequest_Respond(req, response, strlen(response)); +} + +static microError * +handle_stats(microRequest *req) +{ + microError *err = NULL; + microServiceStats *stats = NULL; + char buf[2048]; + service_state_t *service_state = microRequest_GetServiceState(req); + int total, custom, len; + + err = microService_GetStats(&stats, microRequest_GetService(req)); + if (err != NULL) + return err; + + total = (int) stats->Endpoints[0].NumRequests; + custom = service_state->odd_count; + len = snprintf(buf, sizeof(buf), + "{\"total\":%d,\"odd\":%d}", total, custom); + return microRequest_Respond(req, buf, len); +} + +static microError * +run_example(natsConnection *conn, microRequestHandler stats_handler, char *buf, int buf_cap) +{ + microError *err = NULL; + microService *m = NULL; + microClient *c = NULL; + service_state_t service_state = { + .odd_count = 0, + }; + microEndpointConfig default_cfg = { + .Name = "default", + .Handler = handle_default, + }; + microServiceConfig cfg = { + .Name = "c-stats", + .Description = "NATS microservice in C with a custom stats handler", + .Version = "1.0.0", + .Endpoint = &default_cfg, + .StatsHandler = stats_handler, + .State = &service_state, + }; + int i; + int len; + natsMsg *resp = NULL; + natsMsg *stats_resp = NULL; + + err = micro_AddService(&m, conn, &cfg); + if (err == NULL) + err = micro_NewClient(&c, conn, NULL); + for (i = 0; (err == NULL) && (i < 10); i++) + { + len = snprintf(buf, buf_cap, "%d", i); + if (err == NULL) + err = microClient_DoRequest(&resp, c, "default", buf, len); + if (err == NULL) + natsMsg_Destroy(resp); + } + + if (err == NULL) + err = microClient_DoRequest(&stats_resp, c, "$SRV.STATS.c-stats", "", 0); + if (err == NULL) + { + len = natsMsg_GetDataLength(stats_resp); + if (len > buf_cap - 1) + { + len = buf_cap - 1; + } + memcpy(buf, natsMsg_GetData(stats_resp), len); + buf[len] = '\0'; + + natsMsg_Destroy(stats_resp); + } + + microService_Destroy(m); + microClient_Destroy(c); + return err; +} + +int main(int argc, char **argv) +{ + microError *err = NULL; + natsOptions *opts = parseArgs(argc, argv, ""); + natsConnection *conn = NULL; + char buf[2048]; + + err = micro_ErrorFromStatus( + natsConnection_Connect(&conn, opts)); + if (err == NULL) + err = run_example(conn, NULL, buf, sizeof(buf)); + if (err == NULL) + printf("Default stats response:\n----\n%s\n----\n\n", buf); + + if (err == NULL) + err = run_example(conn, handle_stats, buf, sizeof(buf)); + if (err == NULL) + printf("Custom stats response:\n----\n%s\n----\n\n", buf); + + if (err != NULL) + { + fprintf(stderr, "Error: %s\n", microError_String(err, buf, sizeof(buf))); + } + + natsOptions_Destroy(opts); + natsConnection_Destroy(conn); + microError_Destroy(err); + return err == NULL ? 0 : 1; +} diff --git a/deps/nats.c/src/asynccb.c b/deps/nats.c/src/asynccb.c index 30b707d..57d20ce 100644 --- a/deps/nats.c/src/asynccb.c +++ b/deps/nats.c/src/asynccb.c @@ -14,6 +14,7 @@ #include "natsp.h" #include "mem.h" #include "conn.h" +#include "sub.h" #if defined(NATS_HAS_STREAMING) #include "stan/conn.h" #endif @@ -46,6 +47,8 @@ _createAndPostCb(natsAsyncCbType type, natsConnection *nc, natsSubscription *sub cb->type = type; cb->nc = nc; cb->sub = sub; + if (sub != NULL) + natsSub_retain(sub); cb->err = err; cb->errTxt = errTxt; #if defined(NATS_HAS_STREAMING) @@ -85,20 +88,23 @@ natsAsyncCb_PostStanConnLostHandler(stanConnection *sc) void natsAsyncCb_Destroy(natsAsyncCbInfo *info) { - natsConnection *nc = NULL; + natsConnection *nc = NULL; + natsSubscription *sub = NULL; #if defined(NATS_HAS_STREAMING) - stanConnection *sc = NULL; + stanConnection *sc = NULL; #endif if (info == NULL) return; - nc = info->nc; + nc = info->nc; + sub = info->sub; #if defined(NATS_HAS_STREAMING) - sc = info->sc; + sc = info->sc; #endif _freeAsyncCbInfo(info); + natsSub_release(sub); natsConn_release(nc); #if defined(NATS_HAS_STREAMING) stanConn_release(sc); diff --git a/deps/nats.c/src/conn.c b/deps/nats.c/src/conn.c index 0dddffc..fbd67f3 100644 --- a/deps/nats.c/src/conn.c +++ b/deps/nats.c/src/conn.c @@ -1,4 +1,4 @@ -// Copyright 2015-2021 The NATS Authors +// Copyright 2015-2023 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -526,10 +526,17 @@ _processInfo(natsConnection *nc, char *info, int len) { natsStatus s = NATS_OK; nats_JSON *json = NULL; + bool postDiscoveredServersCb = false; + bool postLameDuckCb = false; if (info == NULL) return NATS_OK; + natsOptions_lock(nc->opts); + postDiscoveredServersCb = (nc->opts->discoveredServersCb != NULL); + postLameDuckCb = (nc->opts->lameDuckCb != NULL); + natsOptions_unlock(nc->opts); + _clearServerInfo(&(nc->info)); s = nats_JSONParse(&json, info, len); @@ -574,13 +581,13 @@ _processInfo(natsConnection *nc, char *info, int len) nc->info.connectURLsCount, tlsName, &added); - if ((s == NATS_OK) && added && !nc->initc && (nc->opts->discoveredServersCb != NULL)) + if ((s == NATS_OK) && added && !nc->initc && postDiscoveredServersCb) natsAsyncCb_PostConnHandler(nc, ASYNC_DISCOVERED_SERVERS); } // Process the LDM callback after the above. It will cover cases where // we have connect URLs and invoke discovered server callback, and case // where we don't. - if ((s == NATS_OK) && nc->info.lameDuckMode && (nc->opts->lameDuckCb != NULL)) + if ((s == NATS_OK) && nc->info.lameDuckMode && postLameDuckCb) natsAsyncCb_PostConnHandler(nc, ASYNC_LAME_DUCK_MODE); if (s != NATS_OK) @@ -1523,6 +1530,15 @@ _doReconnect(void *arg) int i = 0; natsCustomReconnectDelayHandler crd = NULL; void *crdClosure = NULL; + bool postDisconnectedCb = false; + bool postReconnectedCb = false; + bool postConnectedCb = false; + + natsOptions_lock(nc->opts); + postDisconnectedCb = (nc->opts->disconnectedCb != NULL); + postReconnectedCb = (nc->opts->reconnectedCb != NULL); + postConnectedCb = (nc->opts->connectedCb != NULL); + natsOptions_unlock(nc->opts); natsConn_Lock(nc); @@ -1542,7 +1558,7 @@ _doReconnect(void *arg) // Perform appropriate callback if needed for a disconnect. // (do not do this if we are here on initial connect failure) - if (!nc->initc && (nc->opts->disconnectedCb != NULL)) + if (!nc->initc && postDisconnectedCb) natsAsyncCb_PostConnHandler(nc, ASYNC_DISCONNECTED); crd = nc->opts->customReconnectDelayCB; @@ -1552,7 +1568,6 @@ _doReconnect(void *arg) // TODO: since we sleep only after the whole list has been tried, we can't // rely on individual *natsSrv to know if it is a TLS or non-TLS url. // We have to pick which type of jitter to use, for now, we use these hints: - jitter = nc->opts->reconnectJitter; if (nc->opts->secure || (nc->opts->sslCtx != NULL)) jitter = nc->opts->reconnectJitterTLS; } @@ -1581,8 +1596,6 @@ _doReconnect(void *arg) natsConn_Unlock(nc); sleepTime = crd(nc, wlf, crdClosure); natsConn_Lock(nc); - if (natsConn_isClosed(nc)) - break; } else { @@ -1590,6 +1603,8 @@ _doReconnect(void *arg) if (jitter > 0) sleepTime += rand() % jitter; } + if (natsConn_isClosed(nc)) + break; natsCondition_TimedWait(nc->reconnectCond, nc->mu, sleepTime); } else @@ -1706,7 +1721,7 @@ _doReconnect(void *arg) // This was the initial connect. Set this to false. nc->initc = false; // Invoke the callback. - if (nc->opts->connectedCb != NULL) + if (postConnectedCb) natsAsyncCb_PostConnHandler(nc, ASYNC_CONNECTED); } else @@ -1714,7 +1729,7 @@ _doReconnect(void *arg) // Call reconnectedCB if appropriate. Since we are in a separate // thread, we could invoke the callback directly, however, we // still post it so all callbacks from a connection are serialized. - if (nc->opts->reconnectedCb != NULL) + if (postReconnectedCb) natsAsyncCb_PostConnHandler(nc, ASYNC_RECONNECTED); } @@ -1998,13 +2013,20 @@ _connect(natsConnection *nc) int max = 0; int64_t wtime = 0; bool retry = false; + bool retryOnFailedConnect = false; + bool hasConnectedCb = false; + + natsOptions_lock(nc->opts); + hasConnectedCb = (nc->opts->connectedCb != NULL); + retryOnFailedConnect = nc->opts->retryOnFailedConnect; + natsOptions_unlock(nc->opts); natsConn_Lock(nc); nc->initc = true; pool = nc->srvPool; - if ((nc->opts->retryOnFailedConnect) && (nc->opts->connectedCb == NULL)) + if ((retryOnFailedConnect) && !hasConnectedCb) { retry = true; max = nc->opts->maxReconnect; @@ -2057,6 +2079,7 @@ _connect(natsConnection *nc) retSts = NATS_OK; } } + if (!retry) break; @@ -2070,8 +2093,8 @@ _connect(natsConnection *nc) // If not connected and retry asynchronously on failed connect if ((nc->status != NATS_CONN_STATUS_CONNECTED) - && nc->opts->retryOnFailedConnect - && (nc->opts->connectedCb != NULL)) + && retryOnFailedConnect + && hasConnectedCb) { natsConn_Unlock(nc); @@ -2472,8 +2495,15 @@ _close(natsConnection *nc, natsConnStatus status, bool fromPublicClose, bool doC struct threadsToJoin ttj; bool sockWasActive = false; bool detach = false; + bool postClosedCb = false; + bool postDisconnectedCb = false; natsSubscription *sub = NULL; + natsOptions_lock(nc->opts); + postClosedCb = (nc->opts->closedCb != NULL); + postDisconnectedCb = (nc->opts->disconnectedCb != NULL); + natsOptions_unlock(nc->opts); + natsConn_lockAndRetain(nc); // If invoked from the public Close() call, attempt to flush @@ -2547,7 +2577,7 @@ _close(natsConnection *nc, natsConnStatus status, bool fromPublicClose, bool doC // Perform appropriate callback if needed for a disconnect. // Do not invoke if we were disconnected and failed to reconnect (since // it has already been invoked in doReconnect). - if (doCBs && !nc->rle && (nc->opts->disconnectedCb != NULL) && sockWasActive) + if (doCBs && !nc->rle && postDisconnectedCb && sockWasActive) natsAsyncCb_PostConnHandler(nc, ASYNC_DISCONNECTED); sub = nc->respMux; @@ -2563,7 +2593,7 @@ _close(natsConnection *nc, natsConnStatus status, bool fromPublicClose, bool doC natsConn_Lock(nc); // Perform appropriate callback if needed for a connection closed. - if (doCBs && (nc->opts->closedCb != NULL)) + if (doCBs && postClosedCb) natsAsyncCb_PostConnHandler(nc, ASYNC_CLOSED); nc->status = status; @@ -2792,7 +2822,11 @@ natsConn_processMsg(natsConnection *nc, char *buf, int bufLen) } } - natsSubAndLdw_UnlockAndRelease(sub); + // If we are going to post to the error handler, do not release yet. + if (sc || sm) + natsSubAndLdw_Unlock(sub); + else + natsSubAndLdw_UnlockAndRelease(sub); if ((s == NATS_OK) && fcReply) s = natsConnection_Publish(nc, fcReply, NULL, 0); @@ -2807,6 +2841,10 @@ natsConn_processMsg(natsConnection *nc, char *buf, int bufLen) nc->err = (sc ? NATS_SLOW_CONSUMER : NATS_MISMATCH); natsAsyncCb_PostErrHandler(nc, sub, nc->err, NULL); + // Now release the subscription (it has been retained in + // natsAsyncCb_PostErrHandler function). + natsSub_release(sub); + natsConn_Unlock(nc); } @@ -3811,7 +3849,7 @@ natsConnection_Buffered(natsConnection *nc) int buffered = -1; if (nc == NULL) - return nats_setDefaultError(NATS_INVALID_ARG); + return buffered; natsConn_Lock(nc); diff --git a/deps/nats.c/src/crypto.c b/deps/nats.c/src/crypto.c index ee8aa38..fdebf07 100644 --- a/deps/nats.c/src/crypto.c +++ b/deps/nats.c/src/crypto.c @@ -1,4 +1,4 @@ -// Copyright 2019 The NATS Authors +// Copyright 2023 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -17,7 +17,7 @@ #include natsStatus -natsCrypto_Init() +natsCrypto_Init(void) { return ((sodium_init() == -1) ? NATS_ERR : NATS_OK); } @@ -485,7 +485,7 @@ secure_memzero(void * const pnt, const size_t len) } natsStatus -natsCrypto_Init() +natsCrypto_Init(void) { return NATS_OK; } diff --git a/deps/nats.c/src/include/n-unix.h b/deps/nats.c/src/include/n-unix.h index 3b775cd..ac4919a 100644 --- a/deps/nats.c/src/include/n-unix.h +++ b/deps/nats.c/src/include/n-unix.h @@ -64,4 +64,6 @@ typedef size_t natsRecvLen; #define nats_vsnprintf vsnprintf #define nats_strtok strtok_r +#define nats_vscprintf(f, a) vsnprintf(NULL, 0, (f), (a)) + #endif /* N_UNIX_H_ */ diff --git a/deps/nats.c/src/include/n-win.h b/deps/nats.c/src/include/n-win.h index 328756e..e84d651 100644 --- a/deps/nats.c/src/include/n-win.h +++ b/deps/nats.c/src/include/n-win.h @@ -63,6 +63,8 @@ typedef int natsRecvLen; #define nats_vsnprintf(b, sb, f, a) vsnprintf_s((b), (sb), (_TRUNCATE), (f), (a)) +#define nats_vscprintf _vscprintf + int nats_asprintf(char **newStr, const char *fmt, ...); diff --git a/deps/nats.c/src/js.c b/deps/nats.c/src/js.c index 74def9f..2dc52d5 100644 --- a/deps/nats.c/src/js.c +++ b/deps/nats.c/src/js.c @@ -2201,18 +2201,34 @@ _processConsInfo(const char **dlvSubject, jsConsumerInfo *info, jsConsumerConfig jsConsumerConfig *ccfg = info->Config; const char *dg = NULL; natsStatus s = NATS_OK; + bool matches = false; + int i; *dlvSubject = NULL; // Make sure this new subject matches or is a subset. - if (!nats_IsStringEmpty(subj) - && !nats_IsStringEmpty(ccfg->FilterSubject) - && (strcmp(subj, ccfg->FilterSubject) != 0)) + if (!nats_IsStringEmpty(subj)) { - return nats_setError(NATS_ERR, "subject '%s' does not match consumer filter subject '%s'", - subj, ccfg->FilterSubject); + if (nats_IsStringEmpty(ccfg->FilterSubject) && (ccfg->FilterSubjectsLen == 0)) + { + matches = true; + } + else if (!nats_IsStringEmpty(ccfg->FilterSubject) && nats_HasPrefix(subj, ccfg->FilterSubject)) + { + matches = true; + } + else if (ccfg->FilterSubjectsLen > 0) + { + for (i = 0; (i < ccfg->FilterSubjectsLen) && !matches; i++) + { + matches = nats_HasPrefix(subj, ccfg->FilterSubjects[i]); + } + } + if (!matches) + { + return nats_setError(NATS_ERR, "subject '%s' does not match any consumer filter subjects.", subj); + } } - // Check that if user wants to create a queue sub, // the consumer has no HB nor FC. queue = (nats_IsStringEmpty(queue) ? NULL : queue); diff --git a/deps/nats.c/src/js.h b/deps/nats.c/src/js.h index 79ce521..d98fb68 100644 --- a/deps/nats.c/src/js.h +++ b/deps/nats.c/src/js.h @@ -80,6 +80,9 @@ extern const int64_t jsDefaultRequestWait; #define jsStorageTypeFileStr "file" #define jsStorageTypeMemStr "memory" +#define jsStorageCompressionNoneStr "none" +#define jsStorageCompressionS2Str "s2" + #define jsDeliverAllStr "all" #define jsDeliverLastStr "last" #define jsDeliverNewStr "new" diff --git a/deps/nats.c/src/jsm.c b/deps/nats.c/src/jsm.c index 2a5d5b7..fed1966 100644 --- a/deps/nats.c/src/jsm.c +++ b/deps/nats.c/src/jsm.c @@ -116,8 +116,7 @@ _destroyRePublish(jsRePublish *rp) NATS_FREE(rp); } -void -js_destroyStreamConfig(jsStreamConfig *cfg) +void js_destroyStreamConfig(jsStreamConfig *cfg) { int i; @@ -136,6 +135,9 @@ js_destroyStreamConfig(jsStreamConfig *cfg) _destroyStreamSource(cfg->Sources[i]); NATS_FREE(cfg->Sources); _destroyRePublish(cfg->RePublish); + nats_freeMetadata(&(cfg->Metadata)); + NATS_FREE((char *)cfg->SubjectTransform.Source); + NATS_FREE((char *)cfg->SubjectTransform.Destination); NATS_FREE(cfg); } @@ -168,10 +170,19 @@ _destroyClusterInfo(jsClusterInfo *cluster) static void _destroyStreamSourceInfo(jsStreamSourceInfo *info) { + int i; + if (info == NULL) return; NATS_FREE(info->Name); + NATS_FREE((char*)info->FilterSubject); + for (i=0; i < info->SubjectTransformsLen; i++) + { + NATS_FREE((char *)info->SubjectTransforms[i].Source); + NATS_FREE((char *)info->SubjectTransforms[i].Destination); + } + NATS_FREE(info->SubjectTransforms); _destroyExternalStream(info->External); NATS_FREE(info); } @@ -535,6 +546,113 @@ _marshalStorageType(jsStorageType storage, natsBuffer *buf) return NATS_UPDATE_ERR_STACK(s); } +static natsStatus +_unmarshalStorageCompression(nats_JSON *json, const char *fieldName, jsStorageCompression *compression) +{ + natsStatus s = NATS_OK; + const char *str = NULL; + + s = nats_JSONGetStrPtr(json, "compression", &str); + if (str == NULL) + return NATS_UPDATE_ERR_STACK(s); + + if (strcmp(str, jsStorageCompressionNoneStr) == 0) + *compression = js_StorageCompressionNone; + else if (strcmp(str, jsStorageCompressionS2Str) == 0) + *compression = js_StorageCompressionS2; + else + s = nats_setError(NATS_ERR, "unable to unmarshal storage compression '%s'", str); + + return NATS_UPDATE_ERR_STACK(s); +} + +static natsStatus +_marshalStorageCompression(jsStorageCompression compression, natsBuffer *buf) +{ + natsStatus s; + const char *st = NULL; + + s = natsBuf_Append(buf, ",\"compression\":\"", -1); + switch (compression) + { + case js_StorageCompressionNone: + st = jsStorageCompressionNoneStr; + break; + case js_StorageCompressionS2: + st = jsStorageCompressionS2Str; + break; + default: + return nats_setError(NATS_INVALID_ARG, "invalid storage type %d", (int)compression); + } + IFOK(s, natsBuf_Append(buf, st, -1)); + IFOK(s, natsBuf_AppendByte(buf, '"')); + return NATS_UPDATE_ERR_STACK(s); +} + +static natsStatus +_unmarshalSubjectTransformConfig(nats_JSON *obj, jsSubjectTransformConfig *cfg) +{ + natsStatus s = NATS_OK; + + memset(cfg, 0, sizeof(jsSubjectTransformConfig)); + if (obj == NULL) + { + return NATS_OK; + } + + IFOK(s, nats_JSONGetStr(obj, "src", (char **)&(cfg->Source))); + IFOK(s, nats_JSONGetStr(obj, "dest", (char **)&(cfg->Destination))); + return NATS_UPDATE_ERR_STACK(s); +} + +static natsStatus +_marshalSubjectTransformConfig(jsSubjectTransformConfig *cfg, natsBuffer *buf) +{ + natsStatus s; + if (cfg == NULL || (nats_IsStringEmpty(cfg->Source) && nats_IsStringEmpty(cfg->Destination))) + return NATS_OK; + + s = natsBuf_Append(buf, ",\"subject_transform\":{", -1); + IFOK(s, natsBuf_Append(buf, "\"src\":\"", -1)); + if (cfg->Source != NULL) + IFOK(s, natsBuf_Append(buf, cfg->Source, -1)); + IFOK(s, natsBuf_Append(buf, "\",\"dest\":\"", -1)); + if (cfg->Destination != NULL) + IFOK(s, natsBuf_Append(buf, cfg->Destination, -1)); + IFOK(s, natsBuf_Append(buf, "\"}", -1)); + return NATS_UPDATE_ERR_STACK(s); +} + +static natsStatus +_marshalStreamConsumerLimits(jsStreamConsumerLimits *limits, natsBuffer *buf) +{ + natsStatus s; + if (limits == NULL || (limits->InactiveThreshold == 0 && limits->MaxAckPending == 0)) + return NATS_OK; + + s = natsBuf_Append(buf, ",\"consumer_limits\":{", -1); + IFOK(s, nats_marshalLong(buf, false, "inactive_threshold", limits->InactiveThreshold)); + IFOK(s, nats_marshalLong(buf, true, "max_ack_pending", limits->MaxAckPending)); + IFOK(s, natsBuf_AppendByte(buf, '}')); + return NATS_UPDATE_ERR_STACK(s); +} + +static natsStatus +_unmarshalStreamConsumerLimits(nats_JSON *obj, jsStreamConsumerLimits *limits) +{ + natsStatus s = NATS_OK; + + memset(limits, 0, sizeof(*limits)); + if (obj == NULL) + { + return NATS_OK; + } + + IFOK(s, nats_JSONGetLong(obj, "inactive_threshold", &limits->InactiveThreshold)); + IFOK(s, nats_JSONGetInt(obj, "max_ack_pending", &limits->MaxAckPending)); + return NATS_UPDATE_ERR_STACK(s); +} + static natsStatus _unmarshalRePublish(nats_JSON *json, const char *fieldName, jsRePublish **new_republish) { @@ -570,6 +688,7 @@ js_unmarshalStreamConfig(nats_JSON *json, const char *fieldName, jsStreamConfig jsStreamConfig *cfg = NULL; nats_JSON **sources = NULL; int sourcesLen = 0; + nats_JSON *obj = NULL; natsStatus s; if (fieldName != NULL) @@ -633,6 +752,15 @@ js_unmarshalStreamConfig(nats_JSON *json, const char *fieldName, jsStreamConfig IFOK(s, nats_JSONGetBool(jcfg, "mirror_direct", &(cfg->MirrorDirect))); IFOK(s, nats_JSONGetBool(jcfg, "discard_new_per_subject", &(cfg->DiscardNewPerSubject))); + IFOK(s, nats_unmarshalMetadata(jcfg, "metadata", &(cfg->Metadata))); + IFOK(s, _unmarshalStorageCompression(jcfg, "storage", &(cfg->Compression))); + IFOK(s, nats_JSONGetULong(jcfg, "first_seq", &(cfg->FirstSeq))); + IFOK(s, nats_JSONGetObject(jcfg, "subject_transform", &obj)); + IFOK(s, _unmarshalSubjectTransformConfig(obj, &(cfg->SubjectTransform))); + obj = NULL; + IFOK(s, nats_JSONGetObject(jcfg, "consumer_limits", &obj)); + IFOK(s, _unmarshalStreamConsumerLimits(obj, &(cfg->ConsumerLimits))); + if (s == NATS_OK) *new_cfg = cfg; else @@ -754,6 +882,12 @@ js_marshalStreamConfig(natsBuffer **new_buf, jsStreamConfig *cfg) if ((s == NATS_OK) && cfg->DiscardNewPerSubject) IFOK(s, natsBuf_Append(buf, ",\"discard_new_per_subject\":true", -1)); + IFOK(s, nats_marshalMetadata(buf, true, "metadata", cfg->Metadata)); + IFOK(s, _marshalStorageCompression(cfg->Compression, buf)); + IFOK(s, nats_marshalULong(buf, true, "first_seq", cfg->FirstSeq)); + IFOK(s, _marshalSubjectTransformConfig(&cfg->SubjectTransform, buf)); + IFOK(s, _marshalStreamConsumerLimits(&cfg->ConsumerLimits, buf)); + IFOK(s, natsBuf_AppendByte(buf, '}')); if (s == NATS_OK) @@ -941,6 +1075,8 @@ _unmarshalStreamSourceInfo(nats_JSON *pjson, const char *fieldName, jsStreamSour nats_JSON *json = NULL; jsStreamSourceInfo *ssi = NULL; natsStatus s; + nats_JSON **subjectTransforms = NULL; + int subjectTransformsLen = 0; if (fieldName != NULL) { @@ -961,6 +1097,27 @@ _unmarshalStreamSourceInfo(nats_JSON *pjson, const char *fieldName, jsStreamSour IFOK(s, _unmarshalExternalStream(json, "external", &(ssi->External))); IFOK(s, nats_JSONGetULong(json, "lag", &(ssi->Lag))); IFOK(s, nats_JSONGetLong(json, "active", &(ssi->Active))); + IFOK(s, nats_JSONGetStr(json, "filter_subject", (char **)&(ssi->FilterSubject))); + + // Get the sources and unmarshal if present + IFOK(s, nats_JSONGetArrayObject(json, "subject_transforms", &subjectTransforms, &subjectTransformsLen)); + if ((s == NATS_OK) && (subjectTransforms != NULL)) + { + int i; + + ssi->SubjectTransforms = (jsSubjectTransformConfig *)NATS_CALLOC(subjectTransformsLen, sizeof(jsSubjectTransformConfig)); + if (ssi->SubjectTransforms == NULL) + s = nats_setDefaultError(NATS_NO_MEMORY); + + for (i = 0; (s == NATS_OK) && (i < subjectTransformsLen); i++) + { + s = _unmarshalSubjectTransformConfig(subjectTransforms[i], &(ssi->SubjectTransforms[i])); + if (s == NATS_OK) + ssi->SubjectTransformsLen++; + } + // Free the array of JSON objects that was allocated by nats_JSONGetArrayObject. + NATS_FREE(subjectTransforms); + } if (s == NATS_OK) *new_src = ssi; @@ -1118,6 +1275,7 @@ jsStreamConfig_Init(jsStreamConfig *cfg) cfg->Storage = js_FileStorage; cfg->Discard = js_DiscardOld; cfg->Replicas = 1; + cfg->Compression = js_StorageCompressionNone; return NATS_OK; } @@ -1269,6 +1427,22 @@ _addOrUpdate(jsStreamInfo **new_si, jsStreamAction action, jsCtx *js, jsStreamCo if (msc) _restoreMirrorAndSourcesExternal(cfg); + // Make sure the 2.10 config fields actually worked, in case the server is + // older. + if ((s == NATS_OK) && (new_si != NULL) && (*new_si != NULL) + && (cfg->Compression != (*new_si)->Config->Compression) + && (cfg->FirstSeq != (*new_si)->Config->FirstSeq) + && (cfg->Metadata.Count != (*new_si)->Config->Metadata.Count) + && nats_StringEquals(cfg->SubjectTransform.Source, (*new_si)->Config->SubjectTransform.Source) + && nats_StringEquals(cfg->SubjectTransform.Destination, (*new_si)->Config->SubjectTransform.Destination) + && (cfg->ConsumerLimits.InactiveThreshold != (*new_si)->Config->ConsumerLimits.InactiveThreshold) + && (cfg->ConsumerLimits.MaxAckPending != (*new_si)->Config->ConsumerLimits.MaxAckPending) + ) + { + // <>/<> wrong error + return nats_setError(NATS_INVALID_ARG, "%s", jsErrStreamConfigRequired); + } + natsBuf_Destroy(buf); natsMsg_Destroy(resp); NATS_FREE(subj); @@ -2756,6 +2930,23 @@ _marshalConsumerCreateReq(natsBuffer **new_buf, const char *stream, jsConsumerCo IFOK(s, natsBuf_Append(buf, cfg->FilterSubject, -1)); IFOK(s, natsBuf_AppendByte(buf, '"')); } + if ((s == NATS_OK) && (cfg->FilterSubjectsLen > 0)) + { + int i; + + s = natsBuf_Append(buf, ",\"filter_subjects\":[", -1); + for (i = 0; (s == NATS_OK) && (i < cfg->FilterSubjectsLen); i++) + { + if (i > 0) + s = natsBuf_AppendByte(buf, ','); + IFOK(s, natsBuf_AppendByte(buf, '"')); + IFOK(s, natsBuf_Append(buf, cfg->FilterSubjects[i], -1)); + IFOK(s, natsBuf_AppendByte(buf, '"')); + } + + IFOK(s, natsBuf_AppendByte(buf, ']')); + } + IFOK(s, nats_marshalMetadata(buf, true, "metadata", cfg->Metadata)); IFOK(s, _marshalReplayPolicy(buf, cfg->ReplayPolicy)) if ((s == NATS_OK) && (cfg->RateLimit > 0)) s = nats_marshalULong(buf, true, "rate_limit_bps", cfg->RateLimit); @@ -2815,6 +3006,8 @@ _marshalConsumerCreateReq(natsBuffer **new_buf, const char *stream, jsConsumerCo void js_destroyConsumerConfig(jsConsumerConfig *cc) { + int i; + if (cc == NULL) return; @@ -2824,7 +3017,11 @@ js_destroyConsumerConfig(jsConsumerConfig *cc) NATS_FREE((char*) cc->DeliverSubject); NATS_FREE((char*) cc->DeliverGroup); NATS_FREE((char*) cc->FilterSubject); - NATS_FREE((char*) cc->SampleFrequency); + for (i = 0; i < cc->FilterSubjectsLen; i++) + NATS_FREE((char *)cc->FilterSubjects[i]); + nats_freeMetadata(&(cc->Metadata)); + NATS_FREE((char *)cc->FilterSubjects); + NATS_FREE((char *)cc->SampleFrequency); NATS_FREE(cc->BackOff); NATS_FREE(cc); } @@ -2931,6 +3128,7 @@ _unmarshalConsumerConfig(nats_JSON *json, const char *fieldName, jsConsumerConfi IFOK(s, nats_JSONGetLong(cjson, "ack_wait", &(cc->AckWait))); IFOK(s, nats_JSONGetLong(cjson, "max_deliver", &(cc->MaxDeliver))); IFOK(s, nats_JSONGetStr(cjson, "filter_subject", (char**) &(cc->FilterSubject))); + IFOK(s, nats_JSONGetArrayStr(cjson, "filter_subjects", (char ***)&(cc->FilterSubjects), &(cc->FilterSubjectsLen))); IFOK(s, _unmarshalReplayPolicy(cjson, "replay_policy", &(cc->ReplayPolicy))); IFOK(s, nats_JSONGetULong(cjson, "rate_limit_bps", &(cc->RateLimit))); IFOK(s, nats_JSONGetStr(cjson, "sample_freq", (char**) &(cc->SampleFrequency))); @@ -2946,6 +3144,7 @@ _unmarshalConsumerConfig(nats_JSON *json, const char *fieldName, jsConsumerConfi IFOK(s, nats_JSONGetArrayLong(cjson, "backoff", &(cc->BackOff), &(cc->BackOffLen))); IFOK(s, nats_JSONGetLong(cjson, "num_replicas", &(cc->Replicas))); IFOK(s, nats_JSONGetBool(cjson, "mem_storage", &(cc->MemoryStorage))); + IFOK(s, nats_unmarshalMetadata(cjson, "metadata", &(cc->Metadata))); } if (s == NATS_OK) @@ -3083,14 +3282,14 @@ js_AddConsumer(jsConsumerInfo **new_ci, jsCtx *js, { // No subject filter, use . // otherwise, the filter subject goes at the end. - if (nats_IsStringEmpty(cfg->FilterSubject)) - res = nats_asprintf(&subj, jsApiConsumerCreateExT, - js_lenWithoutTrailingDot(o.Prefix), o.Prefix, - stream, cfg->Name); - else + if (!nats_IsStringEmpty(cfg->FilterSubject) && (cfg->FilterSubjectsLen == 0)) res = nats_asprintf(&subj, jsApiConsumerCreateExWithFilterT, js_lenWithoutTrailingDot(o.Prefix), o.Prefix, stream, cfg->Name, cfg->FilterSubject); + else + res = nats_asprintf(&subj, jsApiConsumerCreateExT, + js_lenWithoutTrailingDot(o.Prefix), o.Prefix, + stream, cfg->Name); } else if (nats_IsStringEmpty(cfg->Durable)) res = nats_asprintf(&subj, jsApiConsumerCreateT, @@ -3114,6 +3313,14 @@ js_AddConsumer(jsConsumerInfo **new_ci, jsCtx *js, // If we got a response, check for error or return the consumer info result. IFOK(s, _unmarshalConsumerCreateOrGetResp(new_ci, resp, errCode)); + if ((s == NATS_OK) + && (new_ci != NULL) + && (cfg->FilterSubjectsLen > 0) + && ((*new_ci)->Config->FilterSubjectsLen == 0)) + { + s = nats_setError(NATS_INVALID_ARG, "%s", "multiple consumer filter subjects not supported by the server"); + } + NATS_FREE(subj); natsMsg_Destroy(resp); natsBuf_Destroy(buf); @@ -3633,6 +3840,8 @@ js_cloneConsumerConfig(jsConsumerConfig *org, jsConsumerConfig **clone) c->Description = NULL; c->BackOff = NULL; c->FilterSubject = NULL; + c->FilterSubjects = NULL; + c->FilterSubjectsLen = 0; c->SampleFrequency = NULL; c->DeliverSubject = NULL; c->DeliverGroup = NULL; @@ -3652,6 +3861,19 @@ js_cloneConsumerConfig(jsConsumerConfig *org, jsConsumerConfig **clone) else memcpy(c->BackOff, org->BackOff, org->BackOffLen*sizeof(int64_t)); } + if ((s == NATS_OK) && (org->FilterSubjects != NULL) && (org->FilterSubjectsLen > 0)) + { + c->FilterSubjects = (const char **)NATS_CALLOC(org->FilterSubjectsLen, sizeof(const char *)); + if (c->FilterSubjects == NULL) + s = nats_setDefaultError(NATS_NO_MEMORY); + + for (int i = 0; (s == NATS_OK) && (i < org->FilterSubjectsLen); i++) + { + IF_OK_DUP_STRING(s, c->FilterSubjects[i], org->FilterSubjects[i]); + } + c->FilterSubjectsLen = org->FilterSubjectsLen; + } + IFOK(s, nats_cloneMetadata(&(c->Metadata), org->Metadata)); if (s == NATS_OK) *clone = c; else diff --git a/deps/nats.c/src/micro.c b/deps/nats.c/src/micro.c new file mode 100644 index 0000000..a250dfe --- /dev/null +++ b/deps/nats.c/src/micro.c @@ -0,0 +1,912 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "microp.h" +#include "conn.h" +#include "opts.h" +#include "util.h" + +static inline void _lock_service(microService *m) { natsMutex_Lock(m->service_mu); } +static inline void _unlock_service(microService *m) { natsMutex_Unlock(m->service_mu); } + +static microError *_clone_service_config(microServiceConfig **out, microServiceConfig *cfg); +static microError *_new_service(microService **ptr, natsConnection *nc); +static microError *_wrap_connection_event_callbacks(microService *m); + +static void _free_cloned_service_config(microServiceConfig *cfg); +static void _free_service(microService *m); +static void _release_service(microService *m); +static void _retain_service(microService *m); + +microError * +micro_AddService(microService **new_m, natsConnection *nc, microServiceConfig *cfg) +{ + natsStatus s = NATS_OK; + microError *err = NULL; + microService *m = NULL; + + if ((new_m == NULL) || (nc == NULL) || (cfg == NULL) || !micro_is_valid_name(cfg->Name) || nats_IsStringEmpty(cfg->Version)) + return micro_ErrorInvalidArg; + + // Make a microservice object, with a reference to a natsConnection. + err = _new_service(&m, nc); + if (err != NULL) + return err; + + IFOK(s, natsMutex_Create(&m->service_mu)); + IFOK(s, natsNUID_Next(m->id, sizeof(m->id))); + err = micro_ErrorFromStatus(s); + + MICRO_CALL(err, _clone_service_config(&m->cfg, cfg)); + + // Wrap the connection callbacks before we subscribe to anything. + MICRO_CALL(err, _wrap_connection_event_callbacks(m)); + + MICRO_CALL(err, micro_init_monitoring(m)); + MICRO_CALL(err, microService_AddEndpoint(m, cfg->Endpoint)); + + if (err != NULL) + { + microError_Ignore(microService_Destroy(m)); + return microError_Wrapf(err, "failed to add microservice %s", cfg->Name); + } + + *new_m = m; + return NULL; +} + +microError * +micro_add_endpoint(microEndpoint **new_ep, microService *m, const char *prefix, microEndpointConfig *cfg, bool is_internal) +{ + microError *err = NULL; + microEndpoint *ptr = NULL; + microEndpoint *prev_ptr = NULL; + microEndpoint *ep = NULL; + microEndpoint *prev_ep = NULL; + + if (m == NULL) + return micro_ErrorInvalidArg; + if (cfg == NULL) + return NULL; + + err = micro_new_endpoint(&ep, m, prefix, cfg, is_internal); + if (err != NULL) + return microError_Wrapf(err, "failed to create endpoint %s", cfg->Name); + + _lock_service(m); + + if (m->stopped) + { + _unlock_service(m); + return micro_Errorf("can't add an endpoint %s to service %s: the service is stopped", cfg->Name, m->cfg->Name); + } + + if (m->first_ep != NULL) + { + if (strcmp(m->first_ep->name, ep->name) == 0) + { + ep->next = m->first_ep->next; + prev_ep = m->first_ep; + m->first_ep = ep; + } + else + { + prev_ptr = m->first_ep; + for (ptr = m->first_ep->next; ptr != NULL; prev_ptr = ptr, ptr = ptr->next) + { + if (strcmp(ptr->name, ep->name) == 0) + { + ep->next = ptr->next; + prev_ptr->next = ep; + prev_ep = ptr; + break; + } + } + if (prev_ep == NULL) + { + prev_ptr->next = ep; + } + } + } + else + { + m->first_ep = ep; + } + + _unlock_service(m); + + if (prev_ep != NULL) + { + // Rid of the previous endpoint with the same name, if any. If this + // fails we can return the error, leave the newly added endpoint in the + // list, not started. A retry with the same name will clean it up. + if (err = micro_stop_endpoint(prev_ep), err != NULL) + return err; + micro_release_endpoint(prev_ep); + } + + // retain `m` before the endpoint uses it for its on_complete callback. + _retain_service(m); + + if (err = micro_start_endpoint(ep), err != NULL) + { + // Best effort, leave the new endpoint in the list, as is. A retry with + // the same name will clean it up. + _release_service(m); + return microError_Wrapf(err, "failed to start endpoint %s", ep->name); + } + + if (new_ep != NULL) + *new_ep = ep; + return NULL; +} + +microError * +microService_AddEndpoint(microService *m, microEndpointConfig *cfg) +{ + return micro_add_endpoint(NULL, m, NULL, cfg, false); +} + +microError * +microGroup_AddEndpoint(microGroup *g, microEndpointConfig *cfg) +{ + if (g == NULL) + return micro_ErrorInvalidArg; + + return micro_add_endpoint(NULL, g->m, g->prefix, cfg, false); +} + +microError * +microService_Stop(microService *m) +{ + microError *err = NULL; + microEndpoint *ep = NULL; + bool finalize = false; + microDoneHandler doneHandler = NULL; + + if (m == NULL) + return micro_ErrorInvalidArg; + + _lock_service(m); + + if (m->stopped) + { + _unlock_service(m); + return NULL; + } + ep = m->first_ep; + + for (; ep != NULL; ep = ep->next) + { + if (err = micro_stop_endpoint(ep), err != NULL) + { + _unlock_service(m); + return microError_Wrapf(err, "failed to stop service '%s', stopping endpoint '%s'", m->cfg->Name, ep->name); + } + } + + finalize = (m->first_ep == NULL); + if (finalize) + { + natsLib_stopServiceCallbacks(m); + m->stopped = true; + doneHandler = m->cfg->DoneHandler; + } + + _unlock_service(m); + + if (finalize) + { + if (doneHandler != NULL) + doneHandler(m); + + // Relase the endpoint's server reference from `micro_add_endpoint`. + _release_service(m); + } + + return NULL; +} + +static bool +_find_endpoint(microEndpoint **prevp, microService *m, microEndpoint *to_find) +{ + microEndpoint *ep = NULL; + microEndpoint *prev_ep = NULL; + + if ((m == NULL) || (to_find == NULL)) + return false; + + for (ep = m->first_ep; ep != NULL; ep = ep->next) + { + if (ep == to_find) + { + *prevp = prev_ep; + return true; + } + prev_ep = ep; + } + + return false; +} + +void micro_release_on_endpoint_complete(void *closure) +{ + microEndpoint *ep = (microEndpoint *)closure; + microEndpoint *prev_ep = NULL; + microService *m = NULL; + natsSubscription *sub = NULL; + microDoneHandler doneHandler = NULL; + bool free_ep = false; + bool finalize = false; + + if (ep == NULL) + return; + + m = ep->m; + if ((m == NULL) || (m->service_mu == NULL)) + return; + + micro_lock_endpoint(ep); + ep->is_draining = false; + sub = ep->sub; + ep->sub = NULL; + ep->refs--; + free_ep = (ep->refs == 0); + micro_unlock_endpoint(ep); + + // Force the subscription to be destroyed now. + natsSubscription_Destroy(sub); + + _lock_service(m); + + // Release the service reference for the completed endpoint. It can not be + // the last reference, so no need to free m. + m->refs--; + + // Unlink the endpoint from the service. + if (_find_endpoint(&prev_ep, m, ep)) + { + if (prev_ep != NULL) + { + prev_ep->next = ep->next; + } + else + { + m->first_ep = ep->next; + } + } + + finalize = (!m->stopped) && (m->first_ep == NULL); + if (finalize) + { + natsLib_stopServiceCallbacks(m); + m->stopped = true; + doneHandler = m->cfg->DoneHandler; + } + + _unlock_service(m); + + if (free_ep) + micro_free_endpoint(ep); + + if (finalize) + { + if (doneHandler != NULL) + doneHandler(m); + + // Relase the endpoint's server reference from `micro_add_endpoint`. + _release_service(m); + } +} + +bool microService_IsStopped(microService *m) +{ + bool stopped; + + if ((m == NULL) || (m->service_mu == NULL)) + return true; + + _lock_service(m); + stopped = m->stopped; + _unlock_service(m); + + return stopped; +} + +microError * +microService_Destroy(microService *m) +{ + microError *err = NULL; + + err = microService_Stop(m); + if (err != NULL) + return err; + + _release_service(m); + return NULL; +} + +microError * +microService_Run(microService *m) +{ + if ((m == NULL) || (m->service_mu == NULL)) + return micro_ErrorInvalidArg; + + while (!microService_IsStopped(m)) + { + nats_Sleep(50); + } + + return NULL; +} + +void * +microService_GetState(microService *m) +{ + if (m == NULL) + return NULL; + + return m->cfg->State; +} + +static microError * +_new_service(microService **ptr, natsConnection *nc) +{ + *ptr = NATS_CALLOC(1, sizeof(microService)); + if (*ptr == NULL) + return micro_ErrorOutOfMemory; + + natsConn_retain(nc); + (*ptr)->refs = 1; + (*ptr)->nc = nc; + (*ptr)->started = nats_Now() * 1000000; + return NULL; +} + +static void +_retain_service(microService *m) +{ + if (m == NULL) + return; + + _lock_service(m); + + ++(m->refs); + + _unlock_service(m); +} + +static void +_release_service(microService *m) +{ + int refs = 0; + + if (m == NULL) + return; + + _lock_service(m); + + refs = --(m->refs); + + _unlock_service(m); + + if (refs == 0) + _free_service(m); +} + +static void +_free_service(microService *m) +{ + microGroup *next = NULL; + + if (m == NULL) + return; + + // destroy all groups. + if (m->groups != NULL) + { + microGroup *g = m->groups; + while (g != NULL) + { + next = g->next; + NATS_FREE(g); + g = next; + } + } + + _free_cloned_service_config(m->cfg); + natsConn_release(m->nc); + natsMutex_Destroy(m->service_mu); + NATS_FREE(m); +} + +static inline microError * +_new_service_config(microServiceConfig **ptr) +{ + *ptr = NATS_CALLOC(1, sizeof(microServiceConfig)); + return (*ptr == NULL) ? micro_ErrorOutOfMemory : NULL; +} + +static microError * +_clone_service_config(microServiceConfig **out, microServiceConfig *cfg) +{ + microError *err = NULL; + microServiceConfig *new_cfg = NULL; + + if (out == NULL || cfg == NULL) + return micro_ErrorInvalidArg; + + err = _new_service_config(&new_cfg); + if (err == NULL) + { + memcpy(new_cfg, cfg, sizeof(microServiceConfig)); + } + // the strings are declared const for the public, but in a clone these need + // to be duplicated. + MICRO_CALL(err, micro_strdup((char **)&new_cfg->Name, cfg->Name)); + MICRO_CALL(err, micro_strdup((char **)&new_cfg->Version, cfg->Version)); + MICRO_CALL(err, micro_strdup((char **)&new_cfg->Description, cfg->Description)); + MICRO_CALL(err, micro_ErrorFromStatus( + nats_cloneMetadata(&new_cfg->Metadata, cfg->Metadata))); + MICRO_CALL(err, micro_clone_endpoint_config(&new_cfg->Endpoint, cfg->Endpoint)); + if (err != NULL) + { + _free_cloned_service_config(new_cfg); + return err; + } + + *out = new_cfg; + return NULL; +} + +static void +_free_cloned_service_config(microServiceConfig *cfg) +{ + if (cfg == NULL) + return; + + // the strings are declared const for the public, but in a clone these need + // to be freed. + NATS_FREE((char *)cfg->Name); + NATS_FREE((char *)cfg->Version); + NATS_FREE((char *)cfg->Description); + nats_freeMetadata(&cfg->Metadata); + micro_free_cloned_endpoint_config(cfg->Endpoint); + NATS_FREE(cfg); +} + +static microError * +_start_service_callbacks(microService *m) +{ + natsStatus s = NATS_OK; + + if (m == NULL) + return micro_ErrorInvalidArg; + + // Extra reference to the service as long as its callbacks are registered. + _retain_service(m); + + s = natsLib_startServiceCallbacks(m); + if (s != NATS_OK) + { + _release_service(m); + } + + return micro_ErrorFromStatus(s); +} + +static microError * +_services_for_connection(microService ***to_call, int *num_microservices, natsConnection *nc) +{ + natsMutex *mu = natsLib_getServiceCallbackMutex(); + natsHash *h = natsLib_getAllServicesToCallback(); + microService *m = NULL; + microService **p = NULL; + natsHashIter iter; + int n = 0; + int i; + + natsMutex_Lock(mu); + + natsHashIter_Init(&iter, h); + while (natsHashIter_Next(&iter, NULL, (void **)&m)) + if (m->nc == nc) + n++; + natsHashIter_Done(&iter); + if (n > 0) + { + p = NATS_CALLOC(n, sizeof(microService *)); + if (p == NULL) + { + natsMutex_Unlock(mu); + return micro_ErrorOutOfMemory; + } + + natsHashIter_Init(&iter, h); + i = 0; + while (natsHashIter_Next(&iter, NULL, (void **)&m)) + { + if (m->nc == nc) + { + _retain_service(m); // for the callback + p[i++] = m; + } + } + natsHashIter_Done(&iter); + } + + natsMutex_Unlock(mu); + + *to_call = p; + *num_microservices = n; + return NULL; +} + +static void +_on_connection_closed(natsConnection *nc, void *ignored) +{ + microService *m = NULL; + microService **to_call = NULL; + microError *err = NULL; + int n = 0; + int i; + + err = _services_for_connection(&to_call, &n, nc); + if (err != NULL) + { + microError_Ignore(err); + return; + } + + for (i = 0; i < n; i++) + { + m = to_call[i]; + microError_Ignore(microService_Stop(m)); + + _release_service(m); + } + + NATS_FREE(to_call); +} + +static void +_on_service_error(microService *m, const char *subject, natsStatus s) +{ + microEndpoint *ep = NULL; + microError *err = NULL; + + if (m == NULL) + return; + + _lock_service(m); + for (ep = m->first_ep; + (ep != NULL) && !micro_match_endpoint_subject(ep->subject, subject); + ep = ep->next) + ; + micro_retain_endpoint(ep); // for the callback + _unlock_service(m); + + if (ep != NULL) + { + if (m->cfg->ErrHandler != NULL) + (*m->cfg->ErrHandler)(m, ep, s); + + err = microError_Wrapf(micro_ErrorFromStatus(s), "NATS error on endpoint %s", ep->subject); + micro_update_last_error(ep, err); + microError_Destroy(err); + } + micro_release_endpoint(ep); // after the callback + + // TODO: Should we stop the service? The Go client does. + microError_Ignore(microService_Stop(m)); +} + +static void +_on_error(natsConnection *nc, natsSubscription *sub, natsStatus s, void *not_used) +{ + microService *m = NULL; + microService **to_call = NULL; + microError *err = NULL; + const char *subject = NULL; + int n = 0; + int i; + + if (sub == NULL) + { + return; + } + subject = natsSubscription_GetSubject(sub); + + // `to_call` will have a list of retained service pointers. + err = _services_for_connection(&to_call, &n, nc); + if (err != NULL) + { + microError_Ignore(err); + return; + } + + for (i = 0; i < n; i++) + { + m = to_call[i]; + _on_service_error(m, subject, s); + _release_service(m); // release the extra ref in `to_call`. + } + + NATS_FREE(to_call); +} + +static microError * +_wrap_connection_event_callbacks(microService *m) +{ + microError *err = NULL; + + if ((m == NULL) || (m->nc == NULL) || (m->nc->opts == NULL)) + return micro_ErrorInvalidArg; + + // The new service must be in the list for this to work. + MICRO_CALL(err, _start_service_callbacks(m)); + MICRO_CALL(err, micro_ErrorFromStatus( + natsOptions_setMicroCallbacks(m->nc->opts, _on_connection_closed, _on_error))); + + return microError_Wrapf(err, "failed to wrap connection event callbacks"); +} + +microError * +microService_AddGroup(microGroup **new_group, microService *m, const char *prefix) +{ + if ((m == NULL) || (new_group == NULL) || (prefix == NULL)) + return micro_ErrorInvalidArg; + + *new_group = NATS_CALLOC(1, sizeof(microGroup) + + strlen(prefix) + 1); // "prefix\0" + if (new_group == NULL) + { + return micro_ErrorOutOfMemory; + } + + memcpy((*new_group)->prefix, prefix, strlen(prefix) + 1); + (*new_group)->m = m; + (*new_group)->next = m->groups; + m->groups = *new_group; + + return NULL; +} + +microError * +microGroup_AddGroup(microGroup **new_group, microGroup *parent, const char *prefix) +{ + char *p; + size_t len; + + if ((parent == NULL) || (new_group == NULL) || (prefix == NULL)) + return micro_ErrorInvalidArg; + + *new_group = NATS_CALLOC(1, sizeof(microGroup) + + strlen(parent->prefix) + 1 + // "parent_prefix." + strlen(prefix) + 1); // "prefix\0" + if (new_group == NULL) + { + return micro_ErrorOutOfMemory; + } + + p = (*new_group)->prefix; + len = strlen(parent->prefix); + memcpy(p, parent->prefix, len); + p[len] = '.'; + p += len + 1; + memcpy(p, prefix, strlen(prefix) + 1); + (*new_group)->m = parent->m; + (*new_group)->next = parent->m->groups; + parent->m->groups = *new_group; + + return NULL; +} + +natsConnection * +microService_GetConnection(microService *m) +{ + if (m == NULL) + return NULL; + return m->nc; +} + +microError * +microService_GetInfo(microServiceInfo **new_info, microService *m) +{ + microError *err = NULL; + microServiceInfo *info = NULL; + microEndpoint *ep = NULL; + int len; + + if ((new_info == NULL) || (m == NULL) || (m->service_mu == NULL)) + return micro_ErrorInvalidArg; + + info = NATS_CALLOC(1, sizeof(microServiceInfo)); + if (info == NULL) + return micro_ErrorOutOfMemory; + + MICRO_CALL(err, micro_strdup((char **)&info->Name, m->cfg->Name)); + MICRO_CALL(err, micro_strdup((char **)&info->Version, m->cfg->Version)); + MICRO_CALL(err, micro_strdup((char **)&info->Description, m->cfg->Description)); + MICRO_CALL(err, micro_strdup((char **)&info->Id, m->id)); + MICRO_CALL(err, micro_ErrorFromStatus( + nats_cloneMetadata(&info->Metadata, m->cfg->Metadata))); + + if (err == NULL) + { + info->Type = MICRO_INFO_RESPONSE_TYPE; + + _lock_service(m); + + len = 0; + for (ep = m->first_ep; ep != NULL; ep = ep->next) + { + if ((!ep->is_monitoring_endpoint) && (ep->subject != NULL)) + len++; + } + + // Overallocate subjects, will filter out internal ones. + info->Endpoints = NATS_CALLOC(len, sizeof(microEndpointInfo)); + if (info->Endpoints == NULL) + { + err = micro_ErrorOutOfMemory; + } + + len = 0; + for (ep = m->first_ep; (err == NULL) && (ep != NULL); ep = ep->next) + { + if ((!ep->is_monitoring_endpoint) && (ep->subject != NULL)) + { + MICRO_CALL(err, micro_strdup((char **)&info->Endpoints[len].Name, ep->name)); + MICRO_CALL(err, micro_strdup((char **)&info->Endpoints[len].Subject, ep->subject)); + MICRO_CALL(err, micro_ErrorFromStatus( + nats_cloneMetadata(&info->Endpoints[len].Metadata, ep->config->Metadata))); + if (err == NULL) + { + len++; + info->EndpointsLen = len; + } + } + } + _unlock_service(m); + } + + if (err != NULL) + { + microServiceInfo_Destroy(info); + return err; + } + + *new_info = info; + return NULL; +} + +void microServiceInfo_Destroy(microServiceInfo *info) +{ + int i; + + if (info == NULL) + return; + + // casts to quiet the compiler. + for (i = 0; i < info->EndpointsLen; i++) + { + NATS_FREE((char *)info->Endpoints[i].Name); + NATS_FREE((char *)info->Endpoints[i].Subject); + nats_freeMetadata(&info->Endpoints[i].Metadata); + } + NATS_FREE((char *)info->Endpoints); + NATS_FREE((char *)info->Name); + NATS_FREE((char *)info->Version); + NATS_FREE((char *)info->Description); + NATS_FREE((char *)info->Id); + nats_freeMetadata(&info->Metadata); + NATS_FREE(info); +} + +microError * +microService_GetStats(microServiceStats **new_stats, microService *m) +{ + microError *err = NULL; + microServiceStats *stats = NULL; + microEndpoint *ep = NULL; + int len; + long double avg = 0.0; + + if ((new_stats == NULL) || (m == NULL) || (m->service_mu == NULL)) + return micro_ErrorInvalidArg; + + stats = NATS_CALLOC(1, sizeof(microServiceStats)); + if (stats == NULL) + return micro_ErrorOutOfMemory; + + MICRO_CALL(err, micro_strdup((char **)&stats->Name, m->cfg->Name)); + MICRO_CALL(err, micro_strdup((char **)&stats->Version, m->cfg->Version)); + MICRO_CALL(err, micro_strdup((char **)&stats->Id, m->id)); + + if (err == NULL) + { + stats->Started = m->started; + stats->Type = MICRO_STATS_RESPONSE_TYPE; + + _lock_service(m); + + len = 0; + for (ep = m->first_ep; ep != NULL; ep = ep->next) + { + if ((ep != NULL) && (!ep->is_monitoring_endpoint)) + len++; + } + + // Allocate the actual structs, not pointers. + stats->Endpoints = NATS_CALLOC(len, sizeof(microEndpointStats)); + if (stats->Endpoints == NULL) + { + err = micro_ErrorOutOfMemory; + } + + len = 0; + for (ep = m->first_ep; ((err == NULL) && (ep != NULL)); ep = ep->next) + { + if ((ep != NULL) && (!ep->is_monitoring_endpoint) && (ep->endpoint_mu != NULL)) + { + micro_lock_endpoint(ep); + // copy the entire struct, including the last error buffer. + stats->Endpoints[len] = ep->stats; + + MICRO_CALL(err, micro_strdup((char **)&stats->Endpoints[len].Name, ep->name)); + MICRO_CALL(err, micro_strdup((char **)&stats->Endpoints[len].Subject, ep->subject)); + if (err == NULL) + { + avg = (long double)ep->stats.ProcessingTimeSeconds * 1000000000.0 + (long double)ep->stats.ProcessingTimeNanoseconds; + avg = avg / (long double)ep->stats.NumRequests; + stats->Endpoints[len].AverageProcessingTimeNanoseconds = (int64_t)avg; + len++; + stats->EndpointsLen = len; + } + micro_unlock_endpoint(ep); + } + } + + _unlock_service(m); + } + + if (err != NULL) + { + microServiceStats_Destroy(stats); + return err; + } + *new_stats = stats; + return NULL; +} + +void microServiceStats_Destroy(microServiceStats *stats) +{ + int i; + + if (stats == NULL) + return; + + for (i = 0; i < stats->EndpointsLen; i++) + { + NATS_FREE((char *)stats->Endpoints[i].Name); + NATS_FREE((char *)stats->Endpoints[i].Subject); + } + NATS_FREE(stats->Endpoints); + NATS_FREE((char *)stats->Name); + NATS_FREE((char *)stats->Version); + NATS_FREE((char *)stats->Id); + NATS_FREE(stats); +} diff --git a/deps/nats.c/src/micro_args.c b/deps/nats.c/src/micro_args.c new file mode 100644 index 0000000..7db7c7a --- /dev/null +++ b/deps/nats.c/src/micro_args.c @@ -0,0 +1,355 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "microp.h" +#include "micro_args.h" + +struct args_s +{ + void **args; + int count; +}; + +static microError *parse(void **args, int *args_len, const char *data, int data_len); + +static inline microError *new_args(microArgs **ptr, int n) +{ + *ptr = NATS_CALLOC(1, sizeof(microArgs)); + if (*ptr == NULL) + return micro_ErrorOutOfMemory; + + (*ptr)->args = NATS_CALLOC(n, sizeof(void *)); + if ((*ptr)->args == NULL) + { + NATS_FREE(*ptr); + return micro_ErrorOutOfMemory; + } + + (*ptr)->count = n; + return NULL; +} + +microError * +micro_ParseArgs(microArgs **ptr, const char *data, int data_len) +{ + microError *err = NULL; + microArgs *args = NULL; + int n = 0; + + if ((ptr == NULL) || (data == NULL) || (data_len < 0)) + return microError_Wrapf(micro_ErrorInvalidArg, "failed to parse args"); + + MICRO_CALL(err, parse(NULL, &n, data, data_len)); + MICRO_CALL(err, new_args(&args, n)); + MICRO_CALL(err, parse(args->args, &n, data, data_len)); + + if (err != NULL) + { + microArgs_Destroy(args); + return microError_Wrapf(err, "failed to parse args"); + } + *ptr = args; + return NULL; +} + +void microArgs_Destroy(microArgs *args) +{ + int i; + + if (args == NULL) + return; + + for (i = 0; i < args->count; i++) + { + NATS_FREE(args->args[i]); + } + NATS_FREE(args->args); + NATS_FREE(args); +} + +int microArgs_Count(microArgs *args) +{ + if (args == NULL) + return 0; + + return args->count; +} + +microError * +microArgs_GetInt(int *val, microArgs *args, int index) +{ + if ((args == NULL) || (index < 0) || (index >= args->count) || (val == NULL)) + return micro_ErrorInvalidArg; + + *val = *((int *)args->args[index]); + return NULL; +} + +microError * +microArgs_GetFloat(long double *val, microArgs *args, int index) +{ + if ((args == NULL) || (index < 0) || (index >= args->count) || (val == NULL)) + return micro_ErrorInvalidArg; + + *val = *((long double *)args->args[index]); + return NULL; +} + +microError * +microArgs_GetString(const char **val, microArgs *args, int index) +{ + if ((args == NULL) || (index < 0) || (index >= args->count) || (val == NULL)) + return micro_ErrorInvalidArg; + + *val = (const char *)args->args[index]; + return NULL; +} + +// decodes the rest of a string into a pre-allocated buffer of sufficient +// length, or just calculates the needed buffer size. The opening quote must +// have been already processed by the caller (parse). +static microError * +decode_rest_of_string(char *dup, int *decoded_len, int *i, const char *data, int data_len) +{ + char c; + int len = 0; + bool terminated = false; + bool escape = false; + + for (; !terminated && *i < data_len; (*i)++) + { + c = data[*i]; + switch (c) + { + case '"': + if (escape) + { + // include the escaped quote. + if (dup != NULL) + { + dup[len] = c; + } + len++; + escape = false; + } + else + { + // end of quoted string. + terminated = true; + } + break; + + case '\\': + if (!escape) + { + escape = true; + } + else + { + // include the escaped backslash. + if (dup != NULL) + { + dup[len] = c; + } + len++; + escape = false; + } + break; + + default: + if (dup != NULL) + { + dup[len] = c; + } + len++; + escape = false; + break; + } + } + if (!terminated) + { + return micro_Errorf("a quoted string is not properly terminated"); + } + + *decoded_len = len; + return NULL; +} + +static microError * +decode_and_dupe_rest_of_string(char **dup, int *i, const char *data, int data_len) +{ + microError *err = NULL; + int start = *i; + int decoded_len = 0; + + err = decode_rest_of_string(NULL, &decoded_len, i, data, data_len); + if (err != NULL) + { + return err; + } + if (dup == NULL) + { + // nothing else to do - the string has been scanned and validated. + return NULL; + } + + *i = start; + + *dup = NATS_CALLOC(decoded_len + 1, sizeof(char)); + if (*dup == NULL) + { + return micro_ErrorOutOfMemory; + } + + // no need to check for error the 2nd time, we already know the string is + // valid. + decode_rest_of_string(*dup, &decoded_len, i, data, data_len); + (*dup)[decoded_len] = 0; + return NULL; +} + +typedef enum parserState +{ + NewArg = 0, + NumberArg, +} parserState; + +static microError * +parse(void **args, int *args_len, const char *data, int data_len) +{ + int i = 0; + microError *err = NULL; + char c; + int n = 0; + parserState state = NewArg; + char numbuf[64]; + int num_len = 0; + bool is_float = false; + +#define EOS 0 + for (; i < data_len + 1;) + { + c = (i < data_len) ? data[i] : EOS; + + switch (state) + { + case NewArg: + switch (c) + { + case EOS: + case ' ': + i++; + break; + + case '"': + i++; // consume the opening quote. + err = decode_and_dupe_rest_of_string((char **)(&args[n]), &i, data, data_len); + if (err != NULL) + { + return err; + } + n++; + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + case '+': + case '.': + state = NumberArg; + num_len = 0; + numbuf[num_len++] = c; + is_float = (c == '.'); + i++; + break; + + default: + return micro_Errorf("unexpected '%c', an argument must be a number or a quoted string", c); + } + break; + + case NumberArg: + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + case '+': + case '.': + case 'e': + case 'E': + case ',': + numbuf[num_len] = c; + num_len++; + is_float = is_float || (c == '.') || (c == 'e') || (c == 'E'); + i++; + break; + + case EOS: + case ' ': + if (args != NULL) + { + numbuf[num_len] = 0; + if (is_float) + { + args[n] = NATS_CALLOC(1, sizeof(long double)); + if (args[n] == NULL) + { + return micro_ErrorOutOfMemory; + } + *(long double *)args[n] = strtold(numbuf, NULL); + } + else + { + args[n] = NATS_CALLOC(1, sizeof(int)); + if (args[n] == NULL) + { + return micro_ErrorOutOfMemory; + } + *(int *)args[n] = atoi(numbuf); + } + } + n++; + i++; + state = NewArg; + break; + + default: + return micro_Errorf("unexpected '%c', a number must be followed by a space", c); + } + break; + + default: + return micro_Errorf("unreachable: wrong state for a ' ', expected NewArg or NumberArg, got %d", state); + } + } + + *args_len = n; + return NULL; +} diff --git a/deps/nats.c/src/micro_args.h b/deps/nats.c/src/micro_args.h new file mode 100644 index 0000000..fa3efa4 --- /dev/null +++ b/deps/nats.c/src/micro_args.h @@ -0,0 +1,43 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef MICRO_ARGS_H_ +#define MICRO_ARGS_H_ + +/** + * Request unmarshaled as "arguments", a space-separated list of numbers and strings. + * TODO document the interface. + */ +typedef struct args_s microArgs; + +NATS_EXTERN microError * +micro_ParseArgs(microArgs **args, const char *data, int data_len); + +NATS_EXTERN int +microArgs_Count(microArgs *args); + +NATS_EXTERN microError * +microArgs_GetInt(int *val, microArgs *args, int index); + +NATS_EXTERN microError * +microArgs_GetFloat(long double *val, microArgs *args, int index); + +NATS_EXTERN microError * +microArgs_GetString(const char **val, microArgs *args, int index); + +NATS_EXTERN void +microArgs_Destroy(microArgs *args); + +/** @} */ // end of microserviceGroup + +#endif /* MICRO_H_ */ diff --git a/deps/nats.c/src/micro_client.c b/deps/nats.c/src/micro_client.c new file mode 100644 index 0000000..efb6585 --- /dev/null +++ b/deps/nats.c/src/micro_client.c @@ -0,0 +1,66 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "microp.h" +#include "conn.h" + +microError * +micro_NewClient(microClient **new_client, natsConnection *nc, microClientConfig *cfg) +{ + microClient *client = NULL; + + if (new_client == NULL) + return micro_ErrorInvalidArg; + + client = NATS_CALLOC(1, sizeof(microClient)); + if (client == NULL) + return micro_ErrorOutOfMemory; + + natsConn_retain(nc); + client->nc = nc; + *new_client = client; + return NULL; +} + +void microClient_Destroy(microClient *client) +{ + if (client == NULL) + return; + + natsConn_release(client->nc); + NATS_FREE(client); +} + +microError * +microClient_DoRequest(natsMsg **reply, microClient *client, const char *subject, const char *data, int data_len) +{ + natsStatus s = NATS_OK; + microError *err = NULL; + natsMsg *msg = NULL; + + if ((client == NULL) || (reply == NULL)) + return micro_ErrorInvalidArg; + + s = natsConnection_Request(&msg, client->nc, subject, data, data_len, 5000); + if (s != NATS_OK) + { + return microError_Wrapf(micro_ErrorFromStatus(s), "request failed"); + } + + err = micro_is_error_message(s, msg); + if (err == NULL) + { + *reply = msg; + } + return err; +} diff --git a/deps/nats.c/src/micro_endpoint.c b/deps/nats.c/src/micro_endpoint.c new file mode 100644 index 0000000..273ad53 --- /dev/null +++ b/deps/nats.c/src/micro_endpoint.c @@ -0,0 +1,432 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "microp.h" +#include "util.h" + +static microError *_dup_with_prefix(char **dst, const char *prefix, const char *src); + +static void _handle_request(natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure); + +static void _retain_endpoint(microEndpoint *ep, bool lock); +static void _release_endpoint(microEndpoint *ep); + +microError * +micro_new_endpoint(microEndpoint **new_ep, microService *m, const char *prefix, microEndpointConfig *cfg, bool is_internal) +{ + microError *err = NULL; + microEndpoint *ep = NULL; + const char *subj; + + if (cfg == NULL) + return microError_Wrapf(micro_ErrorInvalidArg, "NULL endpoint config"); + if (!micro_is_valid_name(cfg->Name)) + return microError_Wrapf(micro_ErrorInvalidArg, "invalid endpoint name %s", cfg->Name); + if (cfg->Handler == NULL) + return microError_Wrapf(micro_ErrorInvalidArg, "NULL endpoint request handler for %s", cfg->Name); + + if ((cfg->Subject != NULL) && !micro_is_valid_subject(cfg->Subject)) + return micro_ErrorInvalidArg; + + subj = nats_IsStringEmpty(cfg->Subject) ? cfg->Name : cfg->Subject; + + ep = NATS_CALLOC(1, sizeof(microEndpoint)); + if (ep == NULL) + return micro_ErrorOutOfMemory; + ep->is_monitoring_endpoint = is_internal; + ep->m = m; + + MICRO_CALL(err, micro_ErrorFromStatus(natsMutex_Create(&ep->endpoint_mu))); + MICRO_CALL(err, micro_clone_endpoint_config(&ep->config, cfg)); + MICRO_CALL(err, _dup_with_prefix(&ep->name, prefix, cfg->Name)); + MICRO_CALL(err, _dup_with_prefix(&ep->subject, prefix, subj)); + if (err != NULL) + { + micro_free_endpoint(ep); + return err; + } + + *new_ep = ep; + return NULL; +} + +microError * +micro_start_endpoint(microEndpoint *ep) +{ + natsStatus s = NATS_OK; + natsSubscription *sub = NULL; + + if ((ep->subject == NULL) || (ep->config == NULL) || (ep->config->Handler == NULL) || (ep->m == NULL)) + // nothing to do + return NULL; + + // reset the stats. + memset(&ep->stats, 0, sizeof(ep->stats)); + + if (ep->is_monitoring_endpoint) + s = natsConnection_Subscribe(&sub, ep->m->nc, ep->subject, _handle_request, ep); + else + s = natsConnection_QueueSubscribe(&sub, ep->m->nc, ep->subject, MICRO_QUEUE_GROUP, _handle_request, ep); + + if (s == NATS_OK) + { + // extra retain for the subscription since we'll need to hold it until + // on_complete. + micro_lock_endpoint(ep); + ep->refs++; + ep->sub = sub; + ep->is_draining = false; + micro_unlock_endpoint(ep); + + natsSubscription_SetOnCompleteCB(sub, micro_release_on_endpoint_complete, ep); + } + else + { + natsSubscription_Destroy(sub); // likely always a no-op. + } + + return micro_ErrorFromStatus(s); +} + +microError * +micro_stop_endpoint(microEndpoint *ep) +{ + natsStatus s = NATS_OK; + natsSubscription *sub = NULL; + + if ((ep == NULL) || (ep->m == NULL)) + return NULL; + + micro_lock_endpoint(ep); + sub = ep->sub; + + if (ep->is_draining || natsConnection_IsClosed(ep->m->nc) || !natsSubscription_IsValid(sub)) + { + // If stopping, _release_on_endpoint_complete will take care of + // finalizing, nothing else to do. In other cases + // _release_on_endpoint_complete has already been called. + micro_unlock_endpoint(ep); + return NULL; + } + + ep->is_draining = true; + micro_unlock_endpoint(ep); + + // When the drain is complete, will release the final ref on ep. + s = natsSubscription_Drain(sub); + if (s != NATS_OK) + { + return microError_Wrapf(micro_ErrorFromStatus(s), + "failed to stop endpoint %s: failed to drain subscription", ep->name); + } + + return NULL; +} + +void micro_retain_endpoint(microEndpoint *ep) +{ + if (ep == NULL) + return; + + micro_lock_endpoint(ep); + + ep->refs++; + + micro_unlock_endpoint(ep); +} + +void micro_release_endpoint(microEndpoint *ep) +{ + int refs; + + if (ep == NULL) + return; + + micro_lock_endpoint(ep); + + refs = --(ep->refs); + + micro_unlock_endpoint(ep); + + if (refs == 0) + micro_free_endpoint(ep); +} + +void micro_free_endpoint(microEndpoint *ep) +{ + if (ep == NULL) + return; + + NATS_FREE(ep->name); + NATS_FREE(ep->subject); + natsSubscription_Destroy(ep->sub); + natsMutex_Destroy(ep->endpoint_mu); + micro_free_cloned_endpoint_config(ep->config); + NATS_FREE(ep); +} + +static void +_update_last_error(microEndpoint *ep, microError *err) +{ + ep->stats.NumErrors++; + microError_String(err, ep->stats.LastErrorString, sizeof(ep->stats.LastErrorString)); +} + +static void +_handle_request(natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure) +{ + microError *err = NULL; + microError *service_err = NULL; + microEndpoint *ep = (microEndpoint *)closure; + microService *m; + microEndpointStats *stats = NULL; + microRequestHandler handler; + microRequest *req = NULL; + int64_t start, elapsed_ns = 0, full_s; + + if ((ep == NULL) || (ep->endpoint_mu == NULL) || (ep->config == NULL) || (ep->config->Handler == NULL)) + { + // This would be a bug, we should not have received a message on this + // subscription. + return; + } + + stats = &ep->stats; + m = ep->m; + handler = ep->config->Handler; + + err = micro_new_request(&req, m, ep, msg); + if (err == NULL) + { + // handle the request. + start = nats_NowInNanoSeconds(); + service_err = handler(req); + if (service_err != NULL) + { + // if the handler returned an error, we attempt to respond with it. + // Note that if the handler chose to do its own RespondError which + // fails, and then the handler returns its error - we'll try to + // RespondError again, double-counting the error. + err = microRequest_RespondError(req, service_err); + } + + elapsed_ns = nats_NowInNanoSeconds() - start; + } + + // Update stats. + micro_lock_endpoint(ep); + stats->NumRequests++; + stats->ProcessingTimeNanoseconds += elapsed_ns; + full_s = stats->ProcessingTimeNanoseconds / 1000000000; + stats->ProcessingTimeSeconds += full_s; + stats->ProcessingTimeNanoseconds -= full_s * 1000000000; + _update_last_error(ep, err); + micro_unlock_endpoint(ep); + + microError_Destroy(err); + micro_free_request(req); + natsMsg_Destroy(msg); +} + +void micro_update_last_error(microEndpoint *ep, microError *err) +{ + if (err == NULL || ep == NULL) + return; + + micro_lock_endpoint(ep); + _update_last_error(ep, err); + micro_unlock_endpoint(ep); +} + +bool micro_is_valid_name(const char *name) +{ + int i; + int len; + + if (name == NULL) + return false; + + len = (int)strlen(name); + if (len == 0) + return false; + + for (i = 0; i < len; i++) + { + if (!isalnum(name[i]) && (name[i] != '_') && (name[i] != '-')) + return false; + } + return true; +} + +bool micro_is_valid_subject(const char *subject) +{ + int i; + int len; + + if (subject == NULL) + return false; + + len = (int)strlen(subject); + if (len == 0) + return false; + + for (i = 0; i < len - 1; i++) + { + if ((subject[i] == ' ') || (subject[i] == '>')) + return false; + } + + if ((subject[i] == ' ')) + return false; + + return true; +} + +static inline microError * +_new_endpoint_config(microEndpointConfig **ptr) +{ + *ptr = NATS_CALLOC(1, sizeof(microEndpointConfig)); + return (*ptr == NULL) ? micro_ErrorOutOfMemory : NULL; +} + +microError * +micro_clone_endpoint_config(microEndpointConfig **out, microEndpointConfig *cfg) +{ + microError *err = NULL; + microEndpointConfig *new_cfg = NULL; + + if (out == NULL) + return micro_ErrorInvalidArg; + + if (cfg == NULL) + { + *out = NULL; + return NULL; + } + + err = _new_endpoint_config(&new_cfg); + if (err == NULL) + { + memcpy(new_cfg, cfg, sizeof(microEndpointConfig)); + } + + MICRO_CALL(err, micro_strdup((char **)&new_cfg->Name, cfg->Name)); + MICRO_CALL(err, micro_strdup((char **)&new_cfg->Subject, cfg->Subject)); + MICRO_CALL(err, micro_ErrorFromStatus( + nats_cloneMetadata(&new_cfg->Metadata, cfg->Metadata))); + + if (err != NULL) + { + micro_free_cloned_endpoint_config(new_cfg); + return err; + } + + *out = new_cfg; + return NULL; +} + +void micro_free_cloned_endpoint_config(microEndpointConfig *cfg) +{ + if (cfg == NULL) + return; + + // the strings are declared const for the public, but in a clone these need + // to be freed. + NATS_FREE((char *)cfg->Name); + NATS_FREE((char *)cfg->Subject); + nats_freeMetadata(&cfg->Metadata); + + NATS_FREE(cfg); +} + +bool micro_match_endpoint_subject(const char *ep_subject, const char *actual_subject) +{ + const char *e = ep_subject; + const char *a = actual_subject; + const char *etok, *enext; + int etok_len; + bool last_etok = false; + const char *atok, *anext; + int atok_len; + bool last_atok = false; + + if (e == NULL || a == NULL) + return false; + + while (true) + { + enext = strchr(e, '.'); + if (enext == NULL) + { + enext = e + strlen(e); + last_etok = true; + } + etok = e; + etok_len = (int)(enext - e); + e = enext + 1; + + anext = strchr(a, '.'); + if (anext == NULL) + { + anext = a + strlen(a); + last_atok = true; + } + atok = a; + atok_len = (int)(anext - a); + a = anext + 1; + + if (last_etok) + { + if (etok_len == 1 && etok[0] == '>') + return true; + + if (!last_atok) + return false; + } + if (!(etok_len == 1 && etok[0] == '*') && + !(etok_len == atok_len && strncmp(etok, atok, etok_len) == 0)) + { + return false; + } + if (last_atok) + { + return last_etok; + } + } +} + +static microError *_dup_with_prefix(char **dst, const char *prefix, const char *src) +{ + size_t len = strlen(src) + 1; + char *p; + + if (!nats_IsStringEmpty(prefix)) + len += strlen(prefix) + 1; + + *dst = NATS_CALLOC(1, len); + if (*dst == NULL) + return micro_ErrorOutOfMemory; + + p = *dst; + if (!nats_IsStringEmpty(prefix)) + { + len = strlen(prefix); + memcpy(p, prefix, len); + p[len] = '.'; + p += len + 1; + } + memcpy(p, src, strlen(src) + 1); + return NULL; +} diff --git a/deps/nats.c/src/micro_error.c b/deps/nats.c/src/micro_error.c new file mode 100644 index 0000000..4b64a40 --- /dev/null +++ b/deps/nats.c/src/micro_error.c @@ -0,0 +1,233 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "microp.h" + +static microError _errorOutOfMemory = { + .is_internal = true, + .status = NATS_NO_MEMORY, + .message = "out of memory", +}; + +static microError _errorInvalidArg = { + .is_internal = true, + .status = NATS_INVALID_ARG, + .message = "invalid function argument", +}; + +static microError _errorInvalidFormat = { + .is_internal = true, + .status = NATS_INVALID_ARG, + .message = "invalid format string", +}; + +microError *micro_ErrorOutOfMemory = &_errorOutOfMemory; +microError *micro_ErrorInvalidArg = &_errorInvalidArg; + +static microError * +verrorf(natsStatus s, int code, const char *format, va_list args) +{ + microError *err = NULL; + char *ptr; + int message_len = 0; + + va_list args2; + va_copy(args2, args); + + if (format == NULL) + format = ""; + + // Do not use nats_vsnprintf here since we want to calculate the size of + // the resulting formatted string. On Windows, that would fail. Use + // that instead. + message_len = nats_vscprintf(format, args); + if (message_len < 0) + { + va_end(args2); + return &_errorInvalidFormat; + } + + err = NATS_CALLOC(1, sizeof(microError) + message_len + 1); + if (err == NULL) + { + va_end(args2); + return &_errorOutOfMemory; + } + + ptr = (char *)(err) + sizeof(microError); + nats_vsnprintf(ptr, message_len + 1, format, args2); + va_end(args2); + err->message = (const char *)ptr; + + err->code = code; + err->status = s; + + return err; +} + +microError * +micro_Errorf(const char *format, ...) +{ + microError *err = NULL; + va_list args; + + va_start(args, format); + err = verrorf(NATS_OK, 0, format, args); + va_end(args); + return err; +} + +microError * +micro_ErrorfCode(int code, const char *format, ...) +{ + microError *err = NULL; + va_list args; + + va_start(args, format); + err = verrorf(NATS_OK, code, format, args); + va_end(args); + return err; +} + +microError * +micro_ErrorFromStatus(natsStatus s) +{ + microError *err = NULL; + const char *message = natsStatus_GetText(s); + size_t message_len = strlen(message); + char *ptr; + + if (s == NATS_OK) + return NULL; + + err = NATS_CALLOC(1, sizeof(microError) + message_len + 1); + if (err == NULL) + return &_errorOutOfMemory; + + ptr = (char *)(err) + sizeof(microError); + memcpy(ptr, message, message_len + 1); + err->message = ptr; + err->status = s; + return err; +} + +microError * +micro_is_error_message(natsStatus status, natsMsg *msg) +{ + microError *err = NULL; + const char *c = NULL, *d = NULL; + bool is_service_error; + bool is_nats_error = (status != NATS_OK); + int code = 0; + + if (msg != NULL) + { + natsMsgHeader_Get(msg, MICRO_ERROR_CODE_HDR, &c); + natsMsgHeader_Get(msg, MICRO_ERROR_HDR, &d); + } + if (!nats_IsStringEmpty(c)) + { + code = atoi(c); + } + is_service_error = (code != 0) || !nats_IsStringEmpty(d); + + if (is_service_error && !is_nats_error) + { + return micro_ErrorfCode(code, d); + } + else if (!is_service_error && is_nats_error) + { + return micro_ErrorFromStatus(status); + } + else if (is_service_error && is_nats_error) + { + err = microError_Wrapf(micro_ErrorFromStatus(status), d); + err->code = code; + return err; + } + + return NULL; +} + +microError * +microError_Wrapf(microError *err, const char *format, ...) +{ + va_list args; + microError *new_err = NULL; + + if (err == NULL) + return NULL; + + va_start(args, format); + new_err = verrorf(NATS_OK, 0, format, args); + va_end(args); + + new_err->cause = err; + return new_err; +} + +const char * +microError_String(microError *err, char *buf, size_t size) +{ + size_t used = 0; + const char *caused; + + if (buf == NULL) + return ""; + if (err == NULL) + { + snprintf(buf, size, "null"); + return buf; + } + + if (err->status != NATS_OK) + { + used += snprintf(buf + used, size - used, "status %u: ", err->status); + } + if (err->code != 0) + { + used += snprintf(buf + used, size - used, "code %d: ", err->code); + } + used += snprintf(buf + used, size - used, "%s", err->message); + + if (err->cause != NULL) + { + used += snprintf(buf + used, size - used, ": "); + caused = microError_String(err->cause, buf + used, size - used); + used += strlen(caused); + } + return buf; +} + +natsStatus +microError_Status(microError *err) +{ + if (err == NULL) + return NATS_OK; + + if (err->status != NATS_OK) + return err->status; + + return microError_Status(err->cause); +} + +void microError_Destroy(microError *err) +{ + if ((err == NULL) || err->is_internal) + return; + + microError_Destroy(err->cause); + NATS_FREE(err); +} diff --git a/deps/nats.c/src/micro_monitoring.c b/deps/nats.c/src/micro_monitoring.c new file mode 100644 index 0000000..80f1188 --- /dev/null +++ b/deps/nats.c/src/micro_monitoring.c @@ -0,0 +1,352 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "microp.h" +#include "util.h" + +static microError *marshal_ping(natsBuffer **new_buf, microService *m); +static microError *handle_ping(microRequest *req); +static microError *marshal_info(natsBuffer **new_buf, microServiceInfo *info); +static microError *handle_info(microRequest *req); +static microError *marshal_stats(natsBuffer **new_buf, microServiceStats *stats); +static microError *handle_stats(microRequest *req); + +static microError * +add_internal_handler(microService *m, const char *verb, const char *kind, const char *id, const char *name, microRequestHandler handler); +static microError * +add_verb_handlers(microService *m, const char *verb, microRequestHandler handler); +static microError * +new_dotted_subject(char **new_subject, int count, ...); + +microError * +micro_init_monitoring(microService *m) +{ + microError *err = NULL; + MICRO_CALL(err, add_verb_handlers(m, MICRO_PING_VERB, handle_ping)); + MICRO_CALL(err, add_verb_handlers(m, MICRO_STATS_VERB, handle_stats)); + MICRO_CALL(err, add_verb_handlers(m, MICRO_INFO_VERB, handle_info)); + return err; +} + +static microError * +handle_ping(microRequest *req) +{ + microError *err = NULL; + microService *m = microRequest_GetService(req); + natsBuffer *buf = NULL; + + if ((m == NULL) || (m->cfg == NULL)) + return micro_ErrorInvalidArg; // Should not happen + + MICRO_CALL(err, marshal_ping(&buf, m)); + MICRO_CALL(err, microRequest_Respond(req, natsBuf_Data(buf), natsBuf_Len(buf))); + + natsBuf_Destroy(buf); + return err; +} + +static microError * +handle_info(microRequest *req) +{ + microError *err = NULL; + microService *m = microRequest_GetService(req); + microServiceInfo *info = NULL; + natsBuffer *buf = NULL; + + if ((m == NULL) || (m->cfg == NULL)) + return micro_ErrorInvalidArg; // Should not happen + + MICRO_CALL(err, microService_GetInfo(&info, m)); + MICRO_CALL(err, marshal_info(&buf, info)); + MICRO_CALL(err, microRequest_Respond(req, natsBuf_Data(buf), natsBuf_Len(buf))); + + natsBuf_Destroy(buf); + microServiceInfo_Destroy(info); + return err; +} + +static microError * +handle_stats_internal(microRequest *req) +{ + microError *err = NULL; + microService *m = microRequest_GetService(req); + microServiceStats *stats = NULL; + natsBuffer *buf = NULL; + + if ((m == NULL) || (m == NULL)) + return micro_ErrorInvalidArg; // Should not happen + + MICRO_CALL(err, microService_GetStats(&stats, req->Service)); + MICRO_CALL(err, marshal_stats(&buf, stats)); + MICRO_CALL(err, microRequest_Respond(req, natsBuf_Data(buf), natsBuf_Len(buf))); + + natsBuf_Destroy(buf); + microServiceStats_Destroy(stats); + return err; +} + +static microError * +handle_stats(microRequest *req) +{ + microService *m = microRequest_GetService(req); + + if ((m == NULL) || (m->cfg == NULL)) + return micro_ErrorInvalidArg; // Should not happen + + if (m->cfg->StatsHandler != NULL) + return m->cfg->StatsHandler(req); + else + return handle_stats_internal(req); +} + +static microError * +new_dotted_subject(char **new_subject, int count, ...) +{ + va_list args; + int i; + size_t len, n; + char *result, *p; + + va_start(args, count); + len = 0; + for (i = 0; i < count; i++) + { + if (i > 0) + { + len++; /* for the dot */ + } + len += strlen(va_arg(args, char *)); + } + va_end(args); + + result = NATS_CALLOC(len + 1, 1); + if (result == NULL) + { + return micro_ErrorInvalidArg; + } + + len = 0; + va_start(args, count); + for (i = 0; i < count; i++) + { + if (i > 0) + { + result[len++] = '.'; + } + p = va_arg(args, char *); + n = strlen(p); + memcpy(result + len, p, n); + len += n; + } + va_end(args); + + *new_subject = result; + return NULL; +} + +microError * +micro_new_control_subject(char **newSubject, const char *verb, const char *name, const char *id) +{ + if (nats_IsStringEmpty(name) && !nats_IsStringEmpty(id)) + { + return micro_Errorf("service name is required when id is provided: %s", id); + } + + else if (nats_IsStringEmpty(name) && nats_IsStringEmpty(id)) + return new_dotted_subject(newSubject, 2, MICRO_API_PREFIX, verb); + else if (nats_IsStringEmpty(id)) + return new_dotted_subject(newSubject, 3, MICRO_API_PREFIX, verb, name); + else + return new_dotted_subject(newSubject, 4, MICRO_API_PREFIX, verb, name, id); +} + +static microError * +add_internal_handler(microService *m, const char *verb, const char *kind, + const char *id, const char *name, microRequestHandler handler) +{ + microError *err = NULL; + char *subj = NULL; + + err = micro_new_control_subject(&subj, verb, kind, id); + if (err != NULL) + return err; + + microEndpointConfig cfg = { + .Subject = subj, + .Name = name, + .Handler = handler, + }; + err = micro_add_endpoint(NULL, m, "", &cfg, true); + NATS_FREE(subj); + return err; +} + +// __verbHandlers generates control handlers for a specific verb. Each request +// generates 3 subscriptions, one for the general verb affecting all services +// written with the framework, one that handles all services of a particular +// kind, and finally a specific service instance. +static microError * +add_verb_handlers(microService *m, const char *verb, microRequestHandler handler) +{ + microError *err = NULL; + char name[1024]; + + snprintf(name, sizeof(name), "%s-all", verb); + err = add_internal_handler(m, verb, "", "", name, handler); + if (err == NULL) + { + snprintf(name, sizeof(name), "%s-kind", verb); + err = add_internal_handler(m, verb, m->cfg->Name, "", name, handler); + } + if (err == NULL) + { + err = add_internal_handler(m, verb, m->cfg->Name, m->id, verb, handler); + } + return err; +} + +// name and sep must be a string literal +#define IFOK_attr(_name, _value, _sep) \ + IFOK(s, natsBuf_Append(buf, "\"" _name "\":\"", -1)); \ + IFOK(s, natsBuf_Append(buf, (_value) != NULL ? (_value) : "", -1)); \ + IFOK(s, natsBuf_Append(buf, "\"" _sep, -1)); + +static microError * +marshal_ping(natsBuffer **new_buf, microService *m) +{ + natsBuffer *buf = NULL; + natsStatus s; + + s = natsBuf_Create(&buf, 1024); + if (s == NATS_OK) + { + s = natsBuf_AppendByte(buf, '{'); + IFOK_attr("name", m->cfg->Name, ","); + IFOK_attr("version", m->cfg->Version, ","); + IFOK_attr("id", m->id, ","); + IFOK_attr("type", MICRO_PING_RESPONSE_TYPE, ""); + IFOK(s, natsBuf_AppendByte(buf, '}')); + } + + if (s != NATS_OK) + { + natsBuf_Destroy(buf); + return micro_ErrorFromStatus(s); + } + + *new_buf = buf; + return NULL; +} + +static microError * +marshal_info(natsBuffer **new_buf, microServiceInfo *info) +{ + natsBuffer *buf = NULL; + natsStatus s; + int i; + + s = natsBuf_Create(&buf, 4096); + IFOK(s, natsBuf_AppendByte(buf, '{')); + + IFOK_attr("description", info->Description, ","); + + // "endpoints":{...} + if ((s == NATS_OK) && (info->EndpointsLen > 0)) + { + IFOK(s, natsBuf_Append(buf, "\"endpoints\":[", -1)); + for (i = 0; ((s == NATS_OK) && (i < info->EndpointsLen)); i++) + { + IFOK(s, natsBuf_AppendByte(buf, '{')); + IFOK_attr("name", info->Endpoints[i].Name, ""); + IFOK(s, nats_marshalMetadata(buf, true, "metadata", info->Endpoints[i].Metadata)); + IFOK(s, natsBuf_AppendByte(buf, ',')); + IFOK_attr("subject", info->Endpoints[i].Subject, ""); + IFOK(s, natsBuf_AppendByte(buf, '}')); // end endpoint + if (i != info->EndpointsLen - 1) + IFOK(s, natsBuf_AppendByte(buf, ',')); + } + IFOK(s, natsBuf_Append(buf, "],", 2)); + } + + IFOK_attr("id", info->Id, ""); + IFOK(s, nats_marshalMetadata(buf, true, "metadata", info->Metadata)); + IFOK(s, natsBuf_AppendByte(buf, ',')); + IFOK_attr("name", info->Name, ","); + IFOK_attr("type", info->Type, ","); + IFOK_attr("version", info->Version, ""); + IFOK(s, natsBuf_AppendByte(buf, '}')); + + if (s != NATS_OK) + { + natsBuf_Destroy(buf); + return microError_Wrapf(micro_ErrorFromStatus(s), "failed to marshal service info"); + } + *new_buf = buf; + return NULL; +} + +static microError * +marshal_stats(natsBuffer **new_buf, microServiceStats *stats) +{ + natsBuffer *buf = NULL; + natsStatus s; + int i; + char timebuf[128]; + microEndpointStats *ep; + + s = natsBuf_Create(&buf, 8 * 1024); + IFOK(s, natsBuf_AppendByte(buf, '{')); + IFOK_attr("id", stats->Id, ","); + IFOK_attr("name", stats->Name, ","); + IFOK_attr("type", stats->Type, ","); + IFOK(s, nats_EncodeTimeUTC(timebuf, sizeof(timebuf), stats->Started)); + IFOK_attr("started", timebuf, ","); + + if ((s == NATS_OK) && (stats->EndpointsLen > 0)) + { + IFOK(s, natsBuf_Append(buf, "\"endpoints\":[", -1)); + for (i = 0; i < stats->EndpointsLen; i++) + { + ep = &stats->Endpoints[i]; + IFOK(s, natsBuf_AppendByte(buf, '{')); + IFOK_attr("name", ep->Name, ","); + IFOK_attr("subject", ep->Subject, ","); + IFOK(s, nats_marshalLong(buf, false, "num_requests", ep->NumRequests)); + IFOK(s, nats_marshalLong(buf, true, "num_errors", ep->NumErrors)); + IFOK(s, nats_marshalDuration(buf, true, "average_processing_time", ep->AverageProcessingTimeNanoseconds)); + IFOK(s, natsBuf_AppendByte(buf, ',')); + IFOK_attr("last_error", ep->LastErrorString, ""); + IFOK(s, natsBuf_AppendByte(buf, '}')); + + if (i < (stats->EndpointsLen - 1)) + IFOK(s, natsBuf_AppendByte(buf, ',')); + } + IFOK(s, natsBuf_Append(buf, "],", 2)); + } + + IFOK_attr("version", stats->Version, ""); + IFOK(s, natsBuf_AppendByte(buf, '}')); + + if (s == NATS_OK) + { + *new_buf = buf; + return NULL; + } + else + { + natsBuf_Destroy(buf); + return microError_Wrapf(micro_ErrorFromStatus(s), "failed to marshal service info"); + } +} diff --git a/deps/nats.c/src/micro_request.c b/deps/nats.c/src/micro_request.c new file mode 100644 index 0000000..72159b7 --- /dev/null +++ b/deps/nats.c/src/micro_request.c @@ -0,0 +1,201 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "microp.h" + +microError * +microRequest_Respond(microRequest *req, const char *data, size_t len) +{ + return microRequest_RespondCustom(req, NULL, data, len); +} + +microError * +microRequest_RespondError(microRequest *req, microError *err) +{ + return microRequest_RespondCustom(req, err, NULL, 0); +} + +microError * +microRequest_RespondCustom(microRequest *req, microError *service_error, const char *data, size_t len) +{ + natsMsg *msg = NULL; + natsStatus s = NATS_OK; + char buf[64]; + + if ((req == NULL) || (req->Message == NULL) || (req->Message->sub == NULL) || (req->Message->sub->conn == NULL)) + { + s = NATS_INVALID_ARG; + } + if (s == NATS_OK) + { + s = natsMsg_Create(&msg, natsMsg_GetReply(req->Message), NULL, data, (int)len); + } + if ((s == NATS_OK) && (service_error != NULL)) + { + micro_update_last_error(req->Endpoint, service_error); + if (service_error->status != NATS_OK) + { + s = natsMsgHeader_Set(msg, MICRO_STATUS_HDR, natsStatus_GetText(service_error->status)); + } + if (s == NATS_OK) + { + s = natsMsgHeader_Set(msg, MICRO_ERROR_HDR, service_error->message); + } + if (s == NATS_OK) + { + snprintf(buf, sizeof(buf), "%u", service_error->code); + s = natsMsgHeader_Set(msg, MICRO_ERROR_CODE_HDR, buf); + } + } + if (s == NATS_OK) + { + s = natsConnection_PublishMsg(req->Message->sub->conn, msg); + } + + microError_Destroy(service_error); + natsMsg_Destroy(msg); + return microError_Wrapf( + micro_ErrorFromStatus(s), + "microRequest_RespondErrorWithData failed"); +} + +microError * +microRequest_AddHeader(microRequest *req, const char *key, const char *value) +{ + return micro_ErrorFromStatus( + natsMsgHeader_Add(microRequest_GetMsg(req), key, value)); +} + +microError * +microRequest_DeleteHeader(microRequest *req, const char *key) +{ + return micro_ErrorFromStatus( + natsMsgHeader_Delete(microRequest_GetMsg(req), key)); +} + +natsConnection * +microRequest_GetConnection(microRequest *req) +{ + return ((req != NULL) && (req->Service != NULL)) ? req->Service->nc : NULL; +} + +const char * +microRequest_GetData(microRequest *req) +{ + return natsMsg_GetData(microRequest_GetMsg(req)); +} + +int microRequest_GetDataLength(microRequest *req) +{ + return natsMsg_GetDataLength(microRequest_GetMsg(req)); +} + +microEndpoint * +microRequest_GetEndpoint(microRequest *req) +{ + return (req != NULL) ? req->Endpoint : NULL; +} + +microError * +microRequest_GetHeaderKeys(microRequest *req, const char ***keys, int *count) +{ + return micro_ErrorFromStatus( + natsMsgHeader_Keys(microRequest_GetMsg(req), keys, count)); +} + +microError * +microRequest_GetHeaderValue(microRequest *req, const char *key, const char **value) +{ + return micro_ErrorFromStatus( + natsMsgHeader_Get(microRequest_GetMsg(req), key, value)); +} + +microError * +microRequest_GetHeaderValues(microRequest *req, const char *key, const char ***values, int *count) +{ + return micro_ErrorFromStatus( + natsMsgHeader_Values(microRequest_GetMsg(req), key, values, count)); +} + +natsMsg * +microRequest_GetMsg(microRequest *req) +{ + return (req != NULL) ? req->Message : NULL; +} + +const char * +microRequest_GetReply(microRequest *req) +{ + return natsMsg_GetReply(microRequest_GetMsg(req)); +} + +const char *microRequest_GetSubject(microRequest *req) +{ + return natsMsg_GetSubject(microRequest_GetMsg(req)); +} + +void *microRequest_GetServiceState(microRequest *req) +{ + if ((req == NULL) || (req->Service == NULL) || (req->Service->cfg == NULL)) + { + return NULL; + } + return req->Service->cfg->State; +} + +void *microRequest_GetEndpointState(microRequest *req) +{ + if ((req == NULL) || (req->Endpoint == NULL) || (req->Endpoint->config == NULL)) + { + return NULL; + } + return req->Endpoint->config->State; +} + +microError * +microRequest_SetHeader(microRequest *req, const char *key, const char *value) +{ + return micro_ErrorFromStatus( + natsMsgHeader_Set(microRequest_GetMsg(req), key, value)); +} + +microService * +microRequest_GetService(microRequest *req) +{ + return (req != NULL) ? req->Service : NULL; +} + +void micro_free_request(microRequest *req) +{ + NATS_FREE(req); +} + +microError * +micro_new_request(microRequest **new_request, microService *m, microEndpoint *ep, natsMsg *msg) +{ + microRequest *req = NULL; + + // endpoint is optional, service and message references are required. + if ((new_request == NULL) || (m == NULL) || (msg == NULL)) + return micro_ErrorInvalidArg; + + req = (microRequest *)NATS_CALLOC(1, sizeof(microRequest)); + if (req == NULL) + return micro_ErrorOutOfMemory; + + req->Message = msg; + req->Service = m; + req->Endpoint = ep; + *new_request = req; + return NULL; +} diff --git a/deps/nats.c/src/microp.h b/deps/nats.c/src/microp.h new file mode 100644 index 0000000..8cf780c --- /dev/null +++ b/deps/nats.c/src/microp.h @@ -0,0 +1,185 @@ +// Copyright 2023 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef MICROP_H_ +#define MICROP_H_ + +#include "natsp.h" +#include "mem.h" + +#define MICRO_CALL(__err, __call) \ + if ((__err) == NULL) \ + { \ + __err = (__call); \ + } + +#define MICRO_DO(__err, __block) \ + if ((__err) == NULL) \ + __block; + +#define MICRO_QUEUE_GROUP "q" + +#define MICRO_DEFAULT_ENDPOINT_NAME "default" + +struct micro_error_s +{ + bool is_internal; + struct micro_error_s *cause; + natsStatus status; + int code; + const char *message; +}; + +struct micro_client_s +{ + natsConnection *nc; +}; + +struct micro_endpoint_s +{ + // The name and subject that the endpoint is listening on (may be different + // from one specified in config). + char *name; + char *subject; + + // A copy of the config provided to add_endpoint. + microEndpointConfig *config; + + // Retained/released by the service that owns the endpoint to avoid race + // conditions. + microService *m; + + // Monitoring endpoints are different in a few ways. For now, express it as + // a single flag but consider unbundling: + // - use_queue_group: Service endpoints use a queue group, monitoring + // endpoints don't. + // - forward_response_errors_to_async_handler: Service endpoints handle + // respond errors themselves, standard monitoring endpoints don't, so + // send the errors to the service async handler, if exists. + // - gather_stats: Monitoring endpoints don't need stats. + // - include_in_info: Monitoring endpoints are not listed in INFO + // responses. + bool is_monitoring_endpoint; + + // Mutex for starting/stopping the endpoint, and for updating the stats. + natsMutex *endpoint_mu; + int refs; + bool is_draining; + + // The subscription for the endpoint. If NULL, the endpoint is stopped. + natsSubscription *sub; + + // Endpoint stats. These are initialized only for running endpoints, and are + // cleared if the endpoint is stopped. + microEndpointStats stats; + + microEndpoint *next; +}; + +struct micro_group_s +{ + struct micro_service_s *m; + struct micro_group_s *next; + char prefix[]; +}; + +struct micro_service_s +{ + // these are set at initialization time time and do not change. + natsConnection *nc; + microServiceConfig *cfg; + char id[NUID_BUFFER_LEN + 1]; + + // groups are just convenient wrappers to make "prefixed" endpoints with + // AddEndpoint. They are added at initializaton time, so no need to lock. + struct micro_group_s *groups; + + // these are are updated concurrently with access as the service runs, so + // need to be protected by mutex. + natsMutex *service_mu; + int refs; + + struct micro_endpoint_s *first_ep; + + int64_t started; // UTC time expressed as number of nanoseconds since epoch. + bool stopped; +}; + +/** + * A microservice request. + * + * microRequest represents a request received by a microservice endpoint. + */ +struct micro_request_s +{ + /** + * @brief The NATS message underlying the request. + */ + natsMsg *Message; + + /** + * @brief A reference to the service that received the request. + */ + microService *Service; + + /** + * @brief A reference to the service that received the request. + */ + microEndpoint *Endpoint; +}; + +extern microError *micro_ErrorOutOfMemory; +extern microError *micro_ErrorInvalidArg; + +microError *micro_add_endpoint(microEndpoint **new_ep, microService *m, const char *prefix, microEndpointConfig *cfg, bool is_internal); +microError *micro_clone_endpoint_config(microEndpointConfig **out, microEndpointConfig *cfg); +microError *micro_init_monitoring(microService *m); +microError *micro_is_error_message(natsStatus s, natsMsg *msg); +microError *micro_new_control_subject(char **newSubject, const char *verb, const char *name, const char *id); +microError *micro_new_endpoint(microEndpoint **new_ep, microService *m, const char *prefix, microEndpointConfig *cfg, bool is_internal); +microError *micro_new_request(microRequest **new_request, microService *m, microEndpoint *ep, natsMsg *msg); +microError *micro_start_endpoint(microEndpoint *ep); +microError *micro_stop_endpoint(microEndpoint *ep); + +void micro_free_cloned_endpoint_config(microEndpointConfig *cfg); +void micro_free_endpoint(microEndpoint *ep); +void micro_free_request(microRequest *req); +void micro_release_endpoint(microEndpoint *ep); +void micro_release_on_endpoint_complete(void *closure); +void micro_retain_endpoint(microEndpoint *ep); +void micro_update_last_error(microEndpoint *ep, microError *err); + +bool micro_is_valid_name(const char *name); +bool micro_is_valid_subject(const char *subject); +bool micro_match_endpoint_subject(const char *ep_subject, const char *actual_subject); + +static inline void micro_lock_endpoint(microEndpoint *ep) { natsMutex_Lock(ep->endpoint_mu); } +static inline void micro_unlock_endpoint(microEndpoint *ep) { natsMutex_Unlock(ep->endpoint_mu); } + +static inline microError * +micro_strdup(char **ptr, const char *str) +{ + // Make a strdup(NULL) be a no-op, so we don't have to check for NULL + // everywhere. + if (str == NULL) + { + *ptr = NULL; + return NULL; + } + *ptr = NATS_STRDUP(str); + if (*ptr == NULL) + return micro_ErrorOutOfMemory; + return NULL; +} + +#endif /* MICROP_H_ */ diff --git a/deps/nats.c/src/nats.c b/deps/nats.c/src/nats.c index fcaaf0e..465491d 100644 --- a/deps/nats.c/src/nats.c +++ b/deps/nats.c/src/nats.c @@ -1,4 +1,4 @@ -// Copyright 2015-2021 The NATS Authors +// Copyright 2015-2023 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -123,6 +123,11 @@ typedef struct __natsLib natsGCList gc; + // For micro services code + natsMutex *service_callback_mu; + // uses `microService*` as the key and the value. + natsHash *all_services_to_callback; + } natsLib; int64_t gLockSpinCount = 2000; @@ -332,6 +337,8 @@ _freeLib(void) _freeGC(); _freeDlvWorkers(); natsNUID_free(); + natsMutex_Destroy(gLib.service_callback_mu); + natsHash_Destroy(gLib.all_services_to_callback); natsCondition_Destroy(gLib.cond); @@ -763,8 +770,13 @@ _asyncCbsThread(void *arg) switch (cb->type) { case ASYNC_CLOSED: - (*(nc->opts->closedCb))(nc, nc->opts->closedCbClosure); + { + (*(nc->opts->closedCb))(nc, nc->opts->closedCbClosure); + if (nc->opts->microClosedCb != NULL) + (*(nc->opts->microClosedCb))(nc, NULL); break; + } + case ASYNC_DISCONNECTED: (*(nc->opts->disconnectedCb))(nc, nc->opts->disconnectedCbClosure); break; @@ -784,7 +796,10 @@ _asyncCbsThread(void *arg) { if (cb->errTxt != NULL) nats_setErrStatusAndTxt(cb->err, cb->errTxt); + (*(nc->opts->asyncErrCb))(nc, cb->sub, cb->err, nc->opts->asyncErrCbClosure); + if (nc->opts->microAsyncErrCb != NULL) + (*(nc->opts->microAsyncErrCb))(nc, cb->sub, cb->err, NULL); break; } #if defined(NATS_HAS_STREAMING) @@ -1048,6 +1063,10 @@ nats_Open(int64_t lockSpinCount) if (gLib.dlvWorkers.workers == NULL) s = NATS_NO_MEMORY; } + if (s == NATS_OK) + s = natsMutex_Create(&gLib.service_callback_mu); + if (s == NATS_OK) + s = natsHash_Create(&gLib.all_services_to_callback, 8); if (s == NATS_OK) gLib.initialized = true; @@ -1969,13 +1988,13 @@ natsLib_msgDeliveryAssignWorker(natsSubscription *sub) } bool -natsLib_isLibHandlingMsgDeliveryByDefault() +natsLib_isLibHandlingMsgDeliveryByDefault(void) { return gLib.libHandlingMsgDeliveryByDefault; } int64_t -natsLib_defaultWriteDeadline() +natsLib_defaultWriteDeadline(void) { return gLib.libDefaultWriteDeadline; } @@ -1992,3 +2011,38 @@ natsLib_getMsgDeliveryPoolInfo(int *maxSize, int *size, int *idx, natsMsgDlvWork *workersArray = workers->workers; natsMutex_Unlock(workers->lock); } + +natsStatus +natsLib_startServiceCallbacks(microService *m) +{ + natsStatus s; + + natsMutex_Lock(gLib.service_callback_mu); + s = natsHash_Set(gLib.all_services_to_callback, (int64_t)m, (void *)m, NULL); + natsMutex_Unlock(gLib.service_callback_mu); + + return NATS_UPDATE_ERR_STACK(s); +} + +void +natsLib_stopServiceCallbacks(microService *m) +{ + if (m == NULL) + return; + + natsMutex_Lock(gLib.service_callback_mu); + natsHash_Remove(gLib.all_services_to_callback, (int64_t)m); + natsMutex_Unlock(gLib.service_callback_mu); +} + +natsMutex* +natsLib_getServiceCallbackMutex(void) +{ + return gLib.service_callback_mu; +} + +natsHash* +natsLib_getAllServicesToCallback(void) +{ + return gLib.all_services_to_callback; +} diff --git a/deps/nats.c/src/nats.h b/deps/nats.c/src/nats.h index 5b53a29..15ee674 100644 --- a/deps/nats.c/src/nats.h +++ b/deps/nats.c/src/nats.h @@ -1,4 +1,4 @@ -// Copyright 2015-2022 The NATS Authors +// Copyright 2015-2023 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -216,6 +216,19 @@ typedef struct natsMsgList } natsMsgList; +/** \brief A type to represent user-provided metadata, a list of k=v pairs. + * + * Used in JetStream, microservice configuration. + */ + +typedef struct natsMetadata +{ + // User-provided metadata for the stream, encoded as an array of {"key", "value",...} + const char **List; + // Number of key/value pairs in Metadata, 1/2 of the length of the array. + int Count; +} natsMetadata; + /** * The JetStream context. Use for JetStream assets management and communication. * @@ -284,6 +297,15 @@ typedef enum } jsStorageType; +/** + * Determines how messages are compressed when stored for retention. + */ +typedef enum +{ + js_StorageCompressionNone = 0, ///< Specifies no compression. It's the default. + js_StorageCompressionS2, ///< Specifies S2. +} jsStorageCompression; + /** * Determines how the consumer should select the first message to deliver. */ @@ -393,6 +415,26 @@ typedef struct jsRePublish } jsRePublish; +/** + * SubjectTransformConfig is for applying a subject transform (to matching + * messages) before doing anything else when a new message is received + */ +typedef struct jsSubjectTransformConfig +{ + const char *Source; + const char *Destination; +} jsSubjectTransformConfig; + +/** + * SubjectTransformConfig is for applying a subject transform (to matching + * messages) before doing anything else when a new message is received + */ +typedef struct jsStreamConsumerLimits +{ + int64_t InactiveThreshold; + int MaxAckPending; +} jsStreamConsumerLimits; + /** * Configuration of a JetStream stream. * @@ -406,6 +448,9 @@ typedef struct jsRePublish * * \note The strings are applications owned and will not be freed by the library. * + * \note NATS server 2.10 added user-provided Metadata, storage Compression + * type, FirstSeq to specify the starting sequence number, and SubjectTransform. + * * @see jsStreamConfig_Init * * \code{.unparsed} @@ -511,6 +556,31 @@ typedef struct jsStreamConfig { // Allow KV like semantics to also discard new on a per subject basis bool DiscardNewPerSubject; + /** + * @brief Configuration options introduced in 2.10 + * + * - Metadata is a user-provided array of key/value pairs, encoded as a + * string array [n1, v1, n2, v2, ...] representing key/value pairs + * {n1:v1, n2:v2, ...}. + * + * - Compression: js_StorageCompressionNone (default) or + * js_StorageCompressionS2 + * + * - FirstSeq: the starting sequence number for the stream. + * + * - SubjectTransformConfig is for applying a subject transform (to + * matching messages) before doing anything else when a new message is + * received + * + * - ConsumerLimits is for setting the limits on certain options on all + * consumers of the stream. + */ + + natsMetadata Metadata; + jsStorageCompression Compression; + uint64_t FirstSeq; + jsSubjectTransformConfig SubjectTransform; + jsStreamConsumerLimits ConsumerLimits; } jsStreamConfig; /** @@ -632,6 +702,9 @@ typedef struct jsStreamSourceInfo jsExternalStream *External; uint64_t Lag; int64_t Active; + const char * FilterSubject; + jsSubjectTransformConfig *SubjectTransforms; + int SubjectTransformsLen; } jsStreamSourceInfo; @@ -716,6 +789,13 @@ typedef struct jsStreamNamesList * instead, it will receive only messages headers (if present) with the addition of * the header #JSMsgSize ("Nats-Msg-Size"), whose value is the payload size. * + * \note NATS server 2.10 added FilterSubjects, an array of multiple filter + * subjects. It is mutually exclusive with the previously available single + * FilterSubject. + * + * \note NATS server 2.10 added consumer Metadata which contains user-provided + * string name/value pairs. + * * @see jsConsumerConfig_Init * * \code{.unparsed} @@ -770,6 +850,14 @@ typedef struct jsConsumerConfig // Force memory storage. bool MemoryStorage; + // Configuration options introduced in 2.10 + + // Multiple filter subjects + const char **FilterSubjects; + int FilterSubjectsLen; + + // User-provided metadata for the consumer, encoded as an array of {"key", "value",...} + natsMetadata Metadata; } jsConsumerConfig; /** @@ -7104,6 +7192,1248 @@ kvStatus_Destroy(kvStatus *sts); /** @} */ // end of funcGroup +// +// Microservices. +// + +/** \defgroup microGroup EXPERIMENTAL - Microservices + * + * \warning EXPERIMENTAL FEATURE! We reserve the right to change the API without + * necessarily bumping the major version of the library. + * + * ### NATS Microservices. + * + * Microservices can expose one or more request-response endpoints that process + * incoming NATS messages. + * + * Microservices are created by calling micro_AddService, and configured by + * passing a microServiceConfig to it. Many microservices can share a single + * connection to a NATS server. + * + * Once created, a microservice will subscribe to all endpoints' subjects and + * associate them with the configured handlers. It will also subscribe to and + * service monitoring subjects for service-specific pings, metadata, and + * statistics requests. The endpoint subscriptions are created with a queue + * group, so that incoming requests are automatically load-balanced across all + * running instances of a microservice. The monitoring subscriptions are not + * groupped, each service instance receives and responds to all monitoring + * requests. + * + * Once created, the microservice is asyncronous, message handlers and other + * callbacks will be invoked in separate threads. No further action is needed. + * Your program can use microService_Stop, microService_IsStopped to control the + * execution of the service. + * + * @{ + */ + +/** \defgroup microTypes Types + * + * Microservice types. + * + * @{ + */ + +/** + * @brief The Microservice client. + * + * Initialize with #micro_NewClient and destroy with #microClient_Destroy. + * + * @see micro_NewClient, microClient_Destroy + */ +typedef struct micro_client_s microClient; + +/** + * @brief The Microservice configuration object. For forward compatibility only. + */ +typedef struct __for_forward_compatibility_only microClientConfig; + +/** + * @brief `microEndpoint` represents a microservice endpoint. + * + * The only place where this struct is used by the user is in callbacks, to + * identify which endpoint was called, or caused an error. + * + * @see microRequestHandler, microErrorHandler, microServiceConfig, + * microEndpointConfig + */ +typedef struct micro_endpoint_s microEndpoint; + +/** + * @brief The Microservice endpoint configuration object. + * + * @see micro_endpoint_config_s for descriptions of the fields, + * micro_service_config_s, microServiceConfig, microService_AddEndpoint, + * microGroup_AddEndpoint + */ +typedef struct micro_endpoint_config_s microEndpointConfig; + +/** + * @brief static information about an endpoint. + * + * microEndpointInfo is returned by microService_GetInfo function, as part of microServiceInfo. It + * is also accessible by sending a `$SRV.INFO.[.]` request to + * the service. See micro_endpoint_info_s for descriptions of the fields. + * + * @see micro_endpoint_info_s, micro_service_info_s, microService_GetInfo + */ +typedef struct micro_endpoint_info_s microEndpointInfo; + +/** + * @brief The Microservice endpoint-level stats struct. + * + * Returned as part of microEndpointStats. See micro_endpoint_stats_s for + * descriptions of the fields. + * + * @see micro_endpoint_stats_s, microServiceStats, microService_GetStats + */ +typedef struct micro_endpoint_stats_s microEndpointStats; + +/** + * @brief the Microservice error object. + * + * This error type is returned by most microservice functions. You can create + * your own custom errors by using #micro_Errorf and wrap existing errors using + * #microError_Wrapf. Errors are heap-allocated and must be freed with either + * #microError_Destroy or by passing it into #microRequest_Respond. + * + * There are no public fields in this struct, use #microError_Code, + * #microError_Status, and #microError_String to get more information about the + * error. + */ +typedef struct micro_error_s microError; + +/** + * @brief a collection of endpoints and other groups, with a + * common prefix to their subjects and names. + * + * It has no other purpose than + * convenience, for organizing endpoint subject space. + */ +typedef struct micro_group_s microGroup; + +/** + * @brief a request received by a microservice endpoint. + * + * @see micro_request_s for descriptions of the fields. + */ +typedef struct micro_request_s microRequest; + +/** + * @brief the main object for a configured microservice. + * + * It can be created with #micro_AddService, and configured by passing a + * microServiceConfig to it. Once no longer needed, a microservice should be + * destroyed with microService_Destroy. + * + * @see micro_AddService, microServiceConfig, microEndpointConfig, + * microService_Destroy, microService_Stop, microService_IsStopped, + * microService_Run + */ +typedef struct micro_service_s microService; + +/** + * @brief The microservice configuration object. + * + * The service is created with a clone of the config and all of its values, so + * the original can be freed or modified after calling #micro_AddService. See + * micro_service_config_s for descriptions of the fields. + * + * @see micro_service_config_s + */ +typedef struct micro_service_config_s microServiceConfig; + +/** + * @brief Information about a running microservice. + * + * microServiceInfo is the struct returned by microService_GetInfo function. It + * is also accessible by sending a `$SRV.INFO.[.]` request to + * the service. See micro_service_info_s for descriptions of the fields. + * + * @see micro_service_info_s, microService_GetInfo + */ +typedef struct micro_service_info_s microServiceInfo; + +/** + * @brief The Microservice service-level stats struct. + * + * @see micro_service_stats_s for descriptions of the fields, + * microService_GetStats + */ +typedef struct micro_service_stats_s microServiceStats; + +/** @} */ // end of microTypes + +/** \defgroup microCallbacks Callbacks + * + * Microservice callbacks. + * @{ + */ + +/** + * @brief Callback type for request processing. + * + * This is the callback that one provides when creating a microservice endpoint. + * The library will invoke this callback for each message arriving to the + * specified subject. + * + * @param req The request object, containing the message and other relevant + * references. + * + * @see microEndpointConfig, micro_endpoint_config_s. + */ +typedef microError *(*microRequestHandler)(microRequest *req); + +/** + * @brief Callback type for async error notifications. + * + * If specified in microServiceConfig, this callback is invoked for internal + * errors (e.g. message delivery failures) related to a microservice. If the + * error is associated with an endpoint, the ep parameter points at the + * endpoint. However, this handler may be invoked for errors happening in + * monitoring subjects, in which case ep is NULL. + * + * The error handler is invoked asynchronously, in a separate theread. + * + * The error handler is not invoked for microservice-level errors that are sent + * back to the client as responses. Note that the error counts in + * microEndpointStats include both internal and service-level errors. + * + * @param m The microservice object. + * @param ep The endpoint object, or NULL if the error is not associated with an + * endpoint. + * @param s The NATS status for the error. + * + * @see microServiceConfig, micro_service_config_s. + */ +typedef void (*microErrorHandler)(microService *m, microEndpoint *ep, natsStatus s); + +/** + * @brief Callback type for `Done` (service stopped) notifications. + * + * If specified in microServiceConfig, this callback is invoked right after the + * service stops. In the C client, this callback is invoked directly from the + * microService_Stop function, in whatever thread is executing it. + * + * @param m The microservice object. + * + * @see microServiceConfig, micro_service_config_s. + */ +typedef void (*microDoneHandler)(microService *m); + +/** @} */ // end of microCallbacks + +/** \defgroup microStructs Public structs + * + * Microservice public structs. + * + * @{ + */ + +/** + * The Microservice endpoint configuration object. + */ +struct micro_endpoint_config_s +{ + /** + * @brief The name of the endpoint. + * + * Used in the service stats to list endpoints by name. Must not be empty. + */ + const char *Name; + + /** + * @brief The NATS subject the endpoint will listen on. + * + * Wildcards are allowed. If `Subject` is empty, it attempts to default to + * `Name`, provided it is a valid subject. + * + * For endpoints added to a group, the subject is automatically prefixed + * with the group's prefix. + */ + const char *Subject; + + /** + * @briefMetadata for the endpoint, a JSON-encoded user-provided object, + * e.g. `{"key":"value"}` + */ + natsMetadata Metadata; + + /** + * @brief The request handler for the endpoint. + */ + microRequestHandler Handler; + + /** + * @brief A user-provided pointer to store with the endpoint + * (state/closure). + */ + void *State; +}; + +/** + * microEndpointInfo is the struct for the endpoint's static metadata. + */ +struct micro_endpoint_info_s +{ + /** + * @brief The name of the service. + */ + const char *Name; + + /** + * @brief The semantic version of the service. + */ + const char *Subject; + + /** + * @briefMetadata for the endpoint, a JSON-encoded user-provided object, + * e.g. `{"key":"value"}` + */ + natsMetadata Metadata; +}; + +/** + * The Microservice endpoint stats struct. + */ +struct micro_endpoint_stats_s +{ + const char *Name; + const char *Subject; + + /** + * @brief The number of requests received by the endpoint. + */ + int64_t NumRequests; + + /** + * @brief The number of errors, service-level and internal, associated with + * the endpoint. + */ + int64_t NumErrors; + + /** + * @brief total request processing time (the seconds part). + */ + int64_t ProcessingTimeSeconds; + + /** + * @brief total request processing time (the nanoseconds part). + */ + int64_t ProcessingTimeNanoseconds; + + /** + * @brief average request processing time, in ns. + */ + int64_t AverageProcessingTimeNanoseconds; + + /** + * @brief a copy of the last error message. + */ + char LastErrorString[2048]; +}; + +/** + * @brief The Microservice top-level configuration object. + * + * The service is created with a clone of the config and all of its values, so + * the original can be freed or modified after calling micro_AddService. + */ +struct micro_service_config_s +{ + /** + * @brief The name of the service. + * + * It can be used to compose monitoring messages specific to this service. + */ + const char *Name; + + /** + * @brief The (semantic) version of the service. + */ + const char *Version; + + /** + * @brief The description of the service. + */ + const char *Description; + + /** + * @brief Metadata for the service, a JSON-encoded user-provided object, e.g. `{"key":"value"}` + */ + natsMetadata Metadata; + + /** + * @brief The "main" (aka default) endpoint configuration. + * + * It is the default in that it does not require calling + * microService_AddEndpoint, it is added automatically when creating the + * service. + */ + microEndpointConfig *Endpoint; + + /** + * @brief A custom stats handler. + * + * It will be called to output the service's stats. It replaces the default + * stats handler but can pull the service stats using microService_GetStats + * function, then marshal them itself, as appropriate. + */ + microRequestHandler StatsHandler; + + /** + * @brief An error notification handler. + * + * It will be called asynchonously upon internal errors. It does not get + * called for application-level errors, successfully sent out by the + * microservice. + */ + microErrorHandler ErrHandler; + + /** + * @brief A callback handler for handling the final cleanup `Done` event, + * right before the service is destroyed. + * + * It will be called directly from #microService_Stop method, so it may be + * executed in any of the user threads or in the async callback thread if + * the service stops itself on connection closed or an error event. + */ + microDoneHandler DoneHandler; + + /** + * @brief A user-provided pointer to state data. + * + * A closure that is accessible from the request, stats, and internal event + * handlers. Please note that handlers are invoked on separate threads, + * consider thread-safe mechanisms of accessing the data. + */ + void *State; +}; + +/** + * microServiceInfo is the struct returned by microService_GetInfo function. It + * is also accessible by sending a `$SRV.INFO.[.]` request to + * the service. + */ +struct micro_service_info_s +{ + /** + * @brief Response type. Always `"io.nats.micro.v1.info_response"`. + */ + const char *Type; + + /** + * @brief The name of the service. + */ + const char *Name; + + /** + * @brief The semantic version of the service. + */ + const char *Version; + + /** + * @brief The description of the service. + */ + const char *Description; + + /** + * @brief The ID of the service instance responding to the request. + */ + const char *Id; + + /** + * @brief Metadata for the service, a JSON-encoded user-provided object, e.g. `{"key":"value"}` + */ + natsMetadata Metadata; + + /** + * @brief Endpoints. + */ + microEndpointInfo *Endpoints; + + /** + * @brief The number of endpoints in the `Endpoints` array. + */ + int EndpointsLen; +}; + +/** + * The Microservice stats struct. + */ +struct micro_service_stats_s +{ + /** + * @brief Response type. Always `"io.nats.micro.v1.stats_response"`. + */ + const char *Type; + + /** + * @brief The name of the service. + */ + const char *Name; + + /** + * @brief The semantic version of the service. + */ + const char *Version; + + /** + * @brief The ID of the service instance responding to the request. + */ + const char *Id; + + /** + * @brief The timestamp of when the service was started. + */ + int64_t Started; + + /** + * @brief The stats for each endpoint of the service. + */ + microEndpointStats *Endpoints; + + /** + * @brief The number of endpoints in the `endpoints` array. + */ + int EndpointsLen; +}; + +/** @} */ // end of microStructs + +/** \defgroup microConstants Public constants + * + * Microservice public constants. + * @{ + */ + +/** + * @brief The prefix for all microservice monitoring subjects. + * + * For example, `"$SRV.PING"`. + */ +#define MICRO_API_PREFIX "$SRV" + +/** + * @brief The `type` set in the `$SRV.INFO` responses. + */ +#define MICRO_INFO_RESPONSE_TYPE "io.nats.micro.v1.info_response" + +/** + * @brief For `$SRV.INFO.*` subjects. + */ +#define MICRO_INFO_VERB "INFO" + +/** + * @brief The `type` set in the `$SRV.PING` response. + */ +#define MICRO_PING_RESPONSE_TYPE "io.nats.micro.v1.ping_response" + +/** + * @brief For `$SRV.PING` subjects. + */ +#define MICRO_PING_VERB "PING" + +/** + * @brief The `type` set in the `STATS` response. + */ +#define MICRO_STATS_RESPONSE_TYPE "io.nats.micro.v1.stats_response" + +/** + * @brief The "verb" used in `$SRV.STATS` subjects. + */ +#define MICRO_STATS_VERB "STATS" + +/** + * @brief The response message header used to communicate an erroneous NATS + * status back to the requestor. + */ +#define MICRO_STATUS_HDR "Nats-Status" + +/** + * @brief The response message header used to communicate an error message back + * to the requestor. + */ +#define MICRO_ERROR_HDR "Nats-Service-Error" + +/** + * @brief The response message header used to communicate an integer error code + * back to the requestor. + */ +#define MICRO_ERROR_CODE_HDR "Nats-Service-Error-Code" + +/** @} */ // end of microConstants + +/** \defgroup microFunctions Functions + * + * Microservice functions. + * @{ + */ + +/** \defgroup microServiceFunctions microService + * + * Functions that operate with #microService. + * @{ + */ + +/** @brief Creates and starts a new microservice. + * + * @note The microservice should be destroyed to clean up using + * #microService_Destroy. + * + * @param new_microservice the location where to store the pointer to the new + * #microService object. + * @param nc the #natsConnection the service will use to receive and respond to + * requests. + * @param config a #microServiceConfig object with the configuration of the + * service. See #micro_service_config_s for descriptions of the fields. + * + * @return a #microError if an error occurred. + * + * @see #microService_Destroy, #microService_AddEndpoint, #microServiceConfig, + * #microEndpointConfig + */ +NATS_EXTERN microError * +micro_AddService(microService **new_microservice, natsConnection *nc, microServiceConfig *config); + +/** @brief Adds an endpoint to a microservice and starts listening for messages. + * + * Endpoints are currently destroyed when the service is stopped, there is no + * present way to remove or stop individual endpoints. + * + * @param m the #microService that the endpoint will be added to. + * @param config a #microEndpointConfig object with the configuration of the + * endpoint. See #micro_endpoint_config_s for descriptions of the fields. + * + * @return a #microError if an error occurred. + * + * @see #microService_Destroy, #microEndpointConfig + */ +NATS_EXTERN microError * +microService_AddEndpoint(microService *m, microEndpointConfig *config); + +/** @brief Adds an group (prefix) to a microservice. + * + * Groups are associated with a service, and are destroyed when the service is + * destroyed. + * + * @param new_group the location where to store the pointer to the new + * #microGroup object. + * @param m the #microService that the group will be added to. + * @param prefix a prefix to use on names and subjects of all endpoints in the + * group. + * + * @return a #microError if an error occurred. + * + * @see #microGroup_AddGroup, #microGroup_AddEndpoint + */ +NATS_EXTERN microError * +microService_AddGroup(microGroup **new_group, microService *m, const char *prefix); + +/** @brief Destroys a microservice, stopping it first if needed. + * + * @note This function may fail while stopping the service, do not assume + * unconditional success if clean up is important. + * + * @param m the #microService to stop and destroy. + * + * @return a #microError if an error occurred. + * + * @see #microService_Stop, #microService_Run + */ +NATS_EXTERN microError * +microService_Destroy(microService *m); + +/** @brief Returns the connection associated with the service. If the service + * was successfully started, it is safe to assume it's not NULL, however it may + * already have been disconnected or closed. + * + * @param m the #microService. + * + * @return a #natsConnection associated with the service. + */ +NATS_EXTERN natsConnection * +microService_GetConnection(microService *m); + +/** @brief Returns a #microServiceInfo for a microservice. + * + * @note the #microServiceInfo struct returned by this call should be freed with + * #microServiceInfo_Destroy. + * + * @param new_info receives the pointer to the #microServiceInfo. + * @param m the #microService to query. + * + * @return a #microError if an error occurred. + * + * @see #microServiceInfo, #micro_service_info_s + */ +NATS_EXTERN microError * +microService_GetInfo(microServiceInfo **new_info, microService *m); + +/** @brief Returns the pointer to state data (closure). It is originally + * provided in #microServiceConfig.State. + * + * @param m the #microService. + * + * @return the state pointer. + * + * @see #microServiceConfig + */ +NATS_EXTERN void * +microService_GetState(microService *m); + +/** @brief Returns run-time statistics for a microservice. + * + * @note the #microServiceStats struct returned by this call should be freed + * with #microServiceStats_Destroy. + * + * @param new_stats receives the pointer to the #microServiceStats. + * @param m the #microService to query. + * + * @return a #microError if an error occurred. + * + * @see #microServiceStats, #micro_service_stats_s + */ +NATS_EXTERN microError * +microService_GetStats(microServiceStats **new_stats, microService *m); + +/** @brief Checks if the service is stopped. + * + * @param m the #microService. + * + * @return `true` if stopped, otherwise `false`. + * + * @see #micro_AddService, #microService_Stop, #microService_Run + */ +NATS_EXTERN bool +microService_IsStopped(microService *m); + +/** @brief Waits for a microservice to stop. + * + * #micro_AddService starts the service with async subscriptions. + * #microService_Run waits for the service to stop. + * + * @param m the #microService. + * + * @return a #microError for invalid arguments, otherwise always succeeds. + * + * @see #micro_AddService, #microService_Stop + */ +NATS_EXTERN microError * +microService_Run(microService *m); + +/** @brief Stops a running microservice. + * + * Drains and closes the all subscriptions (endpoints and monitoring), resets + * the stats, and calls the `Done` callback for the service, so it can do its + * own clean up if needed. + * + * It is possible that this call encounters an error while stopping the service, + * in which case it aborts and returns the error. The service then may be in a + * partially stopped state, and the `Done` callback will not have been called. + * + * @param m the #microService. + * + * @return a #microError if an error occurred. + * + * @see #micro_AddService, #microService_Run + */ +NATS_EXTERN microError *microService_Stop(microService *m); + +/** @} */ // end of microServiceFunctions + +/** \defgroup microGroupFunctions microGroup + * + * Functions that operate with #microGroup. + * @{ + */ + +/** @brief Adds a sub-group to #microGroup. + * + * The new subgroup will be prefixed as "parent_prefix.prefix.". Groups are + * associated with a service, and are destroyed when the service is destroyed. + * + * @param new_group the location where to store the pointer to the new + * #microGroup object. + * @param parent the #microGroup that the new group will be added to. + * @param prefix a prefix to use on names and subjects of all endpoints in the + * group. + * + * @return a #microError if an error occurred. + * + * @see #microGroup_AddGroup, #microGroup_AddEndpoint + */ +NATS_EXTERN microError * +microGroup_AddGroup(microGroup **new_group, microGroup *parent, const char *prefix); + +/** @brief Adds an endpoint to a #microGroup and starts listening for messages. + * + * This is a convenience method to add an endpoint with its `Subject` and `Name` + * prefixed with the group's prefix. + * + * @param g the #microGroup that the endpoint will be added to. + * @param config a #microEndpointConfig object with the configuration of the + * endpoint. See #micro_endpoint_config_s for descriptions of the fields. + * + * @return a #microError if an error occurred. + * + * @see #microService_Destroy, #microService_AddEndpoint, #microEndpointConfig + */ +NATS_EXTERN microError * +microGroup_AddEndpoint(microGroup *g, microEndpointConfig *config); + +/** @} */ // end of microGroupFunctions + +/** \defgroup microRequestFunctions microRequest + * + * Functions that operate with #microRequest. + * @{ + */ + +/** @brief Adds a header to the underlying NATS request message. + * + * @param req the request. + * @param key the key under which the `value` will be stored. It can't ne `NULL` + * or empty. + * @param value the string to add to the values associated with the given `key`. + * The value can be `NULL` or empty string. + * + * @return a #microError if an error occurred. + * + * @see #natsMsgHeader_Add, #microRequest_DeleteHeader, #microRequest_GetHeaderKeys, + * #microRequest_GetHeaderValue, #microRequest_GetHeaderValues + */ +NATS_EXTERN microError * +microRequest_AddHeader(microRequest *req, const char *key, const char *value); + +/** @brief Deletes a header from the underlying NATS request message. + * + * @param req the request. + * @param key the key to delete from the headers map. + * + * @return a #microError if an error occurred. + * + * @see #natsMsgHeader_Delete, #microRequest_AddHeader + */ +NATS_EXTERN microError * +microRequest_DeleteHeader(microRequest *req, const char *key); + +/** @brief Returns the connection associated with the request. + * + * @param req the request. + * + * @return a #natsConnection associated with the request. In fact, it's the + * connection associated with the service, so by the time the request handler is + * invoked the connection state may be different from when it was received. + */ +NATS_EXTERN natsConnection * +microRequest_GetConnection(microRequest *req); + +/** @brief Returns the data in the the request, as a byte array. + * + * @note The request owns the data, so it should not be freed other than with + * `microRequest_Destroy`. + * @note The data is not `NULL` terminated. Use `microRequest_GetDataLength` to + * obtain the number of bytes. + * + * @param req the request. + * + * @return a pointer to the request's data. + * + * @see #natsMsg_GetData, #microRequest_GetDataLength + */ +NATS_EXTERN const char * +microRequest_GetData(microRequest *req); + +/** @brief Returns the number of data bytes in the the request. + * + * @param req the request. + * + * @return the number of data bytes in the request. + * + * @see #natsMsg_GetDataLength, #microRequest_GetData + */ +NATS_EXTERN int +microRequest_GetDataLength(microRequest *req); + +/** \brief Returns the pointer to the user-provided endpoint state, if + * the request is associated with an endpoint. + * + * @param req the request. + * + * @return the `state` pointer provided in microEndpointConfig. + * + * @see #microEndpointConfig, #micro_endpoint_config_s + */ +NATS_EXTERN void * +microRequest_GetEndpointState(microRequest *req); + +/** @brief Gets the list of all header keys in the NATS message underlying the + * request. + * + * The returned strings are own by the library and MUST not be freed or altered. + * However, the returned array `keys` MUST be freed by the user. + * + * @param req the request. + * @param keys the memory location where the library will store the pointer to + * the array of keys. + * @param count the memory location where the library will store the number of + * keys returned. + * + * @return a #microError if an error occurred. + * + * @see #natsMsgHeader_Keys, #microRequest_GetHeaderValue, #microRequest_GetHeaderValues + */ +NATS_EXTERN microError * +microRequest_GetHeaderKeys(microRequest *req, const char ***keys, int *count); + +/** @brief Get the header entry associated with `key` from the NATS message underlying the request. + * + * @param req the request. + * @param key the key for which the value is requested. + * @param value the memory location where the library will store the pointer to the first + * value (if more than one is found) associated with the `key`. + * + * @return a #microError if an error occurred. + * + * @see #natsMsgHeader_Get, #microRequest_GetHeaderValue, #microRequest_GetHeaderValues + */ +NATS_EXTERN microError * +microRequest_GetHeaderValue(microRequest *req, const char *key, const char **value); + +/** @brief Get all header values associated with `key` from the NATS message + * underlying the request. + * + * @param req the request. + * @param key the key for which the values are requested. + * @param values the memory location where the library will store the pointer to + * the array value (if more than one is found) associated with the `key`. + * @param count the memory location where the library will store the number of + * values returned. + * + * @return a #microError if an error occurred. + * + * @see #natsMsgHeader_Values, #microRequest_GetHeaderValue, + * #microRequest_GetHeaderKeys + */ +NATS_EXTERN microError * +microRequest_GetHeaderValues(microRequest *req, const char *key, const char ***values, int *count); + +/** @brief Get the NATS message underlying the request. + * + * @param req the request. + * + * @return the pointer to #natsMsg. + */ +NATS_EXTERN natsMsg * +microRequest_GetMsg(microRequest *req); + +/** @brief Returns the reply subject set in this message. + * + * Returns the reply, possibly `NULL`. + * + * @warning The string belongs to the message and must not be freed. + * Copy it if needed. + * + * @param req the request. + */ +NATS_EXTERN const char * +microRequest_GetReply(microRequest *req); + +/** @brief Returns the pointer to the microservice associated with the request. + * + * @param req the request. + * + * @return the microservice pointer. + */ +NATS_EXTERN microService * +microRequest_GetService(microRequest *req); + +/** @brief Returns the pointer to the user-provided service state. + * + * @param req the request. + * + * @return the `state` pointer provided in microServiceConfig. + * + * @see #microServiceConfig, #micro_service_config_s + */ +NATS_EXTERN void * +microRequest_GetServiceState(microRequest *req); + +/** @brief Returns the subject of the request message. + * + * @warning The string belongs to the message and must not be freed. + * Copy it if needed. + * + * @param req the request. + */ +NATS_EXTERN const char * +microRequest_GetSubject(microRequest *req); + +/** + * @brief Respond to a request, on the same NATS connection. + * + * @param req the request. + * @param data the response data. + * @param len the length of the response data. + * + * @return an error, if any. + */ +NATS_EXTERN microError * +microRequest_Respond(microRequest *req, const char *data, size_t len); + +/** + * @brief Respond to a request with a simple error. + * + * If err is NULL, `RespondError` does nothing. + * + * @note microRequest_RespondError is called automatially if the handler returns + * an error. Usually, there is no need for a handler to use this function + * directly. If the request + * + * @param req the request. + * @param err the error to include in the response header. If `NULL`, no error. + * + * @return an error, if any. + */ +NATS_EXTERN microError * +microRequest_RespondError(microRequest *req, microError *err); + +/** + * @brief Respond to a message, with an OK or an error. + * + * If err is NULL, `RespondErrorWithData` is equivalent to `Respond`. If err is + * not NULL, the response will include the error in the response header, and err + * will be freed. + * + * The following example illustrates idiomatic usage in a request handler. Since + * this handler handles its own error responses, the only error it might return + * would be a failure to send the response. + * + * \code{.c} + * err = somefunc(); + * if (err != NULL) { + * return microRequest_RespondCustom(req, err, error_data, data_len); + * } + * ... + * \endcode + * + * Or, if the request handler has its own cleanup logic: + * + * \code{.c} + * if (err = somefunc(), err != NULL) + * goto CLEANUP; + * ... + * + * CLEANUP: + * if (err != NULL) { + * return microRequest_RespondCustom(req, err, error_data, data_len); + * } + * return NULL; + * \endcode + * + * @param req the request. + * @param err the error to include in the response header. If `NULL`, no error. + * @param data the response data. + * @param len the length of the response data. + * + * @note + * + * + * @return an error, if any. + */ +NATS_EXTERN microError * +microRequest_RespondCustom(microRequest *req, microError *err, const char *data, size_t len); + +/** @brief Add `value` to the header associated with `key` in the NATS message + * underlying the request. + * + * @param req the request. + * @param key the key under which the `value` will be stored. It can't ne `NULL` + * or empty. + * @param value the string to store under the given `key`. The value can be + * `NULL` or empty string. + * + * @return a #microError if an error occurred. + * + * @see #natsMsgHeader_Set + */ +NATS_EXTERN microError * +microRequest_SetHeader(microRequest *req, const char *key, const char *value); + +/** @} */ // end of microRequestFunctions + +/** \defgroup microErrorFunctions microError + * + * Functions that create and manipulate #microError. + * @{ + */ + +/** @brief creates a new #microError, with a printf-like formatted message. + * + * @note Errors must be freed with #microError_Destroy, but often they are + * simply returned up the call stack. + * + * @param format printf-like format. + * + * @return a new #microError or micro_ErrorOutOfMemory. + */ +NATS_EXTERN microError * +micro_Errorf(const char *format, ...); + +/** @brief creates a new #microError, with a code and a printf-like formatted + * message. + * + * @note Errors must be freed with #microError_Destroy, but often they are + * simply returned up the call stack. + * + * @param code an `int` code, loosely modeled after the HTTP status code. + * @param format printf-like format. + * + * @return a new #microError or micro_ErrorOutOfMemory. + */ +NATS_EXTERN microError * +micro_ErrorfCode(int code, const char *format, ...); + +/** @brief Wraps a NATS status into a #microError, if not a NATS_OK. + * + * @param s NATS status of receiving the response. + * + * @return a new #microError or `NULL` if no error if found. + */ +NATS_EXTERN microError * +micro_ErrorFromStatus(natsStatus s); + +/** @brief returns the int code of the error. + * + * @param err the error. + * + * @return the int code. + */ +NATS_EXTERN int +microError_Code(microError *err); + +/** @brief destroys a #microError. + * + * @param err the error. + */ +NATS_EXTERN void +microError_Destroy(microError *err); + +#define microError_Ignore(__err) microError_Destroy(__err) + +/** + * @brief Returns the NATS status associated with the error. + * + * @param err + * + * @return the status + */ +NATS_EXTERN natsStatus +microError_Status(microError *err); + +/** + * @brief Returns a printable string with the error message. + * + * This function outputs into a user-provided buffer, and returns a "`%s`-able" + * pointer to it. + * + * @param err the error. + * @param buf the output buffer. + * @param len the capacity of the output buffer. + * @return `buf` + */ +NATS_EXTERN const char * +microError_String(microError *err, char *buf, size_t len); + +/** + * @brief Wraps an exising #microError with a higher printf-like formatted + * message. + * + * @warning The original error may be freed and should not be refered to after + * having been wrapped. + * + * @param err the original error + * @param format the new message to prepend to the original error message. + * @param ... + * + * @return a new, wrapped, error. + */ +NATS_EXTERN microError * +microError_Wrapf(microError *err, const char *format, ...); + +/** @} */ // end of microErrorFunctions + +/** \defgroup microClientFunctions microClient + * + * @{ + */ + +/** + * @brief Creates a new microservice client. + * + * @param new_client received the pointer to the new client. + * @param nc a NATS connection. + * @param cfg for future use, use NULL for now. + * + * @return a #microError if an error occurred. + */ +NATS_EXTERN microError * +micro_NewClient(microClient **new_client, natsConnection *nc, microClientConfig *cfg); + +/** + * @brief Destroys a microservice client. + * + * @param client the client to destroy. + */ +NATS_EXTERN void +microClient_Destroy(microClient *client); + +/** + * @brief Sends a request to a microservice and receives the response. + * + * @param reply receives the pointer to the response NATS message. `reply` must + * be freed with #natsMsg_Destroy. + * @param client the client to use. + * @param subject the subject to send the request on. + * @param data the request data. + * @param data_len the request data length. + * + * @return a #microError if an error occurred. + */ +NATS_EXTERN microError * +microClient_DoRequest(natsMsg **reply, microClient *client, const char *subject, const char *data, int data_len); + +/** @} */ // end of microClientFunctions + +/** \defgroup microCleanupFunctions Miscellaneous + * + * Functions to destroy miscellaneous objects. + * @{ + */ + +/** + * @brief Destroys a #microServiceInfo object. + * + * @param info the object to destroy. + */ +NATS_EXTERN void +microServiceInfo_Destroy(microServiceInfo *info); + +/** + * @brief Destroys a #microServiceStats object. + * + * @param stats the object to destroy. + */ +NATS_EXTERN void +microServiceStats_Destroy(microServiceStats *stats); + +/** @} */ // end of microCleanupFunctions + +/** @} */ // end of microFunctions + +/** @} */ // end of microGroup + /** \defgroup wildcardsGroup Wildcards * @{ * Use of wildcards. There are two type of wildcards: `*` for partial, diff --git a/deps/nats.c/src/natsp.h b/deps/nats.c/src/natsp.h index c98bbb2..662fe9e 100644 --- a/deps/nats.c/src/natsp.h +++ b/deps/nats.c/src/natsp.h @@ -103,6 +103,17 @@ #define MAX_FRAMES (50) #define nats_IsStringEmpty(s) ((((s) == NULL) || ((s)[0] == '\0')) ? true : false) +#define nats_HasPrefix(_s, _prefix) (nats_IsStringEmpty(_s) ? nats_IsStringEmpty(_prefix) : (strncmp((_s), (_prefix), strlen(_prefix)) == 0)) + +static inline bool nats_StringEquals(const char *s1, const char *s2) +{ + if (s1 == NULL) + return (s2 == NULL); + if (s2 == NULL) + return false; + + return strcmp(s1, s2); +} #define DUP_STRING(s, s1, s2) \ { \ @@ -247,6 +258,9 @@ struct __natsOptions natsErrHandler asyncErrCb; void *asyncErrCbClosure; + natsConnectionHandler microClosedCb; + natsErrHandler microAsyncErrCb; + int64_t pingInterval; int maxPingsOut; int maxPendingMsgs; @@ -793,6 +807,18 @@ natsLib_getMsgDeliveryPoolInfo(int *maxSize, int *size, int *idx, natsMsgDlvWork void nats_setNATSThreadKey(void); +natsStatus +natsLib_startServiceCallbacks(microService *m); + +void +natsLib_stopServiceCallbacks(microService *m); + +natsMutex* +natsLib_getServiceCallbackMutex(void); + +natsHash* +natsLib_getAllServicesToCallback(void); + // // Threads // diff --git a/deps/nats.c/src/opts.c b/deps/nats.c/src/opts.c index ec730fb..8955d8d 100644 --- a/deps/nats.c/src/opts.c +++ b/deps/nats.c/src/opts.c @@ -914,6 +914,19 @@ natsOptions_SetClosedCB(natsOptions *opts, natsConnectionHandler closedCb, return NATS_OK; } +natsStatus +natsOptions_setMicroCallbacks(natsOptions *opts, natsConnectionHandler closed, natsErrHandler errHandler) +{ + LOCK_AND_CHECK_OPTIONS(opts, 0); + + opts->microClosedCb = closed; + opts->microAsyncErrCb = errHandler; + + UNLOCK_OPTS(opts); + + return NATS_OK; +} + natsStatus natsOptions_SetDisconnectedCB(natsOptions *opts, natsConnectionHandler disconnectedCb, diff --git a/deps/nats.c/src/opts.h b/deps/nats.c/src/opts.h index 3ee87e3..3955634 100644 --- a/deps/nats.c/src/opts.h +++ b/deps/nats.c/src/opts.h @@ -16,6 +16,16 @@ #include "natsp.h" +static inline void natsOptions_lock(natsOptions *opts) +{ + natsMutex_Lock(opts->mu); +} + +static inline void natsOptions_unlock(natsOptions *opts) +{ + natsMutex_Unlock(opts->mu); +} + #define LOCK_AND_CHECK_OPTIONS(o, c) \ if (((o) == NULL) || ((c))) \ return nats_setDefaultError(NATS_INVALID_ARG); \ @@ -38,4 +48,7 @@ natsOptions* natsOptions_clone(natsOptions *opts); +natsStatus +natsOptions_setMicroCallbacks(natsOptions *opts, natsConnectionHandler closedCb, natsErrHandler errCb); + #endif /* OPTS_H_ */ diff --git a/deps/nats.c/src/pub.c b/deps/nats.c/src/pub.c index 5a563bf..c865fb2 100644 --- a/deps/nats.c/src/pub.c +++ b/deps/nats.c/src/pub.c @@ -104,7 +104,11 @@ natsConn_publish(natsConnection *nc, natsMsg *msg, const char *reply, bool direc // accessing the headers. It should still be considered having headers. if ((msg->headers != NULL) || natsMsg_needsLift(msg)) { - if (!nc->info.headers) + // Do the check for server's headers support only after we have completed + // the initial connect (we could be here with initc true - that is, initial + // connect in progress - when using natsOptions_SetRetryOnFailedConnect + // option). + if (!nc->initc && !nc->info.headers) { natsConn_Unlock(nc); diff --git a/deps/nats.c/src/util.c b/deps/nats.c/src/util.c index 350774c..aa4902e 100644 --- a/deps/nats.c/src/util.c +++ b/deps/nats.c/src/util.c @@ -1,4 +1,4 @@ -// Copyright 2015-2021 The NATS Authors +// Copyright 2015-2023 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -2228,9 +2228,155 @@ nats_marshalULong(natsBuffer *buf, bool comma, const char *fieldName, uint64_t u return NATS_UPDATE_ERR_STACK(s); } +// fmtFrac formats the fraction of v/10**prec (e.g., ".12345") into the +// tail of buf, omitting trailing zeros. It omits the decimal +// point too when the fraction is 0. It returns the index where the +// output bytes begin and the value v/10**prec. +static void +fmt_frac(char *buf, int w, uint64_t v, int prec, int *nw, uint64_t *nv) +{ + // Omit trailing zeros up to and including decimal point. + bool print = false; + int i; + int digit; -bool -nats_IsSubjectValid(const char *subject, bool wcAllowed) + for (i = 0; i < prec; i++) + { + digit = v % 10; + print = print || digit != 0; + if (print) + { + w--; + buf[w] = digit + '0'; + } + v /= 10; + } + if (print) + { + w--; + buf[w] = '.'; + } + *nw = w; + *nv = v; +} + +// fmtInt formats v into the tail of buf. +// It returns the index where the output begins. +static int +fmt_int(char *buf, int w, uint64_t v) +{ + if (v == 0) + { + w--; + buf[w] = '0'; + } + else + { + while (v > 0) + { + w--; + buf[w] = v % 10 + '0'; + v /= 10; + } + } + return w; +} + +natsStatus +nats_marshalDuration(natsBuffer *out_buf, bool comma, const char *field_name, int64_t d) +{ + // Largest time is 2540400h10m10.000000000s + char buf[32]; + int w = 32; + bool neg = d < 0; + uint64_t u = (uint64_t) (neg ? -d : d); + int prec; + natsStatus s = NATS_OK; + const char *start = (comma ? ",\"" : "\""); + + if (u < 1000000000) + { + // Special case: if duration is smaller than a second, + // use smaller units, like 1.2ms + w--; + buf[w] = 's'; + w--; + if (u == 0) + { + s = natsBuf_Append(out_buf, start, -1); + IFOK(s, natsBuf_Append(out_buf, field_name, -1)); + IFOK(s, natsBuf_Append(out_buf, "\":\"0s\"", -1)); + return NATS_UPDATE_ERR_STACK(s); + } + else if (u < 1000) + { + // print nanoseconds + prec = 0; + buf[w] = 'n'; + } + else if (u < 1000000) + { + // print microseconds + prec = 3; + // U+00B5 'µ' micro sign == 0xC2 0xB5 (in reverse?) + buf[w] = '\xB5'; + w--; // Need room for two bytes. + buf[w] = '\xC2'; + } + else + { + // print milliseconds + prec = 6; + buf[w] = 'm'; + } + fmt_frac(buf, w, u, prec, &w, &u); + w = fmt_int(buf, w, u); + } + else + { + w--; + buf[w] = 's'; + + fmt_frac(buf, w, u, 9, &w, &u); + + // u is now integer seconds + w = fmt_int(buf, w, u % 60); + u /= 60; + + // u is now integer minutes + if (u > 0) + { + w--; + buf[w] = 'm'; + w = fmt_int(buf, w, u % 60); + u /= 60; + + // u is now integer hours + // Stop at hours because days can be different lengths. + if (u > 0) + { + w--; + buf[w] = 'h'; + w = fmt_int(buf, w, u); + } + } + } + + if (neg) + { + w--; + buf[w] = '-'; + } + + s = natsBuf_Append(out_buf, start, -1); + IFOK(s, natsBuf_Append(out_buf, field_name, -1)); + IFOK(s, natsBuf_Append(out_buf, "\":\"", -1)); + IFOK(s, natsBuf_Append(out_buf, buf + w, sizeof(buf) - w)); + IFOK(s, natsBuf_Append(out_buf, "\"", -1)); + return NATS_UPDATE_ERR_STACK(s); +} + +bool nats_IsSubjectValid(const char *subject, bool wcAllowed) { int i = 0; int len = 0; @@ -2282,3 +2428,130 @@ nats_IsSubjectValid(const char *subject, bool wcAllowed) } return true; } + +natsStatus +nats_marshalMetadata(natsBuffer *buf, bool comma, const char *fieldName, natsMetadata md) +{ + natsStatus s = NATS_OK; + int i; + const char *start = (comma ? ",\"" : "\""); + + if (md.Count <= 0) + return NATS_OK; + + IFOK(s, natsBuf_Append(buf, start, -1)); + IFOK(s, natsBuf_Append(buf, fieldName, -1)); + IFOK(s, natsBuf_Append(buf, "\":{", 3)); + for (i = 0; (s == NATS_OK) && (i < md.Count); i++) + { + IFOK(s, natsBuf_AppendByte(buf, '"')); + IFOK(s, natsBuf_Append(buf, md.List[i * 2], -1)); + IFOK(s, natsBuf_Append(buf, "\":\"", 3)); + IFOK(s, natsBuf_Append(buf, md.List[i * 2 + 1], -1)); + IFOK(s, natsBuf_AppendByte(buf, '"')); + + if (i != md.Count - 1) + IFOK(s, natsBuf_AppendByte(buf, ',')); + } + IFOK(s, natsBuf_AppendByte(buf, '}')); + return NATS_OK; +} + +static natsStatus +_addMD(void *closure, const char *fieldName, nats_JSONField *f) +{ + natsMetadata *md = (natsMetadata *)closure; + + char *name = NATS_STRDUP(fieldName); + char *value = NATS_STRDUP(f->value.vstr); + if ((name == NULL) || (value == NULL)) + { + NATS_FREE(name); + NATS_FREE(value); + return nats_setDefaultError(NATS_NO_MEMORY); + } + + md->List[md->Count * 2] = name; + md->List[md->Count * 2 + 1] = value; + md->Count++; + return NATS_OK; +} + +natsStatus +nats_unmarshalMetadata(nats_JSON *json, const char *fieldName, natsMetadata *md) +{ + natsStatus s = NATS_OK; + nats_JSON *mdJSON = NULL; + int n; + + md->List = NULL; + md->Count = 0; + if (json == NULL) + return NATS_OK; + + s = nats_JSONGetObject(json, fieldName, &mdJSON); + if ((s != NATS_OK) || (mdJSON == NULL)) + return NATS_OK; + + n = natsStrHash_Count(mdJSON->fields); + md->List = NATS_CALLOC(n * 2, sizeof(char *)); + if (md->List == NULL) + s = nats_setDefaultError(NATS_NO_MEMORY); + IFOK(s, nats_JSONRange(mdJSON, TYPE_STR, 0, _addMD, md)); + + return s; +} + +natsStatus +nats_cloneMetadata(natsMetadata *clone, natsMetadata md) +{ + natsStatus s = NATS_OK; + int i = 0; + int n; + char **list = NULL; + + clone->Count = 0; + clone->List = NULL; + if (md.Count == 0) + return NATS_OK; + + n = md.Count * 2; + list = NATS_CALLOC(n, sizeof(char *)); + if (list == NULL) + s = nats_setDefaultError(NATS_NO_MEMORY); + + for (i = 0; (s == NATS_OK) && (i < n); i++) + { + list[i] = NATS_STRDUP(md.List[i]); + if (list[i] == NULL) + s = nats_setDefaultError(NATS_NO_MEMORY); + } + + if (s == NATS_OK) + { + clone->List = (const char **)list; + clone->Count = md.Count; + } + else + { + for (n = i, i = 0; i < n; i++) + NATS_FREE(list[i]); + NATS_FREE(list); + } + return s; +} + +void +nats_freeMetadata(natsMetadata *md) +{ + if (md == NULL) + return; + + for (int i = 0; i < md->Count * 2; i++) + { + NATS_FREE((char *)md->List[i]); + } + NATS_FREE(md->List); + md->List = NULL; + md->Count = 0; +} diff --git a/deps/nats.c/src/util.h b/deps/nats.c/src/util.h index d8a3f3b..127bce0 100644 --- a/deps/nats.c/src/util.h +++ b/deps/nats.c/src/util.h @@ -1,4 +1,4 @@ -// Copyright 2015-2021 The NATS Authors +// Copyright 2015-2023 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -15,6 +15,7 @@ #define UTIL_H_ #include "natsp.h" +#include "mem.h" #define JSON_MAX_NEXTED 100 @@ -45,7 +46,6 @@ typedef struct { char *str; natsStrHash *fields; - } nats_JSON; typedef struct @@ -240,6 +240,21 @@ nats_marshalLong(natsBuffer *buf, bool comma, const char *fieldName, int64_t lva natsStatus nats_marshalULong(natsBuffer *buf, bool comma, const char *fieldName, uint64_t uval); +natsStatus +nats_marshalDuration(natsBuffer *out_buf, bool comma, const char *field_name, int64_t d); + +natsStatus +nats_marshalMetadata(natsBuffer *buf, bool comma, const char *fieldName, natsMetadata md); + +natsStatus +nats_unmarshalMetadata(nats_JSON *json, const char *fieldName, natsMetadata *md); + +natsStatus +nats_cloneMetadata(natsMetadata *clone, natsMetadata md); + +void +nats_freeMetadata(natsMetadata *md); + bool nats_IsSubjectValid(const char *subject, bool wcAllowed); diff --git a/deps/nats.c/src/version.h b/deps/nats.c/src/version.h index d993ef7..69690ed 100644 --- a/deps/nats.c/src/version.h +++ b/deps/nats.c/src/version.h @@ -22,16 +22,16 @@ extern "C" { #endif #define NATS_VERSION_MAJOR 3 -#define NATS_VERSION_MINOR 6 -#define NATS_VERSION_PATCH 1 +#define NATS_VERSION_MINOR 7 +#define NATS_VERSION_PATCH 0 -#define NATS_VERSION_STRING "3.6.1" +#define NATS_VERSION_STRING "3.7.0" #define NATS_VERSION_NUMBER ((NATS_VERSION_MAJOR << 16) | \ (NATS_VERSION_MINOR << 8) | \ NATS_VERSION_PATCH) -#define NATS_VERSION_REQUIRED_NUMBER 0x030600 +#define NATS_VERSION_REQUIRED_NUMBER 0x030700 #ifdef __cplusplus } diff --git a/deps/nats.c/test/list.txt b/deps/nats.c/test/list.txt index 0429b02..4c78d87 100644 --- a/deps/nats.c/test/list.txt +++ b/deps/nats.c/test/list.txt @@ -147,6 +147,7 @@ AsyncSubscriptionPendingDrain SyncSubscriptionPending SyncSubscriptionPendingDrain AsyncErrHandler +AsyncErrHandlerSubDestroyed AsyncSubscriberStarvation AsyncSubscriberOnClose NextMsgCallOnAsyncSub @@ -257,6 +258,14 @@ KeyValueDiscardOldToNew KeyValueRePublish KeyValueMirrorDirectGet KeyValueMirrorCrossDomains +MicroMatchEndpointSubject +MicroAddService +MicroGroups +MicroBasics +MicroStartStop +MicroServiceStopsOnClosedConn +MicroServiceStopsWhenServerStops +MicroAsyncErrorHandler StanPBufAllocator StanConnOptions StanSubOptions diff --git a/deps/nats.c/test/test.c b/deps/nats.c/test/test.c index 7930f0d..1e9ab7d 100644 --- a/deps/nats.c/test/test.c +++ b/deps/nats.c/test/test.c @@ -1,4 +1,4 @@ -// Copyright 2015-2022 The NATS Authors +// Copyright 2015-2023 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -38,6 +38,7 @@ #include "parser.h" #include "js.h" #include "kv.h" +#include "microp.h" #if defined(NATS_HAS_STREAMING) #include "stan/conn.h" #include "stan/pub.h" @@ -118,6 +119,8 @@ struct threadArg int64_t reconnectedAt[4]; int reconnects; bool msgReceived; + int microRunningServiceCount; + bool microAllDone; bool done; int results[10]; const char *tokens[3]; @@ -7422,46 +7425,53 @@ _checkPool(natsConnection *nc, char **expectedURLs, int expectedURLsCount) { int i, j, attempts; natsSrv *srv; - char *url; + char *url = NULL; char buf[64]; - bool ok; + bool ok = false; natsMutex_Lock(nc->mu); - if (nc->srvPool->size != expectedURLsCount) + for (attempts = 0; (!ok) && (attempts < 20); attempts++) { - printf("Expected pool size to be %d, got %d\n", expectedURLsCount, nc->srvPool->size); - natsMutex_Unlock(nc->mu); - return NATS_ERR; - } - for (attempts=0; attempts<20; attempts++) - { - for (i=0; isrvPool->size == expectedURLsCount); + for (i = 0; i < expectedURLsCount; i++) { + bool foundInPool = false; url = expectedURLs[i]; - ok = false; - for (j=0; jsrvPool->size; j++) + for (j = 0; j < nc->srvPool->size; j++) { srv = nc->srvPool->srvrs[j]; snprintf(buf, sizeof(buf), "%s:%d", srv->url->host, srv->url->port); if (strcmp(buf, url)) { - ok = true; + foundInPool = true; break; } } - if (!ok) + if (!foundInPool) { - natsMutex_Unlock(nc->mu); - nats_Sleep(100); - natsMutex_Lock(nc->mu); - continue; + ok = false; + break; } } + + if (ok) + break; + natsMutex_Unlock(nc->mu); - return NATS_OK; + nats_Sleep(100); + natsMutex_Lock(nc->mu); } + + if (!ok) + { + if (nc->srvPool->size != expectedURLsCount) + printf("After 20 retries expected pool size to be %d, got %d\n", expectedURLsCount, nc->srvPool->size); + else if (url != NULL) + printf("After 20 retries did not find %s in pool\n", url); + } + natsMutex_Unlock(nc->mu); - return NATS_ERR; + return ok ? NATS_OK : NATS_ERR; } static natsStatus @@ -9530,6 +9540,8 @@ test_RetryOnFailedConnect(void) int64_t end = 0; natsThread *t = NULL; natsSubscription *sub = NULL; + natsMsg *msg = NULL; + natsMsg *rmsg = NULL; struct threadArg arg; s = _createDefaultThreadArgsForCbTests(&arg); @@ -9555,6 +9567,7 @@ test_RetryOnFailedConnect(void) s = natsConnection_Connect(&nc, opts); end = nats_Now(); testCond(s == NATS_NO_SERVER); + nats_clearLastError(); test("Retried: ") #ifdef _WIN32 @@ -9596,6 +9609,16 @@ test_RetryOnFailedConnect(void) testCond((s == NATS_NOT_YET_CONNECTED) && (nc != NULL)); nats_clearLastError(); + // Request with a message with headers does timeout as opposed to returning + // the NATS_NO_SERVER_SUPPORT error. + test("Request with message with headers: "); + s = natsMsg_Create(&msg, "request.headers", NULL, "hello", 5); + IFOK(s, natsMsgHeader_Set(msg, "some", "header")); + IFOK(s, natsConnection_RequestMsg(&rmsg, nc, msg, 250)); + testCond(s == NATS_TIMEOUT); + nats_clearLastError(); + natsMsg_Destroy(msg); + test("Subscription ok: "); arg.control = 99; s = natsConnection_Subscribe(&sub, nc, "foo", _recvTestString, (void*)&arg); @@ -9660,9 +9683,32 @@ test_RetryOnFailedConnect(void) testCond(s == NATS_OK); natsConnection_Destroy(nc); + nc = NULL; natsOptions_Destroy(opts); + opts = NULL; _destroyDefaultThreadArgs(&arg); + + // Make sure that closing the connection while not connected returns fast + test("Create opts: "); + s = natsOptions_Create(&opts); + IFOK(s, natsOptions_SetRetryOnFailedConnect(opts, true, _connectedCb, NULL)); + IFOK(s, natsOptions_SetURL(opts, "nats://localhost:54321")); + testCond(s == NATS_OK); + + test("Start connect: "); + s = natsConnection_Connect(&nc, opts); + testCond(s == NATS_NOT_YET_CONNECTED); + nats_clearLastError(); + s = NATS_OK; + + test("Close does not take too long: "); + start = nats_Now(); + natsConnection_Close(nc); + testCond(nats_Now()-start <1500); + + natsConnection_Destroy(nc); + natsOptions_Destroy(opts); } static void @@ -14361,6 +14407,132 @@ test_AsyncErrHandler(void) _stopServer(serverPid); } + +static void +_asyncErrBlockingCb(natsConnection *nc, natsSubscription *sub, natsStatus err, void* closure) +{ + struct threadArg *arg = (struct threadArg*) closure; + + natsMutex_Lock(arg->m); + + arg->sum++; + + while ((arg->sum == 1) && !arg->closed) + natsCondition_Wait(arg->c, arg->m); + + if (sub != arg->sub) + arg->status = NATS_ERR; + + if ((arg->status == NATS_OK) && (err != NATS_SLOW_CONSUMER)) + arg->status = NATS_ERR; + + if (arg->status == NATS_OK) + { + // Call some subscription API to make sure that the pointer has not been freed. + arg->current = natsSubscription_IsValid(sub); + } + + arg->done = true; + natsCondition_Signal(arg->c); + + natsMutex_Unlock(arg->m); +} + +static void +test_AsyncErrHandlerSubDestroyed(void) +{ + natsStatus s; + natsConnection *nc = NULL; + natsOptions *opts = NULL; + natsSubscription *sub = NULL; + natsPid serverPid = NATS_INVALID_PID; + natsMsg *msg = NULL; + struct threadArg arg; + + s = _createDefaultThreadArgsForCbTests(&arg); + if (s != NATS_OK) + FAIL("Unable to setup test!"); + + s = natsOptions_Create(&opts); + IFOK(s, natsOptions_SetURL(opts, NATS_DEFAULT_URL)); + IFOK(s, natsOptions_SetMaxPendingMsgs(opts, 1)); + IFOK(s, natsOptions_SetErrorHandler(opts, _asyncErrBlockingCb, (void*) &arg)); + + if (s != NATS_OK) + FAIL("Unable to create options for test AsyncErrHandler"); + + serverPid = _startServer("nats://127.0.0.1:4222", NULL, true); + CHECK_SERVER_STARTED(serverPid); + + test("Connect: "); + s = natsConnection_Connect(&nc, opts); + testCond(s == NATS_OK); + + test("Create sync sub: "); + s = natsConnection_SubscribeSync(&sub, nc, "foo"); + testCond(s == NATS_OK); + + natsMutex_Lock(arg.m); + arg.sub = sub; + arg.current = true; + natsMutex_Unlock(arg.m); + + test("Cause error: "); + s = natsConnection_PublishString(nc, "foo", "msg1"); + IFOK(s, natsConnection_PublishString(nc, "foo", "msg2")); + testCond(s == NATS_OK); + + // Wait a bit to make sure that we have a slow consumer. + nats_Sleep(250); + + test("Next should be error: "); + s = natsSubscription_NextMsg(&msg, sub, 1000); + testCond((s == NATS_SLOW_CONSUMER) && (msg == NULL)); + nats_clearLastError(); + s = NATS_OK; + + test("Consume 1: "); + s = natsSubscription_NextMsg(&msg, sub, 1000); + testCond(s == NATS_OK); + natsMsg_Destroy(msg); + msg = NULL; + + test("Cause error again: "); + s = natsConnection_PublishString(nc, "foo", "msg3"); + IFOK(s, natsConnection_PublishString(nc, "foo", "msg4")); + testCond(s == NATS_OK); + + test("Wait a bit for async error to be posted: "); + nats_Sleep(200); + testCond(true); + + test("Destroy subscription: "); + natsSubscription_Destroy(sub); + testCond(true); + + test("Wait for async error callback to return: "); + natsMutex_Lock(arg.m); + // First unblock the first instance + arg.closed = true; + natsCondition_Signal(arg.c); + // Now wait for the callback to have processed both and be done. + while ((s != NATS_TIMEOUT) && !arg.done) + s = natsCondition_TimedWait(arg.c, arg.m, 2000); + // If ok, arg.current should be false since the subscription should + // not be valid (closed) at the second callback iteration. + if ((s == NATS_OK) && arg.current) + s = NATS_ERR; + natsMutex_Unlock(arg.m); + testCond(s == NATS_OK); + + natsOptions_Destroy(opts); + natsConnection_Destroy(nc); + + _destroyDefaultThreadArgs(&arg); + + _stopServer(serverPid); +} + static void _responseCb(natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure) { @@ -16345,10 +16517,10 @@ test_ReconnectJitter(void) FAIL("Unable to setup test"); test("Default jitter values: "); - natsMutex_Lock(opts->mu); + natsOptions_lock(opts); s = (((opts->reconnectJitter == NATS_OPTS_DEFAULT_RECONNECT_JITTER) && (opts->reconnectJitterTLS == NATS_OPTS_DEFAULT_RECONNECT_JITTER_TLS)) ? NATS_OK : NATS_ERR); - natsMutex_Unlock(opts->mu); + natsOptions_unlock(opts); testCond(s == NATS_OK); s = natsOptions_SetURL(opts, "nats://127.0.0.1:4222"); @@ -20392,7 +20564,7 @@ test_EventLoop(void) test("Close and wait for close cb: "); natsConnection_Close(nc); - _waitForConnClosed(&arg); + s = _waitForConnClosed(&arg); testCond(s == NATS_OK); natsMutex_Lock(arg.m); @@ -21891,15 +22063,40 @@ test_JetStreamUnmarshalStreamConfig(void) json = NULL; test("Stream config with all: "); - if (snprintf(tmp, sizeof(tmp), "{\"name\":\"TEST\",\"description\":\"this is my stream\",\"subjects\":[\"foo\",\"bar\"],"\ - "\"retention\":\"workqueue\",\"max_consumers\":5,\"max_msgs\":10,\"max_bytes\":1000,"\ - "\"max_age\":20000000,\"max_msg_size\":1024,\"max_msgs_per_subject\":1,\"discard\":\"new\",\"storage\":\"memory\","\ - "\"num_replicas\":3,\"no_ack\":true,\"template_owner\":\"owner\","\ - "\"duplicate_window\":100000000000,\"placement\":{\"cluster\":\"cluster\",\"tags\":[\"tag1\",\"tag2\"]},"\ - "\"mirror\":{\"name\":\"TEST2\",\"opt_start_seq\":10,\"filter_subject\":\"foo\",\"external\":{\"api\":\"my_prefix\",\"deliver\":\"deliver_prefix\"}},"\ - "\"sources\":[{\"name\":\"TEST3\",\"opt_start_seq\":20,\"filter_subject\":\"bar\",\"external\":{\"api\":\"my_prefix2\",\"deliver\":\"deliver_prefix2\"}}],"\ - "\"sealed\":true,\"deny_delete\":true,\"deny_purge\":true,\"allow_rollup_hdrs\":true,\"republish\":{\"src\":\"foo\",\"dest\":\"bar\"},"\ - "\"allow_direct\":true,\"mirror_direct\":true}") >= (int) sizeof(tmp)) + if (snprintf(tmp, sizeof(tmp), "{" + "\"name\":\"TEST\"" + ",\"description\":\"this is my stream\"" + ",\"subjects\":[\"foo\",\"bar\"]" + ",\"retention\":\"workqueue\"" + ",\"max_consumers\":5" + ",\"max_msgs\":10" + ",\"max_bytes\":1000" + ",\"max_age\":20000000" + ",\"max_msgs_per_subject\":1" + ",\"max_msg_size\":1024" + ",\"discard\":\"new\"" + ",\"storage\":\"memory\"" + ",\"num_replicas\":3" + ",\"no_ack\":true" + ",\"template_owner\":\"owner\"" + ",\"duplicate_window\":100000000000" + ",\"placement\":{\"cluster\":\"cluster\",\"tags\":[\"tag1\",\"tag2\"]}" + ",\"mirror\":{\"name\":\"TEST2\",\"opt_start_seq\":10,\"filter_subject\":\"foo\",\"external\":{\"api\":\"my_prefix\",\"deliver\":\"deliver_prefix\"}}" + ",\"sources\":[{\"name\":\"TEST3\",\"opt_start_seq\":20,\"filter_subject\":\"bar\",\"external\":{\"api\":\"my_prefix2\",\"deliver\":\"deliver_prefix2\"}}]" + ",\"sealed\":true" + ",\"deny_delete\":true" + ",\"deny_purge\":true" + ",\"allow_rollup_hdrs\":true" + ",\"republish\":{\"src\":\"foo\",\"dest\":\"bar\"}" + ",\"allow_direct\":true" + ",\"mirror_direct\":true" + ",\"discard_new_per_subject\":true" + ",\"metadata\":{\"foo\":\"bar\"}" + ",\"compression\":\"s2\"" + ",\"first_seq\":9999" + ",\"subject_transform\":{\"src\":\"foo\",\"dest\":\"bar\"}" + ",\"consumer_limits\":{\"inactive_threshold\":1000,\"max_ack_pending\":99}" + "}") >= (int) sizeof(tmp)) { abort(); } @@ -21944,7 +22141,19 @@ test_JetStreamUnmarshalStreamConfig(void) && (strcmp(sc->RePublish->Source, "foo") == 0) && (sc->RePublish->Destination != NULL) && (strcmp(sc->RePublish->Destination, "bar") == 0)) - && sc->AllowDirect && sc->MirrorDirect); + && sc->AllowDirect && sc->MirrorDirect + && sc->DiscardNewPerSubject + && (sc->Metadata.Count == 1) + && (sc->Metadata.List != NULL) + && (strcmp(sc->Metadata.List[0], "foo") == 0) + && (strcmp(sc->Metadata.List[1], "bar") == 0) + && (sc->Compression == js_StorageCompressionS2) + && (sc->FirstSeq == 9999) + && (strcmp(sc->SubjectTransform.Source, "foo") == 0) + && (strcmp(sc->SubjectTransform.Destination, "bar") == 0) + && (sc->ConsumerLimits.InactiveThreshold == 1000) + && (sc->ConsumerLimits.MaxAckPending == 99) + ); js_destroyStreamConfig(sc); sc = NULL; nats_JSONDestroy(json); @@ -21957,18 +22166,19 @@ test_JetStreamUnmarshalStreamInfo(void) natsStatus s; nats_JSON *json = NULL; jsStreamInfo *si = NULL; - const char *good[] = { + const char *good[] = { "{\"cluster\":{\"name\":\"S1\",\"leader\":\"S2\"}}", "{\"cluster\":{\"name\":\"S1\",\"leader\":\"S2\",\"replicas\":[{\"name\":\"S1\",\"current\":true,\"offline\":false,\"active\":123,\"lag\":456},{\"name\":\"S1\",\"current\":false,\"offline\":true,\"active\":123,\"lag\":456}]}}", "{\"mirror\":{\"name\":\"M\",\"lag\":123,\"active\":456}}", "{\"mirror\":{\"name\":\"M\",\"external\":{\"api\":\"MyApi\",\"deliver\":\"deliver.prefix\"},\"lag\":123,\"active\":456}}", "{\"sources\":[{\"name\":\"S1\",\"lag\":123,\"active\":456}]}", + "{\"sources\":[{\"name\":\"S1\",\"lag\":123,\"active\":456,\"filter_subject\":\"foo\",\"subject_transforms:\":[{\"src\":\"foo\",\"dest\":\"bar\"}]}]}", "{\"sources\":[{\"name\":\"S1\",\"lag\":123,\"active\":456},{\"name\":\"S2\",\"lag\":123,\"active\":456}]}", "{\"sources\":[{\"name\":\"S1\",\"external\":{\"api\":\"MyApi\",\"deliver\":\"deliver.prefix\"},\"lag\":123,\"active\":456},{\"name\":\"S2\",\"lag\":123,\"active\":456}]}", "{\"alternates\":[{\"name\":\"S1\",\"domain\":\"domain\",\"cluster\":\"abc\"}]}", "{\"alternates\":[{\"name\":\"S1\",\"domain\":\"domain\",\"cluster\":\"abc\"},{\"name\":\"S2\",\"domain\":\"domain\",\"cluster\":\"abc\"}]}", }; - const char *bad[] = { + const char *bad[] = { "{\"config\":123}", "{\"config\":{\"retention\":\"bad_policy\"}}", "{\"config\":{\"discard\":\"bad_policy\"}}", @@ -22156,6 +22366,20 @@ test_JetStreamMarshalStreamConfig(void) rp.HeadersOnly = true; sc.RePublish = &rp; + // 2.10 options: Compression, Metadata, etc. + sc.Compression = js_StorageCompressionS2; + sc.Metadata.List = (const char *[]){"k1", "v1", "k2", "v2"}; + sc.Metadata.Count = 2; + sc.FirstSeq = 9999; + sc.SubjectTransform = (jsSubjectTransformConfig) { + .Source = "foo", + .Destination = "bar", + }; + sc.ConsumerLimits = (jsStreamConsumerLimits) { + .InactiveThreshold = 1000, + .MaxAckPending = 99, + }; + test("Marshal stream config: "); s = js_marshalStreamConfig(&buf, &sc); testCond((s == NATS_OK) && (buf != NULL) && (natsBuf_Len(buf) > 0)); @@ -22225,7 +22449,19 @@ test_JetStreamMarshalStreamConfig(void) && rsc->RePublish->HeadersOnly && rsc->AllowDirect && rsc->MirrorDirect - && rsc->DiscardNewPerSubject); + && rsc->DiscardNewPerSubject + && (rsc->Compression == js_StorageCompressionS2) + && (rsc->Metadata.Count == 2) + && (strcmp(rsc->Metadata.List[0], "k2") == 0) + && (strcmp(rsc->Metadata.List[1], "v2") == 0) + && (strcmp(rsc->Metadata.List[2], "k1") == 0) + && (strcmp(rsc->Metadata.List[3], "v1") == 0) + && (rsc->FirstSeq == 9999) + && (strcmp(rsc->SubjectTransform.Source, "foo") == 0) + && (strcmp(rsc->SubjectTransform.Destination, "bar") == 0) + && (rsc->ConsumerLimits.InactiveThreshold == 1000) + && (rsc->ConsumerLimits.MaxAckPending == 99) + ); js_destroyStreamConfig(rsc); rsc = NULL; // Check that this does not crash @@ -22313,6 +22549,7 @@ test_JetStreamUnmarshalConsumerInfo(void) "{\"config\":{\"num_replicas\":1}}", "{\"config\":{\"mem_storage\":true}}", "{\"config\":{\"name\":\"my_name\"}}", + "{\"config\":{\"name\":\"my_name\",\"metadata\":{\"k1\":\"v1\",\"k2\":\"v2\"}}}", }; const char *bad[] = { "{\"stream_name\":123}", @@ -22995,6 +23232,38 @@ test_JetStreamMgtStreams(void) && ((jerr == 0) || (jerr == JSStreamNameExistErr))); nats_clearLastError(); + if (serverVersionAtLeast(2, 10, 0)) + { + test("Create stream with 2.10 server features: "); + cfg.Name = "TEST210"; + cfg.Subjects = (const char*[]){"foo210"}; + cfg.SubjectsLen = 1; + cfg.Metadata.List = (const char *[]){"k1", "v1", "k2", "v2"}; + cfg.Metadata.Count = 2; + cfg.Compression = js_StorageCompressionS2; + cfg.FirstSeq = 9999; + cfg.SubjectTransform = (jsSubjectTransformConfig) {.Source = "foo210", .Destination = "bar210"}; + cfg.ConsumerLimits = (jsStreamConsumerLimits) {.InactiveThreshold = 1000, .MaxAckPending = 99}; + + s = js_AddStream(&si, js, &cfg, NULL, &jerr); + + testCond((s == NATS_OK) + && (si != NULL) + && (si->Config != NULL) + && (strcmp(si->Config->Name, "TEST210") == 0) + && (si->Config->Metadata.Count == 2) + && (si->Config->Compression == js_StorageCompressionS2) + && (si->Config->FirstSeq == 9999) + && (strcmp(si->Config->SubjectTransform.Source, "foo210") == 0) + && (strcmp(si->Config->SubjectTransform.Destination, "bar210") == 0) + && (si->Config->ConsumerLimits.InactiveThreshold == 1000) + && (si->Config->ConsumerLimits.MaxAckPending == 99) + && (jerr == 0) + ); + jsStreamInfo_Destroy(si); + si = NULL; + } + jerr = 0; // Reset config jsStreamConfig_Init(&cfg); @@ -23863,6 +24132,9 @@ test_JetStreamMgtConsumers(void) cfg.Heartbeat = 700; cfg.Replicas = 1; cfg.MemoryStorage = true; + cfg.Metadata.List = (const char *[]){"key1", "val1", "key2", "val2"}; + cfg.Metadata.Count = 2; + // We create a consumer with non existing stream, so we // expect this to fail. We are just checking that the config // is properly serialized. @@ -23881,6 +24153,7 @@ test_JetStreamMgtConsumers(void) "\"opt_start_seq\":100,"\ "\"opt_start_time\":\"2021-06-23T18:22:00.12345Z\",\"ack_policy\":\"explicit\","\ "\"ack_wait\":200,\"max_deliver\":300,\"filter_subject\":\"bar\","\ + "\"metadata\":{\"key1\":\"val1\",\"key2\":\"val2\"},"\ "\"replay_policy\":\"instant\",\"rate_limit_bps\":400,"\ "\"sample_freq\":\"60%%\",\"max_waiting\":500,\"max_ack_pending\":600,"\ "\"flow_control\":true,\"idle_heartbeat\":700,"\ @@ -23889,6 +24162,38 @@ test_JetStreamMgtConsumers(void) natsMsg_Destroy(resp); resp = NULL; + if (serverVersionAtLeast(2, 10, 0)) + { + test("Add consumer (non durable, filter subjects): "); + cfg.FilterSubject = NULL; + cfg.FilterSubjects = (const char *[]){"bar1", "bar2"}; + cfg.FilterSubjectsLen = 2; + s = js_AddConsumer(&ci, js, "MY_STREAM", &cfg, NULL, &jerr); + testCond((s = NATS_ERR) && (jerr == JSStreamNotFoundErr) && (ci == NULL)); + nats_clearLastError(); + + test("Verify config: "); + s = natsSubscription_NextMsg(&resp, sub, 1000); + testCond((s == NATS_OK) && (resp != NULL) && (strncmp(natsMsg_GetData(resp), "{\"stream_name\":\"MY_STREAM\"," + "\"config\":{\"deliver_policy\":\"last\"," + "\"description\":\"MyDescription\"," + "\"deliver_subject\":\"foo\"," + "\"opt_start_seq\":100," + "\"opt_start_time\":\"2021-06-23T18:22:00.12345Z\",\"ack_policy\":\"explicit\"," + "\"ack_wait\":200,\"max_deliver\":300,\"filter_subjects\":[\"bar1\",\"bar2\"]," + "\"metadata\":{\"key1\":\"val1\",\"key2\":\"val2\"},"\ + "\"replay_policy\":\"instant\",\"rate_limit_bps\":400," + "\"sample_freq\":\"60%%\",\"max_waiting\":500,\"max_ack_pending\":600," + "\"flow_control\":true,\"idle_heartbeat\":700," + "\"num_replicas\":1,\"mem_storage\":true}}", + natsMsg_GetDataLength(resp)) == 0)); + natsMsg_Destroy(resp); + resp = NULL; + cfg.FilterSubjects = NULL; + cfg.FilterSubjectsLen = 0; + cfg.FilterSubject = "bar"; + } + test("Create check sub: "); natsSubscription_Destroy(sub); sub = NULL; @@ -23912,6 +24217,7 @@ test_JetStreamMgtConsumers(void) "\"opt_start_seq\":100,"\ "\"opt_start_time\":\"2021-06-23T18:22:00.12345Z\",\"ack_policy\":\"explicit\","\ "\"ack_wait\":200,\"max_deliver\":300,\"filter_subject\":\"bar\","\ + "\"metadata\":{\"key1\":\"val1\",\"key2\":\"val2\"},"\ "\"replay_policy\":\"instant\",\"rate_limit_bps\":400,"\ "\"sample_freq\":\"60%%\",\"max_waiting\":500,\"max_ack_pending\":600,"\ "\"flow_control\":true,\"idle_heartbeat\":700,"\ @@ -23947,6 +24253,7 @@ test_JetStreamMgtConsumers(void) "\"opt_start_seq\":100,"\ "\"opt_start_time\":\"2021-06-23T18:22:00.12345Z\",\"ack_policy\":\"explicit\","\ "\"ack_wait\":200,\"max_deliver\":300,\"filter_subject\":\"bar\","\ + "\"metadata\":{\"key1\":\"val1\",\"key2\":\"val2\"},"\ "\"replay_policy\":\"instant\",\"rate_limit_bps\":400,"\ "\"sample_freq\":\"60%%\",\"max_waiting\":500,\"max_ack_pending\":600,"\ "\"flow_control\":true,\"idle_heartbeat\":700,"\ @@ -24183,6 +24490,32 @@ test_JetStreamMgtConsumers(void) jsConsumerInfo_Destroy(ci); ci = NULL; + if (serverVersionAtLeast(2, 10, 0)) + { + test("Update (filter subjects) works ok: "); + cfg.FilterSubject = NULL; + cfg.FilterSubjects = (const char *[]){"bar1", "bar2"}; + cfg.FilterSubjectsLen = 2; + s = js_UpdateConsumer(&ci, js, "MY_STREAM", &cfg, NULL, &jerr); + testCond((s == NATS_OK) && (jerr == 0) && (ci != NULL) && (ci->Config != NULL) + && (strcmp(ci->Config->Description, "my description") == 0) + && (ci->Config->AckWait == NATS_SECONDS_TO_NANOS(2)) + && (ci->Config->MaxDeliver == 1) + && (strcmp(ci->Config->SampleFrequency, "30") == 0) + && (ci->Config->MaxAckPending == 10) + && (ci->Config->HeadersOnly) + && (ci->Config->FilterSubject == NULL) + && (ci->Config->FilterSubjectsLen == 2) + && (ci->Config->FilterSubjects != NULL) + && (strcmp(ci->Config->FilterSubjects[0], "bar1") == 0) + && (strcmp(ci->Config->FilterSubjects[1], "bar2") == 0)); + jsConsumerInfo_Destroy(ci); + ci = NULL; + cfg.FilterSubject = "bar.bat"; + cfg.FilterSubjects = NULL; + cfg.FilterSubjectsLen = 0; + } + test("Add pull consumer: "); jsConsumerConfig_Init(&cfg); cfg.Durable = "update_pull_consumer"; @@ -24494,9 +24827,11 @@ test_JetStreamMgtConsumers(void) cfg.Durable = "B"; cfg.Description = "C"; cfg.FilterSubject = "D"; - cfg.SampleFrequency = "E"; - cfg.DeliverSubject = "F"; - cfg.DeliverGroup = "G"; + cfg.FilterSubjects = (const char*[]){"E", "F"}; + cfg.FilterSubjectsLen = 2; + cfg.SampleFrequency = "G"; + cfg.DeliverSubject = "H"; + cfg.DeliverGroup = "I"; cfg.BackOff = (int64_t[]){NATS_MILLIS_TO_NANOS(50), NATS_MILLIS_TO_NANOS(250)}; cfg.BackOffLen = 2; s = js_cloneConsumerConfig(&cfg, &cloneCfg); @@ -24505,9 +24840,14 @@ test_JetStreamMgtConsumers(void) && (cloneCfg->Durable != NULL) && (strcmp(cloneCfg->Durable, "B") == 0) && (cloneCfg->Description != NULL) && (strcmp(cloneCfg->Description, "C") == 0) && (cloneCfg->FilterSubject != NULL) && (strcmp(cloneCfg->FilterSubject, "D") == 0) - && (cloneCfg->SampleFrequency != NULL) && (strcmp(cloneCfg->SampleFrequency, "E") == 0) - && (cloneCfg->DeliverSubject != NULL) && (strcmp(cloneCfg->DeliverSubject, "F") == 0) - && (cloneCfg->DeliverGroup != NULL) && (strcmp(cloneCfg->DeliverGroup, "G") == 0) + && (cloneCfg->FilterSubject != NULL) && (strcmp(cloneCfg->FilterSubject, "D") == 0) + && (cloneCfg->FilterSubjectsLen == 2) + && (cloneCfg->FilterSubjects != NULL) + && (strcmp(cloneCfg->FilterSubjects[0], "E") == 0) + && (strcmp(cloneCfg->FilterSubjects[1], "F") == 0) + && (cloneCfg->SampleFrequency != NULL) && (strcmp(cloneCfg->SampleFrequency, "G") == 0) + && (cloneCfg->DeliverSubject != NULL) && (strcmp(cloneCfg->DeliverSubject, "H") == 0) + && (cloneCfg->DeliverGroup != NULL) && (strcmp(cloneCfg->DeliverGroup, "I") == 0) && (cloneCfg->BackOffLen == 2) && (cloneCfg->BackOff != NULL) && (cloneCfg->BackOff[0] == NATS_MILLIS_TO_NANOS(50)) @@ -26033,6 +26373,29 @@ test_JetStreamSubscribe(void) && (strstr(nats_GetLastError(NULL), "filter subject") != NULL)); nats_clearLastError(); + if (serverVersionAtLeast(2, 10, 0)) + { + test("Create consumer with multiple filters: "); + jsConsumerConfig_Init(&cc); + cc.Durable = "dur-multi-filter"; + cc.DeliverSubject = "push.dur.sub.2"; + cc.FilterSubjectsLen = 2; + cc.FilterSubjects = (const char *[2]){"sub.1", "sub.2"}; + s = js_AddConsumer(NULL, js, "MULTIPLE_SUBJS", &cc, NULL, &jerr); + testCond((s == NATS_OK) && (jerr == 0)); + + test("Subscribe subj != filters: "); + so.Consumer = "dur-multi-filter"; + s = js_Subscribe(&sub, js, "foo", _jsMsgHandler, &args, NULL, &so, &jerr); + testCond((s == NATS_ERR) && (sub == NULL) + && (strstr(nats_GetLastError(NULL), "filter subject") != NULL)); + nats_clearLastError(); + cc.FilterSubject = "sub.2"; + cc.FilterSubjects = NULL; + cc.FilterSubjectsLen = 0; + so.Consumer = "dur"; + } + test("Subject not required when binding to stream/consumer: "); s = js_Subscribe(&sub, js, NULL, _jsMsgHandler, &args, NULL, &so, &jerr); testCond((s == NATS_OK) && (sub != NULL) && (jerr == 0)); @@ -30314,7 +30677,7 @@ test_KeyValueBasics(void) for (i=0; i", "foo.bar.meh", "true", + "foo.>", "foo.bar.meh", "true", + "foo.b*ar.meh", "foo.bar.meh", NULL, + }; + char buf[1024]; + int i; + const char *ep_subject; + const char *actual_subject; + bool expected_match; + + for (i = 0; i < (int)(sizeof(test_cases) / sizeof(const char *)); i = i + 3) + { + ep_subject = test_cases[i]; + actual_subject = test_cases[i + 1]; + expected_match = (test_cases[i + 2] != NULL); + + snprintf(buf, sizeof(buf), "endpoint subject '%s', actual subject: '%s': ", ep_subject, actual_subject); + test(buf); + testCond(micro_match_endpoint_subject(ep_subject, actual_subject) == expected_match); + } +} + +static microError * +_microHandleRequest42(microRequest *req) +{ + return microRequest_Respond(req, "42", 2); +} + +static microError * +_microHandleRequestNoisy42(microRequest *req) +{ + if ((rand() % 10) == 0) + return micro_Errorf("Unexpected error!"); + + // Happy Path. + // Random delay between 5-10ms + nats_Sleep(5 + (rand() % 5)); + + return microRequest_Respond(req, "42", 2); +} + +static void +_microServiceDoneHandler(microService *m) +{ + struct threadArg *arg = (struct threadArg*) microService_GetState(m); + + natsMutex_Lock(arg->m); + arg->microRunningServiceCount--; + if (arg->microRunningServiceCount == 0) + { + arg->microAllDone = true; + natsCondition_Broadcast(arg->c); + } + natsMutex_Unlock(arg->m); +} + +static microError * +_startMicroservice(microService** new_m, natsConnection *nc, microServiceConfig *cfg, microEndpointConfig **eps, int num_eps, struct threadArg *arg) +{ + microError *err = NULL; + bool prev_done; + int i; + + cfg->DoneHandler = _microServiceDoneHandler; + cfg->State = arg; + + natsMutex_Lock(arg->m); + + arg->microRunningServiceCount++; + prev_done = arg->microAllDone; + arg->microAllDone = false; + + err = micro_AddService(new_m, nc, cfg); + if (err != NULL) + { + arg->microRunningServiceCount--; + arg->microAllDone = prev_done; + } + + natsMutex_Unlock(arg->m); + + if (err != NULL) + return err; + + for (i=0; i < num_eps; i++) + { + err = microService_AddEndpoint(*new_m, eps[i]); + if (err != NULL) + { + microService_Destroy(*new_m); + *new_m = NULL; + return err; + } + } + + return NULL; +} + +static void +_startMicroserviceOK(microService** new_m, natsConnection *nc, microServiceConfig *cfg, microEndpointConfig **eps, int num_eps, struct threadArg *arg) +{ + char buf[64]; + + snprintf(buf, sizeof(buf), "Start microservice %s: ", cfg->Name); + test(buf); + + testCond (NULL == _startMicroservice(new_m, nc, cfg, eps, num_eps, arg)); +} + +static void +_startManyMicroservices(microService** svcs, int n, natsConnection *nc, microServiceConfig *cfg, microEndpointConfig **eps, int num_eps, struct threadArg *arg) +{ + int i; + + for (i = 0; i < n; i++) + { + _startMicroserviceOK(&(svcs[i]), nc, cfg, eps, num_eps, arg); + } + + testCond(true); +} + +static void +_waitForMicroservicesAllDone(struct threadArg *arg) +{ + natsStatus s = NATS_OK; + + test("Wait for all microservices to stop: "); + natsMutex_Lock(arg->m); + while ((s != NATS_TIMEOUT) && !arg->microAllDone) + s = natsCondition_TimedWait(arg->c, arg->m, 1000); + natsMutex_Unlock(arg->m); + testCond((NATS_OK == s) && arg->microAllDone); + + // `Done` may be immediately followed by freeing the service, so wait a bit + // to make sure it happens before the test exits. + nats_Sleep(20); +} + +static void +_destroyMicroservicesAndWaitForAllDone(microService** svcs, int n, struct threadArg *arg) +{ + char buf[64]; + + snprintf(buf, sizeof(buf), "Wait for all %d microservices to stop: ", n); + test(buf); + + for (int i = 0; i < n; i++) + { + if (NULL != microService_Destroy(svcs[i])) + FAIL("Unable to destroy microservice!"); + } + + _waitForMicroservicesAllDone(arg); +} + +typedef struct +{ + const char *name; + microServiceConfig *cfg; + microEndpointConfig **endpoints; + int num_endpoints; + bool null_nc; + bool null_receiver; + const char *expected_err; + int expected_num_subjects; +} add_service_test_case_t; + +static void +test_MicroAddService(void) +{ + natsStatus s = NATS_OK; + microError *err = NULL; + struct threadArg arg; + natsOptions *opts = NULL; + natsConnection *nc = NULL; + natsPid serverPid = NATS_INVALID_PID; + microService *m = NULL; + microServiceInfo *info = NULL; + natsMsg *reply = NULL; + int i, j, n; + char buf[1024]; + char *subject = NULL; + nats_JSON *js = NULL; + nats_JSON **array = NULL; + int array_len; + const char *str; + + microEndpointConfig default_ep_cfg = { + .Name = "default", + .Handler = _microHandleRequestNoisy42, + }; + microEndpointConfig ep1_cfg = { + .Name = "ep1", + .Handler = _microHandleRequestNoisy42, + }; + microEndpointConfig ep2_cfg = { + .Name = "ep2", + .Subject = "different-from-name", + .Handler = _microHandleRequestNoisy42, + }; + microEndpointConfig ep3_cfg = { + .Name = "ep3", + .Handler = _microHandleRequestNoisy42, + }; + microEndpointConfig *all_ep_cfgs[] = {&ep1_cfg, &ep2_cfg, &ep3_cfg}; + + microServiceConfig minimal_cfg = { + .Version = "1.0.0", + .Name = "minimal", + + }; + microServiceConfig full_cfg = { + .Version = "1.0.0", + .Name = "full", + .Endpoint = &default_ep_cfg, + .Description = "fully declared microservice", + }; + microServiceConfig err_no_name_cfg = { + .Version = "1.0.0", + }; + microServiceConfig err_no_version_cfg = { + .Name = "no-version", + }; + microServiceConfig err_invalid_version_cfg = { + .Version = "BLAH42", + .Name = "invalid-version", + }; + + add_service_test_case_t tcs[] = { + { + .name = "Minimal", + .cfg = &minimal_cfg, + }, + { + .name = "Full", + .cfg = &full_cfg, + .expected_num_subjects = 1, + }, + { + .name = "Full-with-endpoints", + .cfg = &full_cfg, + .endpoints = all_ep_cfgs, + .num_endpoints = sizeof(all_ep_cfgs) / sizeof(all_ep_cfgs[0]), + .expected_num_subjects = 4, + }, + { + .name = "Err-null-connection", + .cfg = &minimal_cfg, + .null_nc = true, + .expected_err = "status 16: invalid function argument", + }, + { + .name = "Err-null-receiver", + .cfg = &minimal_cfg, + .null_receiver = true, + .expected_err = "status 16: invalid function argument", + }, + { + .name = "Err-no-name", + .cfg = &err_no_name_cfg, + .expected_err = "status 16: invalid function argument", + }, + { + .name = "Err-no-version", + .cfg = &err_no_version_cfg, + .expected_err = "status 16: invalid function argument", + }, + { + .name = "Err-invalid-version", + .cfg = &err_invalid_version_cfg, + // TODO: validate the version format. + }, + }; + add_service_test_case_t tc; + + srand((unsigned int)nats_NowInNanoSeconds()); + + s = _createDefaultThreadArgsForCbTests(&arg); + if (s == NATS_OK) + opts = _createReconnectOptions(); + if ((opts == NULL) + || (natsOptions_SetClosedCB(opts, _closedCb, &arg) != NATS_OK) + || (natsOptions_SetURL(opts, NATS_DEFAULT_URL) != NATS_OK)) + { + FAIL("Unable to setup test for MicroConnectionEvents!"); + } + + serverPid = _startServer("nats://127.0.0.1:4222", NULL, true); + CHECK_SERVER_STARTED(serverPid); + + test("Connect to server: "); + testCond(NATS_OK == natsConnection_Connect(&nc, opts)); + + for (n = 0; n < (int)(sizeof(tcs) / sizeof(tcs[0])); n++) + { + tc = tcs[n]; + + snprintf(buf, sizeof(buf), "%s: AddService: ", tc.name); + test(buf); + m = NULL; + err = _startMicroservice( + tc.null_receiver ? NULL : &m, + tc.null_nc ? NULL : nc, + tc.cfg, NULL, 0, &arg); + if (nats_IsStringEmpty(tc.expected_err)) + { + testCond(err == NULL); + } + else + { + if (strcmp(tc.expected_err, microError_String(err, buf, sizeof(buf))) != 0) + { + char buf2[2*1024]; + snprintf(buf2, sizeof(buf2), "Expected error '%s', got '%s'", tc.expected_err, buf); + FAIL(buf2); + } + testCond(true); + microError_Destroy(err); + continue; + } + + for (i = 0; i < tc.num_endpoints; i++) + { + snprintf(buf, sizeof(buf), "%s: AddEndpoint '%s': ", tc.name, tc.endpoints[i]->Name); + test(buf); + testCond(NULL == microService_AddEndpoint(m, tc.endpoints[i])); + } + + err = microService_GetInfo(&info, m); + if (err != NULL) + FAIL("failed to get service info!") + + // run through PING and INFO subject variations: 0: all, 1: .name, 2: .name.id + for (j = 0; j < 3; j++) + { + err = micro_new_control_subject(&subject, MICRO_PING_VERB, + (j > 0 ? tc.cfg->Name : NULL), + (j > 1 ? info->Id : NULL)); + if (err != NULL) + FAIL("failed to generate PING subject!"); + + snprintf(buf, sizeof(buf), "%s: Verify PING subject %s: ", tc.name, subject); + test(buf); + s = natsConnection_Request(&reply, nc, subject, NULL, 0, 1000); + IFOK(s, nats_JSONParse(&js, natsMsg_GetData(reply), natsMsg_GetDataLength(reply))); + IFOK(s, nats_JSONGetStrPtr(js, "id", &str)); + IFOK(s, (strcmp(str, info->Id) == 0) ? NATS_OK : NATS_ERR); + IFOK(s, nats_JSONGetStrPtr(js, "name", &str)); + IFOK(s, (strcmp(str, tc.cfg->Name) == 0) ? NATS_OK : NATS_ERR); + IFOK(s, nats_JSONGetStrPtr(js, "version", &str)); + IFOK(s, (strcmp(str, tc.cfg->Version) == 0) ? NATS_OK : NATS_ERR); + IFOK(s, nats_JSONGetStrPtr(js, "type", &str)); + IFOK(s, (strcmp(str, MICRO_PING_RESPONSE_TYPE) == 0) ? NATS_OK : NATS_ERR); + testCond(s == NATS_OK); + nats_JSONDestroy(js); + natsMsg_Destroy(reply); + NATS_FREE(subject); + + err = micro_new_control_subject(&subject, MICRO_INFO_VERB, + (j > 0 ? tc.cfg->Name : NULL), + (j > 1 ? info->Id : NULL)); + if (err != NULL) + FAIL("failed to generate INFO subject!"); + + snprintf(buf, sizeof(buf), "%s: Verify INFO subject %s: ", tc.name, subject); + test(buf); + s = natsConnection_Request(&reply, nc, subject, NULL, 0, 1000); + array = NULL; + array_len = 0; + testCond((NATS_OK == s) + && (NATS_OK == nats_JSONParse(&js, natsMsg_GetData(reply), natsMsg_GetDataLength(reply))) + && (NATS_OK == nats_JSONGetStrPtr(js, "id", &str)) && (strcmp(str, info->Id) == 0) + && (NATS_OK == nats_JSONGetStrPtr(js, "name", &str)) && (strcmp(str, tc.cfg->Name) == 0) + && (NATS_OK == nats_JSONGetStrPtr(js, "type", &str)) && (strcmp(str, MICRO_INFO_RESPONSE_TYPE) == 0) + && (NATS_OK == nats_JSONGetArrayObject(js, "endpoints", &array, &array_len)) && (array_len == tc.expected_num_subjects) + ); + + NATS_FREE(array); + nats_JSONDestroy(js); + natsMsg_Destroy(reply); + NATS_FREE(subject); + } + + microServiceInfo_Destroy(info); + + if (m != NULL) + { + snprintf(buf, sizeof(buf), "%s: Destroy service: %d", m->cfg->Name, m->refs); + test(buf); + testCond(NULL == microService_Destroy(m)); + _waitForMicroservicesAllDone(&arg); + } + } + + test("Destroy the test connection: "); + natsConnection_Destroy(nc); + testCond(NATS_OK == _waitForConnClosed(&arg)); + + natsOptions_Destroy(opts); + _destroyDefaultThreadArgs(&arg); + _stopServer(serverPid); +} + +static void +test_MicroGroups(void) +{ + natsStatus s = NATS_OK; + microError *err = NULL; + struct threadArg arg; + natsOptions *opts = NULL; + natsConnection *nc = NULL; + natsPid serverPid = NATS_INVALID_PID; + microService *m = NULL; + microGroup *g1 = NULL; + microGroup *g2 = NULL; + microServiceInfo *info = NULL; + int i; + + microEndpointConfig ep1_cfg = { + .Name = "ep1", + .Handler = _microHandleRequest42, + }; + microEndpointConfig ep2_cfg = { + .Name = "ep2", + .Handler = _microHandleRequest42, + }; + microServiceConfig cfg = { + .Version = "1.0.0", + .Name = "with-groups", + }; + + const char* expected_subjects[] = { + "ep1", + "g1.ep1", + "g1.g2.ep1", + "g1.g2.ep2", + "g1.ep2", + }; + int expected_num_endpoints = sizeof(expected_subjects) / sizeof(expected_subjects[0]); + + s = _createDefaultThreadArgsForCbTests(&arg); + if (s == NATS_OK) + opts = _createReconnectOptions(); + if ((opts == NULL) + || (natsOptions_SetClosedCB(opts, _closedCb, &arg) != NATS_OK) + || (natsOptions_SetURL(opts, NATS_DEFAULT_URL) != NATS_OK)) + { + FAIL("Unable to setup test for MicroConnectionEvents!"); + } + + serverPid = _startServer("nats://127.0.0.1:4222", NULL, true); + CHECK_SERVER_STARTED(serverPid); + + test("Connect to server: "); + testCond(NATS_OK == natsConnection_Connect(&nc, opts)); + + _startMicroservice(&m, nc, &cfg, NULL, 0, &arg); + + test("AddEndpoint 1 to service: "); + testCond(NULL == microService_AddEndpoint(m, &ep1_cfg)); + + test("AddGroup g1: "); + testCond(NULL == microService_AddGroup(&g1, m, "g1")); + + test("AddEndpoint 1 to g1: "); + testCond(NULL == microGroup_AddEndpoint(g1, &ep1_cfg)); + + test("Add sub-Group g2: "); + testCond(NULL == microGroup_AddGroup(&g2, g1, "g2")); + + test("AddEndpoint 1 to g2: "); + testCond(NULL == microGroup_AddEndpoint(g2, &ep1_cfg)); + + test("AddEndpoint 2 to g2: "); + testCond(NULL == microGroup_AddEndpoint(g2, &ep2_cfg)); + + test("AddEndpoint 2 to g1: "); + testCond(NULL == microGroup_AddEndpoint(g1, &ep2_cfg)); + + err = microService_GetInfo(&info, m); + if (err != NULL) + FAIL("failed to get service info!") + + test("Verify number of endpoints: "); + testCond(info->EndpointsLen == expected_num_endpoints); + + test("Verify endpoint subjects: "); + for (i = 0; i < info->EndpointsLen; i++) + { + if (strcmp(info->Endpoints[i].Subject, expected_subjects[i]) != 0) { + char buf[1024]; + snprintf(buf, sizeof(buf), "expected %s, got %s", expected_subjects[i], info->Endpoints[i].Subject); + FAIL(buf); + } + } + testCond(true); + + microServiceInfo_Destroy(info); + + microService_Destroy(m); + _waitForMicroservicesAllDone(&arg); + + test("Destroy the test connection: "); + natsConnection_Destroy(nc); + testCond(NATS_OK == _waitForConnClosed(&arg)); + + natsOptions_Destroy(opts); + _destroyDefaultThreadArgs(&arg); + _stopServer(serverPid); +} + +#define NUM_MICRO_SERVICES 5 + +static void +test_MicroBasics(void) +{ + natsStatus s = NATS_OK; + microError *err = NULL; + struct threadArg arg; + natsOptions *opts = NULL; + natsConnection *nc = NULL; + natsPid serverPid = NATS_INVALID_PID; + microService *svcs[NUM_MICRO_SERVICES]; + microEndpointConfig ep1_cfg = { + .Name = "do", + .Subject = "svc.do", + .Handler = _microHandleRequestNoisy42, + }; + microEndpointConfig ep2_cfg = { + .Name = "unused", + .Subject = "svc.unused", + .Handler = _microHandleRequestNoisy42, + .Metadata = (natsMetadata){ + .List = (const char *[]){"key1", "value1", "key2", "value2", "key3", "value3"}, + .Count = 3, + }, + }; + microEndpointConfig *eps[] = { + &ep1_cfg, + &ep2_cfg, + }; + microServiceConfig cfg = { + .Version = "1.0.0", + .Name = "CoolService", + .Description = "returns 42", + .Metadata = (natsMetadata){ + .List = (const char *[]){"skey1", "svalue1", "skey2", "svalue2"}, + .Count = 2, + }, + }; + natsMsg *reply = NULL; + microServiceInfo *info = NULL; + int i; + char buf[1024]; + char *subject = NULL; + natsInbox *inbox = NULL; + natsSubscription *sub = NULL; + nats_JSON *js = NULL; + nats_JSON *md = NULL; + int num_requests = 0; + int num_errors = 0; + int n; + nats_JSON **array; + int array_len; + const char *str; + + srand((unsigned int)nats_NowInNanoSeconds()); + + s = _createDefaultThreadArgsForCbTests(&arg); + if (s == NATS_OK) + opts = _createReconnectOptions(); + if ((opts == NULL) + || (natsOptions_SetClosedCB(opts, _closedCb, &arg) != NATS_OK) + || (natsOptions_SetURL(opts, NATS_DEFAULT_URL) != NATS_OK)) + { + FAIL("Unable to setup test for MicroConnectionEvents!"); + } + + serverPid = _startServer("nats://127.0.0.1:4222", NULL, true); + CHECK_SERVER_STARTED(serverPid); + + test("Connect to server: "); + testCond(NATS_OK == natsConnection_Connect(&nc, opts)); + + _startManyMicroservices(svcs, NUM_MICRO_SERVICES, nc, &cfg, eps, sizeof(eps)/sizeof(eps[0]), &arg); + + // Now send 50 requests. + test("Send 50 requests (no matter response): "); + for (i = 0; i < 50; i++) + { + s = natsConnection_Request(&reply, nc, "svc.do", NULL, 0, 1000); + if (NATS_OK != s) + FAIL("Unable to send request"); + natsMsg_Destroy(reply); + } + testCond(NATS_OK == s); + + // Make sure we can request valid info with local API. + for (i = 0; i < NUM_MICRO_SERVICES; i++) + { + snprintf(buf, sizeof(buf), "Check local info #%d: ", i); + test(buf); + err = microService_GetInfo(&info, svcs[i]); + testCond((err == NULL) && + (strcmp(info->Name, "CoolService") == 0) && + (strlen(info->Id) > 0) && + (strcmp(info->Description, "returns 42") == 0) && + (strcmp(info->Version, "1.0.0") == 0) && + (info->Metadata.Count == 2)); + microServiceInfo_Destroy(info); + } + + // Make sure we can request valid info with $SRV.INFO request. + test("Create INFO inbox: "); + testCond(NATS_OK == natsInbox_Create(&inbox)); + micro_new_control_subject(&subject, MICRO_INFO_VERB, "CoolService", NULL); + test("Subscribe to INFO inbox: "); + testCond(NATS_OK == natsConnection_SubscribeSync(&sub, nc, inbox)); + test("Publish INFO request: "); + testCond(NATS_OK == natsConnection_PublishRequest(nc, subject, inbox, NULL, 0)); + for (i = 0;; i++) + { + snprintf(buf, sizeof(buf), "Receive INFO response #%d: ", i); + test(buf); + reply = NULL; + s = natsSubscription_NextMsg(&reply, sub, 250); + if (s == NATS_TIMEOUT) + { + testCond(i == NUM_MICRO_SERVICES); + break; + } + testCond(NATS_OK == s); + + snprintf(buf, sizeof(buf), "Parse INFO response#%d: ", i); + test(buf); + js = NULL; + testCond(NATS_OK == nats_JSONParse(&js, reply->data, reply->dataLen)) ; + + snprintf(buf, sizeof(buf), "Validate INFO response strings#%d: ", i); + test(buf); + testCond( + (NATS_OK == nats_JSONGetStrPtr(js, "name", &str)) && (strcmp(str, "CoolService") == 0) + && (NATS_OK == nats_JSONGetStrPtr(js, "description", &str)) && (strcmp(str, "returns 42") == 0) + && (NATS_OK == nats_JSONGetStrPtr(js, "version", &str)) && (strcmp(str, "1.0.0") == 0) + && (NATS_OK == nats_JSONGetStrPtr(js, "id", &str)) && (strlen(str) > 0) + ); + + snprintf(buf, sizeof(buf), "Validate INFO service metadata#%d: ", i); + test(buf); + md = NULL; + testCond( + (NATS_OK == nats_JSONGetObject(js, "metadata", &md)) + && (NATS_OK == nats_JSONGetStrPtr(md, "skey1", &str)) && (strcmp(str, "svalue1") == 0) + && (NATS_OK == nats_JSONGetStrPtr(md, "skey2", &str)) && (strcmp(str, "svalue2") == 0) + ); + test("Validate INFO has 2 endpoints: "); + array = NULL; + array_len = 0; + s = nats_JSONGetArrayObject(js, "endpoints", &array, &array_len); + testCond((NATS_OK == s) && (array != NULL) && (array_len == 2)); + + test("Validate INFO svc.do endpoint: "); + md = NULL; + testCond( + (NATS_OK == nats_JSONGetStrPtr(array[0], "name", &str)) && (strcmp(str, "do") == 0) + && (NATS_OK == nats_JSONGetStrPtr(array[0], "subject", &str)) && (strcmp(str, "svc.do") == 0) + && (NATS_OK == nats_JSONGetObject(array[0], "metadata", &md)) && (md == NULL) + ); + + test("Validate INFO unused endpoint with metadata: "); + md = NULL; + testCond( + (NATS_OK == nats_JSONGetStrPtr(array[1], "name", &str)) && (strcmp(str, "unused") == 0) + && (NATS_OK == nats_JSONGetStrPtr(array[1], "subject", &str)) && (strcmp(str, "svc.unused") == 0) + && (NATS_OK == nats_JSONGetObject(array[1], "metadata", &md)) + && (NATS_OK == nats_JSONGetStrPtr(md, "key1", &str)) && (strcmp(str, "value1") == 0) + && (NATS_OK == nats_JSONGetStrPtr(md, "key2", &str)) && (strcmp(str, "value2") == 0) + && (NATS_OK == nats_JSONGetStrPtr(md, "key3", &str)) && (strcmp(str, "value3") == 0) + ); + + nats_JSONDestroy(js); + natsMsg_Destroy(reply); + NATS_FREE(array); + } + natsSubscription_Destroy(sub); + natsInbox_Destroy(inbox); + NATS_FREE(subject); + + // Make sure we can request SRV.PING. + test("Create PING inbox: "); + testCond(NATS_OK == natsInbox_Create(&inbox)); + micro_new_control_subject(&subject, MICRO_PING_VERB, "CoolService", NULL); + test("Subscribe to PING inbox: "); + testCond(NATS_OK == natsConnection_SubscribeSync(&sub, nc, inbox)); + test("Publish PING request: "); + testCond(NATS_OK == natsConnection_PublishRequest(nc, subject, inbox, NULL, 0)); + for (i = 0;; i++) + { + snprintf(buf, sizeof(buf), "Receive PING response #%d: ", i); + test(buf); + reply = NULL; + s = natsSubscription_NextMsg(&reply, sub, 250); + if (s == NATS_TIMEOUT) + { + testCond(i == NUM_MICRO_SERVICES); + break; + } + testCond(NATS_OK == s); + snprintf(buf, sizeof(buf), "Validate PING response #%d: ", i); + test(buf); + js = NULL; + testCond((NATS_OK == nats_JSONParse(&js, reply->data, reply->dataLen)) && + (NATS_OK == nats_JSONGetStrPtr(js, "name", &str)) && + (strcmp(str, "CoolService") == 0)); + nats_JSONDestroy(js); + natsMsg_Destroy(reply); + } + natsSubscription_Destroy(sub); + natsInbox_Destroy(inbox); + NATS_FREE(subject); + + // Get and validate $SRV.STATS from all service instances. + test("Create STATS inbox: "); + testCond(NATS_OK == natsInbox_Create(&inbox)); + micro_new_control_subject(&subject, MICRO_STATS_VERB, "CoolService", NULL); + test("Subscribe to STATS inbox: "); + testCond(NATS_OK == natsConnection_SubscribeSync(&sub, nc, inbox)); + test("Publish STATS request: "); + testCond(NATS_OK == natsConnection_PublishRequest(nc, subject, inbox, NULL, 0)); + + for (i = 0;; i++) + { + snprintf(buf, sizeof(buf), "Receive STATS response #%d: ", i); + test(buf); + reply = NULL; + s = natsSubscription_NextMsg(&reply, sub, 250); + if (s == NATS_TIMEOUT) + { + testCond(i == NUM_MICRO_SERVICES); + break; + } + testCond(NATS_OK == s); + + test("Parse STATS response: "); + js = NULL; + s = nats_JSONParse(&js, reply->data, reply->dataLen); + testCond((NATS_OK == s) && (js != NULL)); + + test("Ensure STATS has 2 endpoints: "); + array = NULL; + array_len = 0; + s = nats_JSONGetArrayObject(js, "endpoints", &array, &array_len); + testCond((NATS_OK == s) && (array != NULL) && (array_len == 2)) + + test("Ensure endpoint 0 has num_requests: "); + n = 0; + s = nats_JSONGetInt(array[0], "num_requests", &n); + testCond(NATS_OK == s); + num_requests += n; + + test("Ensure endpoint 0 has num_errors: "); + n = 0; + s = nats_JSONGetInt(array[0], "num_errors", &n); + testCond(NATS_OK == s); + num_errors += n; + + NATS_FREE(array); + nats_JSONDestroy(js); + natsMsg_Destroy(reply); + } + test("Check that STATS total request counts add up (50): "); + testCond(num_requests == 50); + test("Check that STATS total error count is positive, depends on how many instances: "); + testCond(num_errors > 0); + + natsSubscription_Destroy(sub); + natsInbox_Destroy(inbox); + NATS_FREE(subject); + + _destroyMicroservicesAndWaitForAllDone(svcs, NUM_MICRO_SERVICES, &arg); + + test("Destroy the test connection: "); + natsConnection_Destroy(nc); + testCond(NATS_OK == _waitForConnClosed(&arg)); + + natsOptions_Destroy(opts); + _destroyDefaultThreadArgs(&arg); + _stopServer(serverPid); +} + +static void +test_MicroStartStop(void) +{ + natsStatus s = NATS_OK; + struct threadArg arg; + natsOptions *opts = NULL; + natsConnection *nc = NULL; + natsPid serverPid = NATS_INVALID_PID; + microService *svcs[NUM_MICRO_SERVICES]; + microEndpointConfig ep_cfg = { + .Name = "do", + .Subject = "svc.do", + .Handler = _microHandleRequest42, + }; + microServiceConfig cfg = { + .Version = "1.0.0", + .Name = "CoolService", + .Description = "returns 42", + .Endpoint = &ep_cfg, + }; + natsMsg *reply = NULL; + int i; + + srand((unsigned int)nats_NowInNanoSeconds()); + + s = _createDefaultThreadArgsForCbTests(&arg); + if (s == NATS_OK) + opts = _createReconnectOptions(); + if ((opts == NULL) + || (natsOptions_SetURL(opts, NATS_DEFAULT_URL) != NATS_OK) + || (natsOptions_SetClosedCB(opts, _closedCb, &arg) != NATS_OK) + || (natsOptions_SetAllowReconnect(opts, false) != NATS_OK)) + { + FAIL("Unable to setup test for MicroConnectionEvents!"); + } + + serverPid = _startServer("nats://127.0.0.1:4222", NULL, true); + CHECK_SERVER_STARTED(serverPid); + + test("Connect to server: "); + testCond(NATS_OK == natsConnection_Connect(&nc, opts)); + + _startManyMicroservices(svcs, NUM_MICRO_SERVICES, nc, &cfg, NULL, 0, &arg); + + // Now send some requests. + test("Send requests: "); + for (i = 0; i < 20; i++) + { + reply = NULL; + s = natsConnection_Request(&reply, nc, "svc.do", NULL, 0, 2000); + if (NATS_OK != s) + FAIL("Unable to send request"); + if (reply == NULL || reply->dataLen != 2 || memcmp(reply->data, "42", 2) != 0) + FAIL("Unexpected reply"); + natsMsg_Destroy(reply); + } + testCond(NATS_OK == s); + + _destroyMicroservicesAndWaitForAllDone(svcs, NUM_MICRO_SERVICES, &arg); + + test("Destroy the test connection: "); + natsConnection_Destroy(nc); + testCond(NATS_OK == _waitForConnClosed(&arg)); + + natsOptions_Destroy(opts); + _destroyDefaultThreadArgs(&arg); + _stopServer(serverPid); +} + +static void +test_MicroServiceStopsOnClosedConn(void) +{ + natsStatus s; + natsConnection *nc = NULL; + natsOptions *opts = NULL; + natsPid serverPid = NATS_INVALID_PID; + struct threadArg arg; + microService *m = NULL; + microServiceConfig cfg = { + .Name = "test", + .Version = "1.0.0", + }; + natsMsg *reply = NULL; + + s = _createDefaultThreadArgsForCbTests(&arg); + if (s == NATS_OK) + opts = _createReconnectOptions(); + + if ((opts == NULL) || + (natsOptions_SetURL(opts, NATS_DEFAULT_URL) != NATS_OK) || + (natsOptions_SetClosedCB(opts, _closedCb, (void*) &arg)) || + (natsOptions_SetAllowReconnect(opts, false) != NATS_OK)) + { + FAIL("Unable to setup test for MicroConnectionEvents!"); + } + + serverPid = _startServer("nats://127.0.0.1:4222", NULL, true); + CHECK_SERVER_STARTED(serverPid); + + test("Connect for microservice: "); + testCond(NATS_OK == natsConnection_Connect(&nc, opts)); + + _startMicroservice(&m, nc, &cfg, NULL, 0, &arg); + + test("Test microservice is running: "); + testCond(!microService_IsStopped(m)) + + test("Test microservice is responding to PING: "); + testCond(NATS_OK == natsConnection_RequestString(&reply, nc, "$SRV.PING.test", "", 500)); + natsMsg_Destroy(reply); + reply = NULL; + + test("Close the connection: "); + testCond(NATS_OK == natsConnection_Drain(nc)); + natsConnection_Close(nc); + + test("Wait for it: "); + testCond(_waitForConnClosed(&arg) == NATS_OK); + + test("Ensure the connection has closed: "); + testCond(natsConnection_IsClosed(nc)); + + test("Wait for the service to stop: "); + natsMutex_Lock(arg.m); + while ((s != NATS_TIMEOUT) && !arg.microAllDone) + s = natsCondition_TimedWait(arg.c, arg.m, 1000); + natsMutex_Unlock(arg.m); + testCond(arg.microAllDone); + + test("Test microservice is stopped: "); + testCond(microService_IsStopped(m)); + + test("Destroy microservice (final): "); + testCond(NULL == microService_Destroy(m)) + _waitForMicroservicesAllDone(&arg); + + natsOptions_Destroy(opts); + natsConnection_Destroy(nc); + _destroyDefaultThreadArgs(&arg); + _stopServer(serverPid); +} + +static void +test_MicroServiceStopsWhenServerStops(void) +{ + natsStatus s; + natsConnection *nc = NULL; + natsOptions *opts = NULL; + natsPid serverPid = NATS_INVALID_PID; + struct threadArg arg; + microService *m = NULL; + microServiceConfig cfg = { + .Name = "test", + .Version = "1.0.0", + }; + + s = _createDefaultThreadArgsForCbTests(&arg); + if (s == NATS_OK) + opts = _createReconnectOptions(); + + if ((opts == NULL) + || (natsOptions_SetURL(opts, NATS_DEFAULT_URL) != NATS_OK) + || (natsOptions_SetClosedCB(opts, _closedCb, &arg) != NATS_OK) + || (natsOptions_SetAllowReconnect(opts, false) != NATS_OK)) + { + FAIL("Unable to setup test for MicroConnectionEvents!"); + } + + serverPid = _startServer("nats://127.0.0.1:4222", NULL, true); + CHECK_SERVER_STARTED(serverPid); + + test("Connect for microservice: "); + testCond(NATS_OK == natsConnection_Connect(&nc, opts)); + + _startMicroservice(&m, nc, &cfg, NULL, 0, &arg); + + test("Test microservice is running: "); + testCond(!microService_IsStopped(m)) + + test("Stop the server: "); + testCond((_stopServer(serverPid), true)); + + test("Wait for the service to stop: "); + natsMutex_Lock(arg.m); + while ((s != NATS_TIMEOUT) && !arg.microAllDone) + s = natsCondition_TimedWait(arg.c, arg.m, 1000); + natsMutex_Unlock(arg.m); + testCond(arg.microAllDone); + + test("Test microservice is not running: "); + testCond(microService_IsStopped(m)) + + microService_Destroy(m); + _waitForMicroservicesAllDone(&arg); + + test("Destroy the test connection: "); + natsConnection_Destroy(nc); + testCond(NATS_OK == _waitForConnClosed(&arg)); + + natsOptions_Destroy(opts); + _destroyDefaultThreadArgs(&arg); +} + +void _microAsyncErrorHandler(microService *m, microEndpoint *ep, natsStatus s) +{ + struct threadArg *arg = (struct threadArg*) microService_GetState(m); + + natsMutex_Lock(arg->m); + // release the pending test request that caused the error + arg->closed = true; + + // set the data to verify + arg->status = s; + natsCondition_Broadcast(arg->c); + natsMutex_Unlock(arg->m); +} + +microError * +_microAsyncErrorRequestHandler(microRequest *req) +{ + struct threadArg *arg = microRequest_GetServiceState(req); + + natsMutex_Lock(arg->m); + + arg->msgReceived = true; + natsCondition_Signal(arg->c); + + while (!arg->closed) + natsCondition_Wait(arg->c, arg->m); + + natsMutex_Unlock(arg->m); + + return NULL; +} + +static void +test_MicroAsyncErrorHandler(void) +{ + natsStatus s; + struct threadArg arg; + natsConnection *nc = NULL; + natsOptions *opts = NULL; + natsPid serverPid = NATS_INVALID_PID; + microService *m = NULL; + microEndpoint *ep = NULL; + microEndpointConfig ep_cfg = { + .Name = "do", + .Subject = "async_test", + .Handler = _microAsyncErrorRequestHandler, + }; + microServiceConfig cfg = { + .Name = "test", + .Version = "1.0.0", + .ErrHandler = _microAsyncErrorHandler, + .State = &arg, + .DoneHandler = _microServiceDoneHandler, + }; + + s = _createDefaultThreadArgsForCbTests(&arg); + if (s != NATS_OK) + FAIL("Unable to setup test!"); + + s = natsOptions_Create(&opts); + IFOK(s, natsOptions_SetURL(opts, NATS_DEFAULT_URL)); + IFOK(s, natsOptions_SetMaxPendingMsgs(opts, 10)); + if (s != NATS_OK) + FAIL("Unable to create options for test AsyncErrHandler"); + + serverPid = _startServer("nats://127.0.0.1:4222", NULL, true); + CHECK_SERVER_STARTED(serverPid); + + test("Connect to NATS: "); + testCond(NATS_OK == natsConnection_Connect(&nc, opts)); + + _startMicroservice(&m, nc, &cfg, NULL, 0, &arg); + + test("Test microservice is running: "); + testCond(!microService_IsStopped(m)) + + test("Add test endpoint: "); + testCond(NULL == micro_add_endpoint(&ep, m, NULL, &ep_cfg, true)); + + natsMutex_Lock(arg.m); + arg.status = NATS_OK; + natsMutex_Unlock(arg.m); + + test("Cause an error by sending too many messages: "); + for (int i=0; + (s == NATS_OK) && (i < (opts->maxPendingMsgs + 100)); i++) + { + s = natsConnection_PublishString(nc, "async_test", "hello"); + } + testCond((NATS_OK == s) + && (NATS_OK == natsConnection_Flush(nc))); + + test("Wait for async err callback: "); + natsMutex_Lock(arg.m); + while ((s != NATS_TIMEOUT) && !arg.closed) + s = natsCondition_TimedWait(arg.c, arg.m, 1000); + natsMutex_Unlock(arg.m); + testCond((s == NATS_OK) && arg.closed && (arg.status == NATS_SLOW_CONSUMER)); + + microService_Destroy(m); + _waitForMicroservicesAllDone(&arg); + + test("Destroy the test connection: "); + natsConnection_Destroy(nc); + testCond(NATS_OK == _waitForConnClosed(&arg)); + + natsOptions_Destroy(opts); + _destroyDefaultThreadArgs(&arg); + _stopServer(serverPid); +} + #if defined(NATS_HAS_STREAMING) static int @@ -32662,6 +34142,9 @@ test_StanBasicPublish(void) stanConnection_Destroy(sc); + if (valgrind) + nats_Sleep(900); + _stopServer(pid); } @@ -32719,6 +34202,9 @@ test_StanBasicPublishAsync(void) _destroyDefaultThreadArgs(&args); + if (valgrind) + nats_Sleep(900); + _stopServer(pid); } @@ -32986,6 +34472,9 @@ test_StanBasicSubscription(void) stanSubscription_Destroy(sub); stanConnection_Destroy(sc); + if (valgrind) + nats_Sleep(900); + _stopServer(pid); } @@ -33084,6 +34573,9 @@ test_StanSubscriptionCloseAndUnsubscribe(void) stanConnection_Destroy(sc); stanConnOptions_Destroy(opts); + if (valgrind) + nats_Sleep(900); + _stopServer(pid); } @@ -33233,6 +34725,9 @@ test_StanBasicQueueSubscription(void) _destroyDefaultThreadArgs(&args); + if (valgrind) + nats_Sleep(900); + _stopServer(pid); } @@ -33551,6 +35046,9 @@ test_StanSubscriptionAckMsg(void) _destroyDefaultThreadArgs(&args); + if (valgrind) + nats_Sleep(900); + _stopServer(pid); } @@ -33942,6 +35440,9 @@ test_StanGetNATSConnection(void) _destroyDefaultThreadArgs(&args); + if (valgrind) + nats_Sleep(900); + _stopServer(pid); } @@ -34229,6 +35730,10 @@ test_StanSubTimeout(void) stanSubscription_Destroy(sub); stanConnection_ReleaseNATSConnection(sc); stanConnection_Destroy(sc); + + if (valgrind) + nats_Sleep(900); + _stopServer(pid); } @@ -34403,6 +35908,7 @@ static testInfo allTests[] = {"SyncSubscriptionPending", test_SyncSubscriptionPending}, {"SyncSubscriptionPendingDrain", test_SyncSubscriptionPendingDrain}, {"AsyncErrHandler", test_AsyncErrHandler}, + {"AsyncErrHandlerSubDestroyed", test_AsyncErrHandlerSubDestroyed}, {"AsyncSubscriberStarvation", test_AsyncSubscriberStarvation}, {"AsyncSubscriberOnClose", test_AsyncSubscriberOnClose}, {"NextMsgCallOnAsyncSub", test_NextMsgCallOnAsyncSub}, @@ -34519,6 +36025,15 @@ static testInfo allTests[] = {"KeyValueMirrorDirectGet", test_KeyValueMirrorDirectGet}, {"KeyValueMirrorCrossDomains", test_KeyValueMirrorCrossDomains}, + {"MicroMatchEndpointSubject", test_MicroMatchEndpointSubject}, + {"MicroAddService", test_MicroAddService}, + {"MicroGroups", test_MicroGroups}, + {"MicroBasics", test_MicroBasics}, + {"MicroStartStop", test_MicroStartStop}, + {"MicroServiceStopsOnClosedConn", test_MicroServiceStopsOnClosedConn}, + {"MicroServiceStopsWhenServerStops", test_MicroServiceStopsWhenServerStops}, + {"MicroAsyncErrorHandler", test_MicroAsyncErrorHandler}, + #if defined(NATS_HAS_STREAMING) {"StanPBufAllocator", test_StanPBufAllocator}, {"StanConnOptions", test_StanConnOptions},