-module(glats@jetstream). -compile([no_auto_import, nowarn_unused_vars]). -export([ack/2, term/2, nack/2]). -export_type([jetstream_error/0, storage_type/0, retention_policy/0, discard_policy/0]). -type jetstream_error() :: {jetstream_not_enabled_for_account, binary()} | {jetstream_not_enabled, binary()} | {insufficient_resources, binary()} | {invalid_stream_config, binary()} | {stream_name_in_subject_does_not_match, binary()} | {stream_name_in_use, binary()} | {stream_not_found, binary()} | {stream_purge_not_allowed, binary()} | {no_message_found, binary()} | {consumer_not_found, binary()} | {consumer_name_exists, binary()} | {consumer_already_exists, binary()} | {wrong_last_sequence, binary()} | {bad_request, binary()} | {unknown, integer(), binary()} | {decode_error, binary()} | timeout | no_responders | {pull_consumer_required, binary()}. -type storage_type() :: file_storage | memory_storage. -type retention_policy() :: limits_policy | interest_policy | work_queue_policy. -type discard_policy() :: discard_old | discard_new. -spec ack( gleam@erlang@process:subject(glats:connection_message()), glats:message() ) -> {ok, nil} | {error, binary()}. ack(Conn, Message) -> glats:respond(Conn, Message, <<""/utf8>>). -spec term( gleam@erlang@process:subject(glats:connection_message()), glats:message() ) -> {ok, nil} | {error, binary()}. term(Conn, Message) -> glats:respond(Conn, Message, <<"+TERM"/utf8>>). -spec nack( gleam@erlang@process:subject(glats:connection_message()), glats:message() ) -> {ok, nil} | {error, binary()}. nack(Conn, Message) -> glats:respond(Conn, Message, <<"-NAK"/utf8>>).