NATS C Client with JetStream and Streaming support 3.6.1 The nats.io C Client, Supported by Synadia Communications Inc.

Loading...
Searching...
No Matches
nats.h
Go to the documentation of this file.
1// Copyright 2015-2022 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
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14#ifndef NATS_H_
15#define NATS_H_
16
17#ifdef __cplusplus
18 extern "C" {
19#endif
20
21#include <stdlib.h>
22#include <stdint.h>
23#include <stdbool.h>
24#include <inttypes.h>
25#include <stdio.h>
26
27#include "status.h"
28#include "version.h"
29
37#if defined(_WIN32)
38 #include <winsock2.h>
39 #if defined(nats_EXPORTS)
40 #define NATS_EXTERN __declspec(dllexport)
41 #elif defined(nats_IMPORTS)
42 #define NATS_EXTERN __declspec(dllimport)
43 #else
44 #define NATS_EXTERN
45 #endif
46
47 typedef SOCKET natsSock;
48#else
49 #define NATS_EXTERN
50 typedef int natsSock;
51#endif
52
86#define NATS_DEFAULT_URL "nats://localhost:4222"
87
97 #define JSMsgSize "Nats-Msg-Size"
98
111 #define JSMsgRollup "Nats-Rollup"
112
120 #define JSMsgRollupSubject "sub"
121
129 #define JSMsgRollupAll "all"
130
131 // Headers for republished messages and direct get.
132 #define JSStream "Nats-Stream"
133 #define JSSequence "Nats-Sequence"
134 #define JSLastSequence "Nats-Last-Sequence"
135 #define JSTimeStamp "Nats-Time-Stamp"
136 #define JSSubject "Nats-Subject"
137
138//
139// Types.
140//
152 typedef struct __natsConnection natsConnection;
153
159 typedef struct __natsStatistics natsStatistics;
160
165 typedef struct __natsSubscription natsSubscription;
166
172 typedef struct __natsMsg natsMsg;
173
178 typedef struct __natsOptions natsOptions;
179
187 typedef char natsInbox;
188
212 typedef struct natsMsgList
213{
214 natsMsg **Msgs;
215 int Count;
216
217} natsMsgList;
218
227 typedef struct __jsCtx jsCtx;
228
244 typedef struct jsPubOptions
245{
246 int64_t MaxWait;
247 const char *MsgId;
248 const char *ExpectStream;
249 const char *ExpectLastMsgId;
250 uint64_t ExpectLastSeq;
251 uint64_t ExpectLastSubjectSeq;
252 bool ExpectNoMessage;
253
254} jsPubOptions;
255
259 typedef enum
260{
261 js_LimitsPolicy = 0,
262 js_InterestPolicy,
263 js_WorkQueuePolicy,
264
265} jsRetentionPolicy;
266
270 typedef enum
271{
272 js_DiscardOld = 0,
273 js_DiscardNew,
274
275} jsDiscardPolicy;
276
280 typedef enum
281{
282 js_FileStorage = 0,
283 js_MemoryStorage,
284
285} jsStorageType;
286
290 typedef enum
291{
292 js_DeliverAll = 0,
293 js_DeliverLast,
294 js_DeliverNew,
295 js_DeliverByStartSequence,
296 js_DeliverByStartTime,
297 js_DeliverLastPerSubject,
298
299} jsDeliverPolicy;
300
304 typedef enum
305{
306 js_AckExplicit = 0,
307 js_AckNone,
308 js_AckAll,
309
310
311} jsAckPolicy;
312
316 typedef enum
317{
318 js_ReplayInstant = 0,
319 js_ReplayOriginal,
320
321} jsReplayPolicy;
322
323
335 typedef struct jsPlacement
336{
337 const char *Cluster;
338 const char **Tags;
339 int TagsLen;
340
341} jsPlacement;
342
352 typedef struct jsExternalStream
353{
354 const char *APIPrefix;
355 const char *DeliverPrefix;
356
357} jsExternalStream;
358
371 typedef struct jsStreamSource
372{
373 const char *Name;
374 uint64_t OptStartSeq;
375 int64_t OptStartTime;
376 const char *FilterSubject;
377 jsExternalStream *External;
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
383} jsStreamSource;
384
388 typedef struct jsRePublish
389{
390 const char *Source;
391 const char *Destination;
392 bool HeadersOnly;
393
394} jsRePublish;
395
472 typedef struct jsStreamConfig {
473 const char *Name;
474 const char *Description;
475 const char **Subjects;
476 int SubjectsLen;
477 jsRetentionPolicy Retention;
478 int64_t MaxConsumers;
479 int64_t MaxMsgs;
480 int64_t MaxBytes;
481 int64_t MaxAge;
482 int64_t MaxMsgsPerSubject;
483 int32_t MaxMsgSize;
484 jsDiscardPolicy Discard;
485 jsStorageType Storage;
486 int64_t Replicas;
487 bool NoAck;
488 const char *Template;
489 int64_t Duplicates;
490 jsPlacement *Placement;
491 jsStreamSource *Mirror;
492 jsStreamSource **Sources;
493 int SourcesLen;
494 bool Sealed;
495 bool DenyDelete;
496 bool DenyPurge;
501 bool AllowRollup;
502
503 // Allow republish of the message after being sequenced and stored.
504 jsRePublish *RePublish;
505
506 // Allow higher performance, direct access to get individual messages. E.g. KeyValue
507 bool AllowDirect;
508 // Allow higher performance and unified direct access for mirrors as well.
509 bool MirrorDirect;
510
511 // Allow KV like semantics to also discard new on a per subject basis
512 bool DiscardNewPerSubject;
513
514} jsStreamConfig;
515
519 typedef struct jsLostStreamData
520{
521 uint64_t *Msgs;
522 int MsgsLen;
523 uint64_t Bytes;
524
525} jsLostStreamData;
526
532 typedef struct jsStreamStateSubject
533{
534 const char *Subject;
535 uint64_t Msgs;
536
537} jsStreamStateSubject;
538
568 typedef struct jsStreamStateSubjects
569{
570 jsStreamStateSubject *List;
571 int Count;
572
573} jsStreamStateSubjects;
574
581 typedef 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;
590 jsStreamStateSubjects *Subjects;
591 uint64_t NumDeleted;
592 uint64_t *Deleted;
593 int DeletedLen;
594 jsLostStreamData *Lost;
595 int64_t Consumers;
596
597} jsStreamState;
598
603 typedef struct jsPeerInfo
604{
605 char *Name;
606 bool Current;
607 bool Offline;
608 int64_t Active;
609 uint64_t Lag;
610
611} jsPeerInfo;
612
617 typedef struct jsClusterInfo
618{
619 char *Name;
620 char *Leader;
621 jsPeerInfo **Replicas;
622 int ReplicasLen;
623
624} jsClusterInfo;
625
629 typedef struct jsStreamSourceInfo
630{
631 char *Name;
632 jsExternalStream *External;
633 uint64_t Lag;
634 int64_t Active;
635
636} jsStreamSourceInfo;
637
641 typedef struct jsStreamAlternate
642{
643 const char *Name;
644 const char *Domain;
645 const char *Cluster;
646
647} jsStreamAlternate;
648
655 typedef struct jsStreamInfo
656{
657 jsStreamConfig *Config;
658 int64_t Created;
659 jsStreamState State;
660 jsClusterInfo *Cluster;
661 jsStreamSourceInfo *Mirror;
662 jsStreamSourceInfo **Sources;
663 int SourcesLen;
664 jsStreamAlternate **Alternates;
665 int AlternatesLen;
666
667} jsStreamInfo;
668
676 typedef struct jsStreamInfoList
677{
678 jsStreamInfo **List;
679 int Count;
680
681} jsStreamInfoList;
682
690 typedef struct jsStreamNamesList
691{
692 char **List;
693 int Count;
694
695} jsStreamNamesList;
696
733 typedef struct jsConsumerConfig
734{
735 const char *Name;
736 const char *Durable;
737 const char *Description;
738 jsDeliverPolicy DeliverPolicy;
739 uint64_t OptStartSeq;
740 int64_t OptStartTime;
741 jsAckPolicy AckPolicy;
742 int64_t AckWait;
743 int64_t MaxDeliver;
744 int64_t *BackOff;
745 int BackOffLen;
746 const char *FilterSubject;
747 jsReplayPolicy ReplayPolicy;
748 uint64_t RateLimit;
749 const char *SampleFrequency;
750 int64_t MaxWaiting;
751 int64_t MaxAckPending;
752 bool FlowControl;
753 int64_t Heartbeat;
754 bool HeadersOnly;
755
756 // Pull based options.
757 int64_t MaxRequestBatch;
758 int64_t MaxRequestExpires;
759 int64_t MaxRequestMaxBytes;
760
761 // Push based options.
762 const char *DeliverSubject;
763 const char *DeliverGroup;
764
765 // Ephemeral inactivity threshold.
766 int64_t InactiveThreshold;
767
768 // Generally inherited by parent stream and other markers, now can be configured directly.
769 int64_t Replicas;
770 // Force memory storage.
771 bool MemoryStorage;
772
773} jsConsumerConfig;
774
792 typedef struct jsConsumerSequenceMismatch
793{
794 uint64_t Stream;
795 uint64_t ConsumerClient;
796 uint64_t ConsumerServer;
797
798} jsConsumerSequenceMismatch;
799
815 typedef struct jsSubOptions
816{
823 const char *Stream;
833 const char *Consumer;
848 const char *Queue;
861 bool ManualAck;
866 jsConsumerConfig Config;
873 bool Ordered;
874
875} jsSubOptions;
876
880 typedef struct jsSequencePair
881{
882 uint64_t Consumer;
883 uint64_t Stream;
884
885} jsSequencePair;
886
890 typedef struct jsSequenceInfo
891{
892 uint64_t Consumer;
893 uint64_t Stream;
894 int64_t Last;
895
896} jsSequenceInfo;
897
904 typedef struct jsConsumerInfo
905{
906 char *Stream;
907 char *Name;
908 int64_t Created;
909 jsConsumerConfig *Config;
910 jsSequenceInfo Delivered;
911 jsSequenceInfo AckFloor;
912 int64_t NumAckPending;
913 int64_t NumRedelivered;
914 int64_t NumWaiting;
915 uint64_t NumPending;
916 jsClusterInfo *Cluster;
917 bool PushBound;
918
919} jsConsumerInfo;
920
928 typedef struct jsConsumerInfoList
929{
930 jsConsumerInfo **List;
931 int Count;
932
933} jsConsumerInfoList;
934
942 typedef struct jsConsumerNamesList
943{
944 char **List;
945 int Count;
946
947} jsConsumerNamesList;
948
952 typedef struct jsAPIStats
953{
954 uint64_t Total;
955 uint64_t Errors;
956
957} jsAPIStats;
958
962 typedef struct jsAccountLimits
963{
964 int64_t MaxMemory;
965 int64_t MaxStore;
966 int64_t MaxStreams;
967 int64_t MaxConsumers;
968 int64_t MaxAckPending;
969 int64_t MemoryMaxStreamBytes;
970 int64_t StoreMaxStreamBytes;
971 bool MaxBytesRequired;
972
973} jsAccountLimits;
974
975 typedef struct jsTier
976{
977 const char *Name;
978 uint64_t Memory;
979 uint64_t Store;
980 int64_t Streams;
981 int64_t Consumers;
982 jsAccountLimits Limits;
983
984} jsTier;
985
989 typedef struct jsAccountInfo
990{
991 uint64_t Memory;
992 uint64_t Store;
993 int64_t Streams;
994 int64_t Consumers;
995 char *Domain;
996 jsAPIStats API;
997 jsAccountLimits Limits;
998 jsTier **Tiers;
999 int TiersLen;
1000
1001} jsAccountInfo;
1002
1010 typedef struct jsMsgMetaData
1011{
1012 jsSequencePair Sequence;
1013 uint64_t NumDelivered;
1014 uint64_t NumPending;
1015 int64_t Timestamp;
1016 char *Stream;
1017 char *Consumer;
1018 char *Domain;
1019
1020} jsMsgMetaData;
1021
1025 typedef struct jsPubAck
1026{
1027 char *Stream;
1028 uint64_t Sequence;
1029 char *Domain;
1030 bool Duplicate;
1031
1032} jsPubAck;
1033
1038 typedef struct jsPubAckErr
1039{
1040 natsMsg *Msg;
1041 natsStatus Err;
1042 jsErrCode ErrCode;
1043 const char *ErrText;
1044
1045} jsPubAckErr;
1046
1047#ifndef BUILD_IN_DOXYGEN
1048// Forward declarations
1049 typedef void (*jsPubAckErrHandler)(jsCtx *js, jsPubAckErr *pae, void *closure);
1050 typedef void (*jsPubAckHandler)(jsCtx *js, natsMsg *msg, jsPubAck *pa, jsPubAckErr *pae, void *closure);
1051#endif
1052
1062 typedef struct jsDirectGetMsgOptions
1063{
1064 uint64_t Sequence;
1065 const char *NextBySubject;
1066 const char *LastBySubject;
1067
1068} jsDirectGetMsgOptions;
1069
1075 typedef struct jsFetchRequest
1076{
1077 int64_t Expires;
1078 int Batch;
1079 int64_t MaxBytes;
1080 bool NoWait;
1081 int64_t Heartbeat;
1082
1083} jsFetchRequest;
1084
1090 typedef struct jsOptions
1091{
1092 const char *Prefix;
1093 const char *Domain;
1094 int64_t Wait;
1095
1099 struct jsOptionsPublishAsync
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.
1108 jsPubAckHandler AckHandler;
1109 void *AckHandlerClosure;
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).
1115 jsPubAckErrHandler ErrHandler;
1116 void *ErrHandlerClosure;
1117
1118 int64_t StallWait;
1119
1120 } PublishAsync;
1121
1128 struct jsOptionsStream
1129 {
1139 struct jsOptionsStreamPurge
1140 {
1141 const char *Subject;
1142 uint64_t Sequence;
1143 uint64_t Keep;
1144
1145 } Purge;
1146
1150 struct jsOptionsStreamInfo
1151 {
1152 bool DeletedDetails;
1153 const char *SubjectsFilter;
1154
1155 } Info;
1156
1157 } Stream;
1158
1159} jsOptions;
1160
1164 typedef struct __kvStore kvStore;
1165
1169 typedef struct __kvEntry kvEntry;
1170
1174 typedef struct __kvStatus kvStatus;
1175
1179 typedef struct __kvWatcher kvWatcher;
1180
1184 typedef enum
1185{
1186 kvOp_Unknown = 0,
1187 kvOp_Put,
1188 kvOp_Delete,
1189 kvOp_Purge,
1190
1191} kvOperation;
1192
1198 typedef struct kvConfig
1199{
1200 const char *Bucket;
1201 const char *Description;
1202 int32_t MaxValueSize;
1203 uint8_t History;
1204 int64_t TTL;
1205 int64_t MaxBytes;
1206 jsStorageType StorageType;
1207 int Replicas;
1208 jsRePublish *RePublish;
1209 jsStreamSource *Mirror;
1210 jsStreamSource **Sources;
1211 int SourcesLen;
1212
1213} kvConfig;
1214
1220 typedef struct kvWatchOptions
1221{
1222 bool IgnoreDeletes;
1223 bool IncludeHistory;
1224 bool MetaOnly;
1225 int64_t Timeout;
1226
1227} kvWatchOptions;
1228
1234 typedef 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.
1247 int64_t DeleteMarkersOlderThan;
1248
1249} kvPurgeOptions;
1250
1268 typedef struct kvEntryList
1269{
1270 kvEntry **Entries;
1271 int Count;
1272
1273} kvEntryList;
1274
1292 typedef struct kvKeysList
1293{
1294 char **Keys;
1295 int Count;
1296
1297} kvKeysList;
1298
1299#if defined(NATS_HAS_STREAMING)
1304 typedef struct __stanConnection stanConnection;
1305
1310 typedef struct __stanSubscription stanSubscription;
1311
1316 typedef struct __stanMsg stanMsg;
1317
1322 typedef struct __stanConnOptions stanConnOptions;
1323
1328 typedef struct __stanSubOptions stanSubOptions;
1329#endif
1330 // end of typesGroup
1332
1333//
1334// Callbacks.
1335//
1336
1359 typedef void (*natsMsgHandler)(
1360 natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure);
1361
1375 typedef void (*natsConnectionHandler)(
1376 natsConnection *nc, void *closure);
1377
1384 typedef void (*natsErrHandler)(
1385 natsConnection *nc, natsSubscription *subscription, natsStatus err,
1386 void *closure);
1387
1401 typedef natsStatus (*natsEvLoop_Attach)(
1402 void **userData,
1403 void *loop,
1404 natsConnection *nc,
1405 natsSock socket);
1406
1416 typedef natsStatus (*natsEvLoop_ReadAddRemove)(
1417 void *userData,
1418 bool add);
1419
1429 typedef natsStatus (*natsEvLoop_WriteAddRemove)(
1430 void *userData,
1431 bool add);
1432
1440 typedef natsStatus (*natsEvLoop_Detach)(
1441 void *userData);
1442
1464 typedef natsStatus (*natsUserJWTHandler)(
1465 char **userJWT,
1466 char **customErrTxt,
1467 void *closure);
1468
1469
1495 typedef natsStatus (*natsSignatureHandler)(
1496 char **customErrTxt,
1497 unsigned char **signature,
1498 int *signatureLength,
1499 const char *nonce,
1500 void *closure);
1501
1510 typedef const char* (*natsTokenHandler)(void *closure);
1511
1512
1520 typedef void (*natsOnCompleteCB)(void *closure);
1521
1542 typedef int64_t (*natsCustomReconnectDelayHandler)(natsConnection *nc, int attempts, void *closure);
1543
1544#ifdef BUILD_IN_DOXYGEN
1578 typedef void (*jsPubAckErrHandler)(jsCtx *js, jsPubAckErr *pae, void *closure);
1579
1621 typedef void (*jsPubAckHandler)(jsCtx *js, natsMsg *msg, jsPubAck *pa, jsPubAckErr *pae, void *closure);
1622#endif
1623
1624#if defined(NATS_HAS_STREAMING)
1633 typedef void (*stanPubAckHandler)(const char *guid, const char *error, void *closure);
1634
1644 typedef void (*stanMsgHandler)(
1645 stanConnection *sc, stanSubscription *sub, const char *channel, stanMsg *msg, void *closure);
1646
1653 typedef void (*stanConnectionLostHandler)(
1654 stanConnection *sc, const char* errorTxt, void *closure);
1655#endif
1656 // end of callbacksGroup
1658
1659//
1660// Functions.
1661//
1687 NATS_EXTERN natsStatus
1688 nats_Open(int64_t lockSpinCount);
1689
1690
1695 NATS_EXTERN const char*
1696 nats_GetVersion(void);
1697
1705 NATS_EXTERN uint32_t
1706 nats_GetVersionNumber(void);
1707
1708#ifdef BUILD_IN_DOXYGEN
1723 NATS_EXTERN bool nats_CheckCompatibility(void);
1724#else
1725
1726#define nats_CheckCompatibility() nats_CheckCompatibilityImpl(NATS_VERSION_REQUIRED_NUMBER, \
1727 NATS_VERSION_NUMBER, \
1728 NATS_VERSION_STRING)
1729
1730 NATS_EXTERN bool
1731nats_CheckCompatibilityImpl(uint32_t reqVerNumber, uint32_t verNumber, const char *verString);
1732
1733#endif
1734
1739 NATS_EXTERN int64_t
1740 nats_Now(void);
1741
1747 NATS_EXTERN int64_t
1748 nats_NowInNanoSeconds(void);
1749
1757 NATS_EXTERN void
1758 nats_Sleep(int64_t sleepTime);
1759
1772 NATS_EXTERN const char*
1773 nats_GetLastError(natsStatus *status);
1774
1783 NATS_EXTERN natsStatus
1784 nats_GetLastErrorStack(char *buffer, size_t bufLen);
1785
1806 NATS_EXTERN void
1807 nats_PrintLastErrorStack(FILE *file);
1808
1838 NATS_EXTERN natsStatus
1839 nats_SetMessageDeliveryPoolSize(int max);
1840
1851 NATS_EXTERN void
1852 nats_ReleaseThreadMemory(void);
1853
1878 NATS_EXTERN natsStatus
1879 nats_Sign(const char *encodedSeed,
1880 const char *input,
1881 unsigned char **signature,
1882 int *signatureLength);
1883
1904 NATS_EXTERN void
1905 nats_Close(void);
1906
1952 NATS_EXTERN natsStatus
1953 nats_CloseAndWait(int64_t timeout);
1954 // end of libraryGroup
1956
1972 NATS_EXTERN const char*
1973 natsStatus_GetText(natsStatus s);
1974 // end of statusGroup
1976
1994 NATS_EXTERN natsStatus
1995 natsStatistics_Create(natsStatistics **newStats);
1996
2013 NATS_EXTERN natsStatus
2014 natsStatistics_GetCounts(const natsStatistics *stats,
2015 uint64_t *inMsgs, uint64_t *inBytes,
2016 uint64_t *outMsgs, uint64_t *outBytes,
2017 uint64_t *reconnects);
2018
2025 NATS_EXTERN void
2026 natsStatistics_Destroy(natsStatistics *stats);
2027 // end of statsGroup
2029
2054 NATS_EXTERN natsStatus
2055 natsOptions_Create(natsOptions **newOpts);
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 */
2085 NATS_EXTERN natsStatus
2086 natsOptions_SetURL(natsOptions *opts, const char *url);
2087
2102 NATS_EXTERN natsStatus
2103 natsOptions_SetServers(natsOptions *opts, const char** servers, int serversCount);
2104
2130 NATS_EXTERN natsStatus
2131 natsOptions_SetUserInfo(natsOptions *opts, const char *user, const char *password);
2132
2157 NATS_EXTERN natsStatus
2158 natsOptions_SetToken(natsOptions *opts, const char *token);
2159
2175 NATS_EXTERN natsStatus
2176 natsOptions_SetTokenHandler(natsOptions *opts, natsTokenHandler tokenCb,
2177 void *closure);
2178
2188 NATS_EXTERN natsStatus
2189 natsOptions_SetNoRandomize(natsOptions *opts, bool noRandomize);
2190
2203 NATS_EXTERN natsStatus
2204 natsOptions_SetTimeout(natsOptions *opts, int64_t timeout);
2205
2213 NATS_EXTERN natsStatus
2214 natsOptions_SetName(natsOptions *opts, const char *name);
2215
2225 NATS_EXTERN natsStatus
2226 natsOptions_SetSecure(natsOptions *opts, bool secure);
2227
2241 NATS_EXTERN natsStatus
2242 natsOptions_LoadCATrustedCertificates(natsOptions *opts, const char *fileName);
2243
2269 NATS_EXTERN natsStatus
2270 natsOptions_SetCATrustedCertificates(natsOptions *opts, const char *certificates);
2271
2286 NATS_EXTERN natsStatus
2287 natsOptions_LoadCertificatesChain(natsOptions *opts,
2288 const char *certsFileName,
2289 const char *keyFileName);
2290
2302 NATS_EXTERN natsStatus
2303 natsOptions_SetCertificatesChain(natsOptions *opts,
2304 const char *cert,
2305 const char *key);
2306
2322 NATS_EXTERN natsStatus
2323 natsOptions_SetCiphers(natsOptions *opts, const char *ciphers);
2324
2338 NATS_EXTERN natsStatus
2339 natsOptions_SetCipherSuites(natsOptions *opts, const char *ciphers);
2340
2350 NATS_EXTERN natsStatus
2351 natsOptions_SetExpectedHostname(natsOptions *opts, const char *hostname);
2352
2363 NATS_EXTERN natsStatus
2364 natsOptions_SkipServerVerification(natsOptions *opts, bool skip);
2365
2376 NATS_EXTERN natsStatus
2377 natsOptions_SetVerbose(natsOptions *opts, bool verbose);
2378
2389 NATS_EXTERN natsStatus
2390 natsOptions_SetPedantic(natsOptions *opts, bool pedantic);
2391
2401 NATS_EXTERN natsStatus
2402 natsOptions_SetPingInterval(natsOptions *opts, int64_t interval);
2403
2415 NATS_EXTERN natsStatus
2416 natsOptions_SetMaxPingsOut(natsOptions *opts, int maxPingsOut);
2417
2429 NATS_EXTERN natsStatus
2430 natsOptions_SetIOBufSize(natsOptions *opts, int ioBufSize);
2431
2443 NATS_EXTERN natsStatus
2444 natsOptions_SetAllowReconnect(natsOptions *opts, bool allow);
2445
2453 NATS_EXTERN natsStatus
2454 natsOptions_SetMaxReconnect(natsOptions *opts, int maxReconnect);
2455
2469 NATS_EXTERN natsStatus
2470 natsOptions_SetReconnectWait(natsOptions *opts, int64_t reconnectWait);
2471
2495 NATS_EXTERN natsStatus
2496 natsOptions_SetReconnectJitter(natsOptions *opts, int64_t jitter, int64_t jitterTLS);
2497
2516 NATS_EXTERN natsStatus
2517 natsOptions_SetCustomReconnectDelay(natsOptions *opts,
2518 natsCustomReconnectDelayHandler cb,
2519 void *closure);
2520
2533 NATS_EXTERN natsStatus
2534 natsOptions_SetReconnectBufSize(natsOptions *opts, int reconnectBufSize);
2535
2549 NATS_EXTERN natsStatus
2550 natsOptions_SetMaxPendingMsgs(natsOptions *opts, int maxPending);
2551
2566 NATS_EXTERN natsStatus
2567 natsOptions_SetErrorHandler(natsOptions *opts, natsErrHandler errHandler,
2568 void *closure);
2569
2582 NATS_EXTERN natsStatus
2583 natsOptions_SetClosedCB(natsOptions *opts, natsConnectionHandler closedCb,
2584 void *closure);
2585
2602 NATS_EXTERN natsStatus
2603 natsOptions_SetDisconnectedCB(natsOptions *opts,
2604 natsConnectionHandler disconnectedCb,
2605 void *closure);
2606
2622 NATS_EXTERN natsStatus
2623 natsOptions_SetReconnectedCB(natsOptions *opts,
2624 natsConnectionHandler reconnectedCb,
2625 void *closure);
2626
2641 NATS_EXTERN natsStatus
2642 natsOptions_SetDiscoveredServersCB(natsOptions *opts,
2643 natsConnectionHandler discoveredServersCb,
2644 void *closure);
2645
2659 NATS_EXTERN natsStatus
2660 natsOptions_SetIgnoreDiscoveredServers(natsOptions *opts, bool ignore);
2661
2678 NATS_EXTERN natsStatus
2679 natsOptions_SetLameDuckModeCB(natsOptions *opts,
2680 natsConnectionHandler lameDuckCb,
2681 void *closure);
2682
2700 NATS_EXTERN natsStatus
2701 natsOptions_SetEventLoop(natsOptions *opts,
2702 void *loop,
2703 natsEvLoop_Attach attachCb,
2704 natsEvLoop_ReadAddRemove readCb,
2705 natsEvLoop_WriteAddRemove writeCb,
2706 natsEvLoop_Detach detachCb);
2707
2730 NATS_EXTERN natsStatus
2731 natsOptions_UseGlobalMessageDelivery(natsOptions *opts, bool global);
2732
2755 NATS_EXTERN natsStatus
2756 natsOptions_IPResolutionOrder(natsOptions *opts, int order);
2757
2785 NATS_EXTERN natsStatus
2786 natsOptions_SetSendAsap(natsOptions *opts, bool sendAsap);
2787
2797 NATS_EXTERN natsStatus
2798 natsOptions_UseOldRequestStyle(natsOptions *opts, bool useOldStyle);
2799
2814 NATS_EXTERN natsStatus
2815 natsOptions_SetFailRequestsOnDisconnect(natsOptions *opts, bool failRequests);
2816
2835 NATS_EXTERN natsStatus
2836 natsOptions_SetNoEcho(natsOptions *opts, bool noEcho);
2837
2891 NATS_EXTERN natsStatus
2892 natsOptions_SetRetryOnFailedConnect(natsOptions *opts, bool retry,
2893 natsConnectionHandler connectedCb, void* closure);
2894
2923 NATS_EXTERN natsStatus
2924 natsOptions_SetUserCredentialsCallbacks(natsOptions *opts,
2925 natsUserJWTHandler ujwtCB,
2926 void *ujwtClosure,
2927 natsSignatureHandler sigCB,
2928 void *sigClosure);
2929
2968 NATS_EXTERN natsStatus
2969 natsOptions_SetUserCredentialsFromFiles(natsOptions *opts,
2970 const char *userOrChainedFile,
2971 const char *seedFile);
2972
2985 NATS_EXTERN natsStatus
2986 natsOptions_SetUserCredentialsFromMemory(natsOptions *opts,
2987 const char *jwtAndSeedContent);
2988
3012 NATS_EXTERN natsStatus
3013 natsOptions_SetNKey(natsOptions *opts,
3014 const char *pubKey,
3015 natsSignatureHandler sigCB,
3016 void *sigClosure);
3017
3042 NATS_EXTERN natsStatus
3043 natsOptions_SetNKeyFromSeed(natsOptions *opts,
3044 const char *pubKey,
3045 const char *seedFile);
3046
3060 NATS_EXTERN natsStatus
3061 natsOptions_SetWriteDeadline(natsOptions *opts, int64_t deadline);
3062
3097 NATS_EXTERN natsStatus
3098 natsOptions_DisableNoResponders(natsOptions *opts, bool disabled);
3099
3115 NATS_EXTERN natsStatus
3116 natsOptions_SetCustomInboxPrefix(natsOptions *opts, const char *inboxPrefix);
3117
3131 NATS_EXTERN natsStatus
3132 natsOptions_SetMessageBufferPadding(natsOptions *opts, int paddingSize);
3133
3141 NATS_EXTERN void
3142 natsOptions_Destroy(natsOptions *opts);
3143 // end of optsGroup
3145
3146#if defined(NATS_HAS_STREAMING)
3180 NATS_EXTERN natsStatus
3181 stanConnOptions_Create(stanConnOptions **newOpts);
3182
3204 NATS_EXTERN natsStatus
3205 stanConnOptions_SetURL(stanConnOptions *opts, const char *url);
3206
3223 NATS_EXTERN natsStatus
3224 stanConnOptions_SetNATSOptions(stanConnOptions *opts, natsOptions *nOpts);
3225
3235 NATS_EXTERN natsStatus
3236 stanConnOptions_SetConnectionWait(stanConnOptions *opts, int64_t wait);
3237
3247 NATS_EXTERN natsStatus
3248 stanConnOptions_SetPubAckWait(stanConnOptions *opts, int64_t wait);
3249
3257 NATS_EXTERN natsStatus
3258 stanConnOptions_SetDiscoveryPrefix(stanConnOptions *opts, const char *prefix);
3259
3260
3275 NATS_EXTERN natsStatus
3276 stanConnOptions_SetMaxPubAcksInflight(stanConnOptions *opts, int maxPubAcksInflight, float percentage);
3277
3293 NATS_EXTERN natsStatus
3294 stanConnOptions_SetPings(stanConnOptions *opts, int interval, int maxOut);
3295
3306 NATS_EXTERN natsStatus
3307 stanConnOptions_SetConnectionLostHandler(stanConnOptions *opts, stanConnectionLostHandler handler, void *closure);
3308
3316 NATS_EXTERN void
3317 stanConnOptions_Destroy(stanConnOptions *opts);
3318 // end of stanConnOptsGroup
3320
3351 NATS_EXTERN natsStatus
3352 stanSubOptions_Create(stanSubOptions **newOpts);
3353
3372 NATS_EXTERN natsStatus
3373 stanSubOptions_SetDurableName(stanSubOptions *opts, const char *durableName);
3374
3388 NATS_EXTERN natsStatus
3389 stanSubOptions_SetAckWait(stanSubOptions *opts, int64_t wait);
3390
3402 NATS_EXTERN natsStatus
3403 stanSubOptions_SetMaxInflight(stanSubOptions *opts, int maxInflight);
3404
3420 NATS_EXTERN natsStatus
3421 stanSubOptions_StartAtSequence(stanSubOptions *opts, uint64_t seq);
3422
3437 NATS_EXTERN natsStatus
3438 stanSubOptions_StartAtTime(stanSubOptions *opts, int64_t time);
3439
3451 NATS_EXTERN natsStatus
3452 stanSubOptions_StartAtTimeDelta(stanSubOptions *opts, int64_t delta);
3453
3462 NATS_EXTERN natsStatus
3463 stanSubOptions_StartWithLastReceived(stanSubOptions *opts);
3464
3472 NATS_EXTERN natsStatus
3473 stanSubOptions_DeliverAllAvailable(stanSubOptions *opts);
3474
3489 NATS_EXTERN natsStatus
3490 stanSubOptions_SetManualAckMode(stanSubOptions *opts, bool manual);
3491
3499 NATS_EXTERN void
3500 stanSubOptions_Destroy(stanSubOptions *opts);
3501 // end of stanSubOptsGroup
3503#endif
3504
3524 NATS_EXTERN natsStatus
3525 natsInbox_Create(natsInbox **newInbox);
3526
3533 NATS_EXTERN void
3534 natsInbox_Destroy(natsInbox *inbox);
3535 // end of inboxGroup
3537
3556 NATS_EXTERN void
3557 natsMsgList_Destroy(natsMsgList *list);
3558
3576 NATS_EXTERN natsStatus
3577 natsMsg_Create(natsMsg **newMsg, const char *subj, const char *reply,
3578 const char *data, int dataLen);
3579
3588 NATS_EXTERN const char*
3589 natsMsg_GetSubject(const natsMsg *msg);
3590
3600 NATS_EXTERN const char*
3601 natsMsg_GetReply(const natsMsg *msg);
3602
3618 NATS_EXTERN const char*
3619 natsMsg_GetData(const natsMsg *msg);
3620
3627 NATS_EXTERN int
3628 natsMsg_GetDataLength(const natsMsg *msg);
3629
3645 NATS_EXTERN natsStatus
3646 natsMsgHeader_Set(natsMsg *msg, const char *key, const char *value);
3647
3663 NATS_EXTERN natsStatus
3664 natsMsgHeader_Add(natsMsg *msg, const char *key, const char *value);
3665
3684 NATS_EXTERN natsStatus
3685 natsMsgHeader_Get(natsMsg *msg, const char *key, const char **value);
3686
3720 NATS_EXTERN natsStatus
3721 natsMsgHeader_Values(natsMsg *msg, const char *key, const char* **values, int *count);
3722
3752 NATS_EXTERN natsStatus
3753 natsMsgHeader_Keys(natsMsg *msg, const char* **keys, int *count);
3754
3768 NATS_EXTERN natsStatus
3769 natsMsgHeader_Delete(natsMsg *msg, const char *key);
3770
3796 NATS_EXTERN bool
3797 natsMsg_IsNoResponders(natsMsg *msg);
3798
3805 NATS_EXTERN void
3806 natsMsg_Destroy(natsMsg *msg);
3807 // end of msgGroup
3809
3810#if defined(NATS_HAS_STREAMING)
3823 NATS_EXTERN uint64_t
3824 stanMsg_GetSequence(const stanMsg *msg);
3825
3832 NATS_EXTERN int64_t
3833 stanMsg_GetTimestamp(const stanMsg *msg);
3834
3843 NATS_EXTERN bool
3844 stanMsg_IsRedelivered(const stanMsg *msg);
3845
3861 NATS_EXTERN const char*
3862 stanMsg_GetData(const stanMsg *msg);
3863
3870 NATS_EXTERN int
3871 stanMsg_GetDataLength(const stanMsg *msg);
3872
3879 NATS_EXTERN void
3880 stanMsg_Destroy(stanMsg *msg);
3881 // end of stanMsgGroup
3883#endif
3884
3915 NATS_EXTERN natsStatus
3916 natsConnection_Connect(natsConnection **nc, natsOptions *options);
3917
3928 NATS_EXTERN void
3929 natsConnection_ProcessReadEvent(natsConnection *nc);
3930
3941 NATS_EXTERN void
3942 natsConnection_ProcessWriteEvent(natsConnection *nc);
3943
3962 NATS_EXTERN natsStatus
3963 natsConnection_ConnectTo(natsConnection **nc, const char *urls);
3964
3971 NATS_EXTERN bool
3972 natsConnection_IsClosed(natsConnection *nc);
3973
3980 NATS_EXTERN bool
3981 natsConnection_IsReconnecting(natsConnection *nc);
3982
3989 bool
3990 natsConnection_IsDraining(natsConnection *nc);
3991
4000 NATS_EXTERN natsConnStatus
4001 natsConnection_Status(natsConnection *nc);
4002
4014 NATS_EXTERN int
4015 natsConnection_Buffered(natsConnection *nc);
4016
4032 NATS_EXTERN natsStatus
4033 natsConnection_Flush(natsConnection *nc);
4034
4047 NATS_EXTERN natsStatus
4048 natsConnection_FlushTimeout(natsConnection *nc, int64_t timeout);
4049
4059 NATS_EXTERN int64_t
4060 natsConnection_GetMaxPayload(natsConnection *nc);
4061
4071 NATS_EXTERN natsStatus
4072 natsConnection_GetStats(natsConnection *nc, natsStatistics *stats);
4073
4083 NATS_EXTERN natsStatus
4084 natsConnection_GetConnectedUrl(natsConnection *nc, char *buffer, size_t bufferSize);
4085
4095 NATS_EXTERN natsStatus
4096 natsConnection_GetConnectedServerId(natsConnection *nc, char *buffer, size_t bufferSize);
4097
4118 NATS_EXTERN natsStatus
4119 natsConnection_GetServers(natsConnection *nc, char ***servers, int *count);
4120
4141 NATS_EXTERN natsStatus
4142 natsConnection_GetDiscoveredServers(natsConnection *nc, char ***servers, int *count);
4143
4156 NATS_EXTERN natsStatus
4157 natsConnection_GetLastError(natsConnection *nc, const char **lastError);
4158
4172 NATS_EXTERN natsStatus
4173 natsConnection_GetClientID(natsConnection *nc, uint64_t *cid);
4174
4193 NATS_EXTERN natsStatus
4194 natsConnection_Drain(natsConnection *nc);
4195
4213 NATS_EXTERN natsStatus
4214 natsConnection_DrainTimeout(natsConnection *nc, int64_t timeout);
4215
4228 NATS_EXTERN natsStatus
4229 natsConnection_Sign(natsConnection *nc,
4230 const unsigned char *message, int messageLen,
4231 unsigned char sig[64]);
4232
4251 NATS_EXTERN natsStatus
4252 natsConnection_GetClientIP(natsConnection *nc, char **ip);
4253
4264 NATS_EXTERN natsStatus
4265 natsConnection_GetRTT(natsConnection *nc, int64_t *rtt);
4266
4274 NATS_EXTERN natsStatus
4275 natsConnection_HasHeaderSupport(natsConnection *nc);
4276
4296 natsStatus
4297 natsConnection_GetLocalIPAndPort(natsConnection *nc, char **ip, int *port);
4298
4308 NATS_EXTERN void
4309 natsConnection_Close(natsConnection *nc);
4310
4318 NATS_EXTERN void
4319 natsConnection_Destroy(natsConnection *nc);
4320 // end of connMgtGroup
4322
4339 NATS_EXTERN natsStatus
4340 natsConnection_Publish(natsConnection *nc, const char *subj,
4341 const void *data, int dataLen);
4342
4357 NATS_EXTERN natsStatus
4358 natsConnection_PublishString(natsConnection *nc, const char *subj,
4359 const char *str);
4360
4371 NATS_EXTERN natsStatus
4372 natsConnection_PublishMsg(natsConnection *nc, natsMsg *msg);
4373
4386 NATS_EXTERN natsStatus
4387 natsConnection_PublishRequest(natsConnection *nc, const char *subj,
4388 const char *reply, const void *data, int dataLen);
4389
4406 NATS_EXTERN natsStatus
4407 natsConnection_PublishRequestString(natsConnection *nc, const char *subj,
4408 const char *reply, const char *str);
4409
4427 NATS_EXTERN natsStatus
4428 natsConnection_Request(natsMsg **replyMsg, natsConnection *nc, const char *subj,
4429 const void *data, int dataLen, int64_t timeout);
4430
4452 NATS_EXTERN natsStatus
4453 natsConnection_RequestString(natsMsg **replyMsg, natsConnection *nc,
4454 const char *subj, const char *str,
4455 int64_t timeout);
4456
4471 NATS_EXTERN natsStatus
4472 natsConnection_RequestMsg(natsMsg **replyMsg, natsConnection *nc,
4473 natsMsg *requestMsg, int64_t timeout);
4474 // end of connPubGroup
4476
4497 NATS_EXTERN natsStatus
4498 natsConnection_Subscribe(natsSubscription **sub, natsConnection *nc,
4499 const char *subject, natsMsgHandler cb,
4500 void *cbClosure);
4501
4532 NATS_EXTERN natsStatus
4533 natsConnection_SubscribeTimeout(natsSubscription **sub, natsConnection *nc,
4534 const char *subject, int64_t timeout,
4535 natsMsgHandler cb, void *cbClosure);
4536
4547 NATS_EXTERN natsStatus
4548 natsConnection_SubscribeSync(natsSubscription **sub, natsConnection *nc,
4549 const char *subject);
4550
4568 NATS_EXTERN natsStatus
4569 natsConnection_QueueSubscribe(natsSubscription **sub, natsConnection *nc,
4570 const char *subject, const char *queueGroup,
4571 natsMsgHandler cb, void *cbClosure);
4572
4605 NATS_EXTERN natsStatus
4606 natsConnection_QueueSubscribeTimeout(natsSubscription **sub, natsConnection *nc,
4607 const char *subject, const char *queueGroup,
4608 int64_t timeout, natsMsgHandler cb, void *cbClosure);
4609
4621 NATS_EXTERN natsStatus
4622 natsConnection_QueueSubscribeSync(natsSubscription **sub, natsConnection *nc,
4623 const char *subject, const char *queueGroup);
4624 // end of connSubGroup
4626 // end of connGroup
4628
4647 NATS_EXTERN natsStatus
4648 natsSubscription_NoDeliveryDelay(natsSubscription *sub);
4649
4672 NATS_EXTERN natsStatus
4673 natsSubscription_NextMsg(natsMsg **nextMsg, natsSubscription *sub,
4674 int64_t timeout);
4675
4684 NATS_EXTERN natsStatus
4685 natsSubscription_Unsubscribe(natsSubscription *sub);
4686
4698 NATS_EXTERN natsStatus
4699 natsSubscription_AutoUnsubscribe(natsSubscription *sub, int max);
4700
4710 NATS_EXTERN natsStatus
4711 natsSubscription_QueuedMsgs(natsSubscription *sub, uint64_t *queuedMsgs);
4712
4721 NATS_EXTERN int64_t
4722 natsSubscription_GetID(natsSubscription* sub);
4723
4734 NATS_EXTERN const char*
4735 natsSubscription_GetSubject(natsSubscription* sub);
4736
4757 NATS_EXTERN natsStatus
4758 natsSubscription_SetPendingLimits(natsSubscription *sub, int msgLimit, int bytesLimit);
4759
4779 NATS_EXTERN natsStatus
4780 natsSubscription_GetPendingLimits(natsSubscription *sub, int *msgLimit, int *bytesLimit);
4781
4796 NATS_EXTERN natsStatus
4797 natsSubscription_GetPending(natsSubscription *sub, int *msgs, int *bytes);
4798
4807 NATS_EXTERN natsStatus
4808 natsSubscription_GetDelivered(natsSubscription *sub, int64_t *msgs);
4809
4825 NATS_EXTERN natsStatus
4826 natsSubscription_GetDropped(natsSubscription *sub, int64_t *msgs);
4827
4840 NATS_EXTERN natsStatus
4841 natsSubscription_GetMaxPending(natsSubscription *sub, int *msgs, int *bytes);
4842
4849 NATS_EXTERN natsStatus
4850 natsSubscription_ClearMaxPending(natsSubscription *sub);
4851
4878 NATS_EXTERN natsStatus
4879 natsSubscription_GetStats(natsSubscription *sub,
4880 int *pendingMsgs,
4881 int *pendingBytes,
4882 int *maxPendingMsgs,
4883 int *maxPendingBytes,
4884 int64_t *deliveredMsgs,
4885 int64_t *droppedMsgs);
4886
4895 NATS_EXTERN bool
4896 natsSubscription_IsValid(natsSubscription *sub);
4897
4915 NATS_EXTERN natsStatus
4916 natsSubscription_Drain(natsSubscription *sub);
4917
4968 NATS_EXTERN natsStatus
4969 natsSubscription_DrainTimeout(natsSubscription *sub, int64_t timeout);
4970
4993 NATS_EXTERN natsStatus
4994 natsSubscription_WaitForDrainCompletion(natsSubscription *sub, int64_t timeout);
4995
5021 NATS_EXTERN natsStatus
5022 natsSubscription_DrainCompletionStatus(natsSubscription *sub);
5023
5052 NATS_EXTERN natsStatus
5053 natsSubscription_SetOnCompleteCB(natsSubscription *sub, natsOnCompleteCB cb, void *closure);
5054
5062 NATS_EXTERN void
5063 natsSubscription_Destroy(natsSubscription *sub);
5064 // end of subGroup
5066
5067#if defined(NATS_HAS_STREAMING)
5108 NATS_EXTERN natsStatus
5109 stanConnection_Connect(stanConnection **sc, const char *clusterID, const char *clientID,
5110 stanConnOptions *options);
5111
5134 NATS_EXTERN natsStatus
5135 stanConnection_GetNATSConnection(stanConnection *sc, natsConnection **nc);
5136
5161 NATS_EXTERN void
5162 stanConnection_ReleaseNATSConnection(stanConnection *sc);
5163
5174 NATS_EXTERN natsStatus
5175 stanConnection_Close(stanConnection *sc);
5176
5184 NATS_EXTERN natsStatus
5185 stanConnection_Destroy(stanConnection *sc);
5186 // end of stanConnMgtGroup
5188
5205 NATS_EXTERN natsStatus
5206 stanConnection_Publish(stanConnection *sc, const char *channel,
5207 const void *data, int dataLen);
5208
5232 NATS_EXTERN natsStatus
5233 stanConnection_PublishAsync(stanConnection *sc, const char *channel,
5234 const void *data, int dataLen,
5235 stanPubAckHandler ah, void *ahClosure);
5236 // end of stanConnPubGroup
5238
5261 NATS_EXTERN natsStatus
5262 stanConnection_Subscribe(stanSubscription **sub, stanConnection *sc,
5263 const char *channel, stanMsgHandler cb,
5264 void *cbClosure, stanSubOptions *options);
5265
5285 NATS_EXTERN natsStatus
5286 stanConnection_QueueSubscribe(stanSubscription **sub, stanConnection *sc,
5287 const char *channel, const char *queueGroup,
5288 stanMsgHandler cb, void *cbClosure, stanSubOptions *options);
5289 // end of stanConnSubGroup
5291 // end of stanConnGroup
5293
5322 NATS_EXTERN natsStatus
5323 stanSubscription_SetOnCompleteCB(stanSubscription *sub, natsOnCompleteCB cb, void *closure);
5324
5334 NATS_EXTERN natsStatus
5335 stanSubscription_AckMsg(stanSubscription *sub, stanMsg *msg);
5336
5356 NATS_EXTERN natsStatus
5357 stanSubscription_Unsubscribe(stanSubscription *sub);
5358
5369 NATS_EXTERN natsStatus
5370 stanSubscription_Close(stanSubscription *sub);
5371
5379 NATS_EXTERN void
5380 stanSubscription_Destroy(stanSubscription *sub);
5381 // end of stanSubGroup
5383#endif
5384
5398 NATS_EXTERN natsStatus
5399 jsOptions_Init(jsOptions *opts);
5400
5415 NATS_EXTERN natsStatus
5416 natsConnection_JetStream(jsCtx **js, natsConnection *nc, jsOptions *opts);
5417
5424 NATS_EXTERN void
5425 jsCtx_Destroy(jsCtx *js);
5426
5440 NATS_EXTERN natsStatus
5441 jsStreamConfig_Init(jsStreamConfig *cfg);
5442
5449 NATS_EXTERN natsStatus
5450 jsPlacement_Init(jsPlacement *placement);
5451
5458 NATS_EXTERN natsStatus
5459 jsStreamSource_Init(jsStreamSource *source);
5460
5467 NATS_EXTERN natsStatus
5468 jsExternalStream_Init(jsExternalStream *external);
5469
5476 NATS_EXTERN natsStatus
5477 jsRePublish_Init(jsRePublish *rp);
5478
5498 NATS_EXTERN natsStatus
5499 js_AddStream(jsStreamInfo **si, jsCtx *js, jsStreamConfig *cfg, jsOptions *opts, jsErrCode *errCode);
5500
5520 NATS_EXTERN natsStatus
5521 js_UpdateStream(jsStreamInfo **si, jsCtx *js, jsStreamConfig *cfg, jsOptions *opts, jsErrCode *errCode);
5522
5545 NATS_EXTERN natsStatus
5546 js_PurgeStream(jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
5547
5558 NATS_EXTERN natsStatus
5559 js_DeleteStream(jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
5560
5578 NATS_EXTERN natsStatus
5579 js_GetMsg(natsMsg **msg, jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode);
5580
5598 NATS_EXTERN natsStatus
5599 js_GetLastMsg(natsMsg **msg, jsCtx *js, const char *stream, const char *subject, jsOptions *opts, jsErrCode *errCode);
5600
5608 NATS_EXTERN natsStatus
5609 jsDirectGetMsgOptions_Init(jsDirectGetMsgOptions *opts);
5610
5633 NATS_EXTERN natsStatus
5634 js_DirectGetMsg(natsMsg **msg, jsCtx *js, const char *stream, jsOptions *opts, jsDirectGetMsgOptions *dgOpts);
5635
5652 NATS_EXTERN natsStatus
5653 js_DeleteMsg(jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode);
5654
5669 NATS_EXTERN natsStatus
5670 js_EraseMsg(jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode);
5671
5698 NATS_EXTERN natsStatus
5699 js_GetStreamInfo(jsStreamInfo **si, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
5700
5707 NATS_EXTERN void
5708 jsStreamInfo_Destroy(jsStreamInfo *si);
5709
5724 NATS_EXTERN natsStatus
5725 js_Streams(jsStreamInfoList **list, jsCtx *js, jsOptions *opts, jsErrCode *errCode);
5726
5736 NATS_EXTERN void
5737 jsStreamInfoList_Destroy(jsStreamInfoList *list);
5738
5753 NATS_EXTERN natsStatus
5754 js_StreamNames(jsStreamNamesList **list, jsCtx *js, jsOptions *opts, jsErrCode *errCode);
5755
5765 NATS_EXTERN void
5766 jsStreamNamesList_Destroy(jsStreamNamesList *list);
5767
5776 NATS_EXTERN natsStatus
5777 jsConsumerConfig_Init(jsConsumerConfig *cc);
5778
5798 NATS_EXTERN natsStatus
5799 js_AddConsumer(jsConsumerInfo **ci, jsCtx *js,
5800 const char *stream, jsConsumerConfig *cfg,
5801 jsOptions *opts, jsErrCode *errCode);
5802
5822 NATS_EXTERN natsStatus
5823 js_UpdateConsumer(jsConsumerInfo **ci, jsCtx *js,
5824 const char *stream, jsConsumerConfig *cfg,
5825 jsOptions *opts, jsErrCode *errCode);
5826
5840 NATS_EXTERN natsStatus
5841 js_GetConsumerInfo(jsConsumerInfo **ci, jsCtx *js,
5842 const char *stream, const char *consumer,
5843 jsOptions *opts, jsErrCode *errCode);
5844
5856 NATS_EXTERN natsStatus
5857 js_DeleteConsumer(jsCtx *js, const char *stream, const char *consumer,
5858 jsOptions *opts, jsErrCode *errCode);
5859
5866 NATS_EXTERN void
5867 jsConsumerInfo_Destroy(jsConsumerInfo *ci);
5868
5883 NATS_EXTERN natsStatus
5884 js_Consumers(jsConsumerInfoList **list, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
5885
5895 NATS_EXTERN void
5896 jsConsumerInfoList_Destroy(jsConsumerInfoList *list);
5897
5912 NATS_EXTERN natsStatus
5913 js_ConsumerNames(jsConsumerNamesList **list, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode);
5914
5924 NATS_EXTERN void
5925 jsConsumerNamesList_Destroy(jsConsumerNamesList *list);
5926
5941 NATS_EXTERN natsStatus
5942 js_GetAccountInfo(jsAccountInfo **ai, jsCtx *js, jsOptions *opts, jsErrCode *errCode);
5943
5950 NATS_EXTERN void
5951 jsAccountInfo_Destroy(jsAccountInfo *ai);
5952 // end of jsAssetsGroup
5954
5968 NATS_EXTERN natsStatus
5969 jsPubOptions_Init(jsPubOptions *opts);
5970
5986 NATS_EXTERN natsStatus
5987 js_Publish(jsPubAck **pubAck, jsCtx *js, const char *subj, const void *data, int dataLen,
5988 jsPubOptions *opts, jsErrCode *errCode);
5989
6009 NATS_EXTERN natsStatus
6010 js_PublishMsg(jsPubAck **pubAck, jsCtx *js, natsMsg *msg,
6011 jsPubOptions *opts, jsErrCode *errCode);
6012
6019 NATS_EXTERN void
6020 jsPubAck_Destroy(jsPubAck *pubAck);
6021
6032 NATS_EXTERN natsStatus
6033 js_PublishAsync(jsCtx *js, const char *subj, const void *data, int dataLen,
6034 jsPubOptions *opts);
6035
6059 NATS_EXTERN natsStatus
6060 js_PublishMsgAsync(jsCtx *js, natsMsg **msg, jsPubOptions *opts);
6061
6073 NATS_EXTERN natsStatus
6074 js_PublishAsyncComplete(jsCtx *js, jsPubOptions *opts);
6075
6124 NATS_EXTERN natsStatus
6125 js_PublishAsyncGetPendingList(natsMsgList *pending, jsCtx *js);
6126 // end of jsPubGroup
6128
6142 NATS_EXTERN natsStatus
6143 jsSubOptions_Init(jsSubOptions *opts);
6144
6190 NATS_EXTERN natsStatus
6191 js_Subscribe(natsSubscription **sub, jsCtx *js, const char *subject,
6192 natsMsgHandler cb, void* cbClosure,
6193 jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode);
6194
6209 NATS_EXTERN natsStatus
6210 js_SubscribeSync(natsSubscription **sub, jsCtx *js, const char *subject,
6211 jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode);
6212
6234 NATS_EXTERN natsStatus
6235 js_PullSubscribe(natsSubscription **sub, jsCtx *js, const char *subject, const char *durable,
6236 jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode);
6237
6256 NATS_EXTERN natsStatus
6257 natsSubscription_Fetch(natsMsgList *list, natsSubscription *sub, int batch, int64_t timeout,
6258 jsErrCode *errCode);
6259
6266 NATS_EXTERN natsStatus
6267 jsFetchRequest_Init(jsFetchRequest *request);
6268
6281 NATS_EXTERN natsStatus
6282 natsSubscription_FetchRequest(natsMsgList *list, natsSubscription *sub, jsFetchRequest *request);
6283
6294 NATS_EXTERN natsStatus
6295 natsSubscription_GetConsumerInfo(jsConsumerInfo **ci, natsSubscription *sub,
6296 jsOptions *opts, jsErrCode *errCode);
6297
6325 NATS_EXTERN natsStatus
6326 natsSubscription_GetSequenceMismatch(jsConsumerSequenceMismatch *csm, natsSubscription *sub);
6327 // end of jsSubGroup
6329
6350 NATS_EXTERN natsStatus
6351 natsMsg_GetMetaData(jsMsgMetaData **new_meta, natsMsg *msg);
6352
6359 NATS_EXTERN void
6360 jsMsgMetaData_Destroy(jsMsgMetaData *meta);
6361
6370 NATS_EXTERN natsStatus
6371 natsMsg_Ack(natsMsg *msg, jsOptions *opts);
6372
6384 NATS_EXTERN natsStatus
6385 natsMsg_AckSync(natsMsg *msg, jsOptions *opts, jsErrCode *errCode);
6386
6397 NATS_EXTERN natsStatus
6398 natsMsg_Nak(natsMsg *msg, jsOptions *opts);
6399
6412 NATS_EXTERN natsStatus
6413 natsMsg_NakWithDelay(natsMsg *msg, int64_t delay, jsOptions *opts);
6414
6423 NATS_EXTERN natsStatus
6424 natsMsg_InProgress(natsMsg *msg, jsOptions *opts);
6425
6434 NATS_EXTERN natsStatus
6435 natsMsg_Term(natsMsg *msg, jsOptions *opts);
6436
6446 NATS_EXTERN uint64_t
6447 natsMsg_GetSequence(natsMsg *msg);
6448
6458 NATS_EXTERN int64_t
6459 natsMsg_GetTime(natsMsg *msg);
6460 // end of jsMsg
6462 // end of jsGroup
6464
6493 NATS_EXTERN natsStatus
6494 kvConfig_Init(kvConfig *cfg);
6495
6510 NATS_EXTERN natsStatus
6511 js_CreateKeyValue(kvStore **new_kv, jsCtx *js, kvConfig *cfg);
6512
6528 NATS_EXTERN natsStatus
6529 js_KeyValue(kvStore **new_kv, jsCtx *js, const char *bucket);
6530
6540 NATS_EXTERN natsStatus
6541 js_DeleteKeyValue(jsCtx *js, const char *bucket);
6542
6550 NATS_EXTERN void
6551 kvStore_Destroy(kvStore *kv);
6552 // end of kvGroupMgt
6554
6571 NATS_EXTERN const char*
6572 kvEntry_Bucket(kvEntry *e);
6573
6580 NATS_EXTERN const char*
6581 kvEntry_Key(kvEntry *e);
6582
6589 NATS_EXTERN const void*
6590 kvEntry_Value(kvEntry *e);
6591
6598 NATS_EXTERN int
6599 kvEntry_ValueLen(kvEntry *e);
6600
6608 NATS_EXTERN const char*
6609 kvEntry_ValueString(kvEntry *e);
6610
6617 NATS_EXTERN uint64_t
6618 kvEntry_Revision(kvEntry *e);
6619
6626 NATS_EXTERN int64_t
6627 kvEntry_Created(kvEntry *e);
6628
6638 NATS_EXTERN uint64_t
6639 kvEntry_Delta(kvEntry *e);
6640
6649 NATS_EXTERN kvOperation
6650 kvEntry_Operation(kvEntry *e);
6651
6658 NATS_EXTERN void
6659 kvEntry_Destroy(kvEntry *e);
6660 // end of kvEntry
6662
6673 NATS_EXTERN natsStatus
6674 kvStore_Get(kvEntry **new_entry, kvStore *kv, const char *key);
6675
6688 NATS_EXTERN natsStatus
6689 kvStore_GetRevision(kvEntry **new_entry, kvStore *kv, const char *key, uint64_t revision);
6690
6701 NATS_EXTERN natsStatus
6702 kvStore_Put(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len);
6703
6717 NATS_EXTERN natsStatus
6718 kvStore_PutString(uint64_t *rev, kvStore *kv, const char *key, const char *data);
6719
6730 NATS_EXTERN natsStatus
6731 kvStore_Create(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len);
6732
6746 NATS_EXTERN natsStatus
6747 kvStore_CreateString(uint64_t *rev, kvStore *kv, const char *key, const char *data);
6748
6760 NATS_EXTERN natsStatus
6761 kvStore_Update(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len, uint64_t last);
6762
6777 NATS_EXTERN natsStatus
6778 kvStore_UpdateString(uint64_t *rev, kvStore *kv, const char *key, const char *data, uint64_t last);
6779
6787 NATS_EXTERN natsStatus
6788 kvStore_Delete(kvStore *kv, const char *key);
6789
6798 NATS_EXTERN natsStatus
6799 kvStore_Purge(kvStore *kv, const char *key, kvPurgeOptions *opts);
6800
6808 NATS_EXTERN natsStatus
6809 kvWatchOptions_Init(kvWatchOptions *opts);
6810
6818 NATS_EXTERN natsStatus
6819 kvPurgeOptions_Init(kvPurgeOptions *opts);
6820
6838 NATS_EXTERN natsStatus
6839 kvStore_PurgeDeletes(kvStore *kv, kvPurgeOptions *opts);
6840
6857 NATS_EXTERN natsStatus
6858 kvStore_Watch(kvWatcher **new_watcher, kvStore *kv, const char *keys, kvWatchOptions *opts);
6859
6874 NATS_EXTERN natsStatus
6875 kvStore_WatchAll(kvWatcher **new_watcher, kvStore *kv, kvWatchOptions *opts);
6876
6895 NATS_EXTERN natsStatus
6896 kvStore_Keys(kvKeysList *list, kvStore *kv, kvWatchOptions *opts);
6897
6909 NATS_EXTERN void
6910 kvKeysList_Destroy(kvKeysList *list);
6911
6934 NATS_EXTERN natsStatus
6935 kvStore_History(kvEntryList *list, kvStore *kv, const char *key, kvWatchOptions *opts);
6936
6948 NATS_EXTERN void
6949 kvEntryList_Destroy(kvEntryList *list);
6950
6960 NATS_EXTERN const char*
6961 kvStore_Bucket(kvStore *kv);
6962
6963// PurgeDeletes
6964
6974 NATS_EXTERN natsStatus
6975 kvStore_Status(kvStatus **new_status, kvStore *kv);
6976
7002 NATS_EXTERN natsStatus
7003 kvWatcher_Next(kvEntry **new_entry, kvWatcher *w, int64_t timeout);
7004
7014 NATS_EXTERN natsStatus
7015 kvWatcher_Stop(kvWatcher *w);
7016
7023 NATS_EXTERN void
7024 kvWatcher_Destroy(kvWatcher *w);
7025 // end of kvWatcher
7027
7044 NATS_EXTERN const char*
7045 kvStatus_Bucket(kvStatus *sts);
7046
7053 NATS_EXTERN uint64_t
7054 kvStatus_Values(kvStatus *sts);
7055
7062 NATS_EXTERN int64_t
7063 kvStatus_History(kvStatus *sts);
7064
7071 NATS_EXTERN int64_t
7072 kvStatus_TTL(kvStatus *sts);
7073
7080 NATS_EXTERN int64_t
7081 kvStatus_Replicas(kvStatus *sts);
7082
7089 NATS_EXTERN uint64_t
7090 kvStatus_Bytes(kvStatus *sts);
7091
7098 NATS_EXTERN void
7099 kvStatus_Destroy(kvStatus *sts);
7100 // end of kvStatus
7102 // end of kvGroup
7104 // end of funcGroup
7106
7143#ifdef __cplusplus
7144}
7145#endif
7146
7147#endif /* NATS_H_ */
natsOnCompleteCB
void(* natsOnCompleteCB)(void *closure)
Callback used to notify that an object lifecycle is complete.
Definition: nats.h:1520
natsEvLoop_Attach
natsStatus(* natsEvLoop_Attach)(void **userData, void *loop, natsConnection *nc, natsSock socket)
Attach this connection to the external event loop.
Definition: nats.h:1401
natsUserJWTHandler
natsStatus(* natsUserJWTHandler)(char **userJWT, char **customErrTxt, void *closure)
Callback used to fetch and return account signed user JWT.
Definition: nats.h:1464
natsEvLoop_WriteAddRemove
natsStatus(* natsEvLoop_WriteAddRemove)(void *userData, bool add)
Write event needs to be added or removed.
Definition: nats.h:1429
natsCustomReconnectDelayHandler
int64_t(* natsCustomReconnectDelayHandler)(natsConnection *nc, int attempts, void *closure)
Callback used to specify how long to wait between reconnects.
Definition: nats.h:1542
natsTokenHandler
const char *(* natsTokenHandler)(void *closure)
Callback used to build a token on connections and reconnections.
Definition: nats.h:1510
jsPubAckHandler
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
jsPubAckErrHandler
void(* jsPubAckErrHandler)(jsCtx *js, jsPubAckErr *pae, void *closure)
Callback used to process asynchronous publish errors from JetStream.
Definition: nats.h:1578
natsErrHandler
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
natsEvLoop_Detach
natsStatus(* natsEvLoop_Detach)(void *userData)
Detach from the event loop.
Definition: nats.h:1440
natsSignatureHandler
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
stanConnectionLostHandler
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
natsConnectionHandler
void(* natsConnectionHandler)(natsConnection *nc, void *closure)
Callback used to notify the user of asynchronous connection events.
Definition: nats.h:1375
natsMsgHandler
void(* natsMsgHandler)(natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure)
Callback used to deliver messages to the application.
Definition: nats.h:1359
stanPubAckHandler
void(* stanPubAckHandler)(const char *guid, const char *error, void *closure)
Callback used to notify of an asynchronous publish result.
Definition: nats.h:1633
natsEvLoop_ReadAddRemove
natsStatus(* natsEvLoop_ReadAddRemove)(void *userData, bool add)
Read event needs to be added or removed.
Definition: nats.h:1416
stanMsgHandler
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
natsConnection_Buffered
NATS_EXTERN int natsConnection_Buffered(natsConnection *nc)
Returns the number of bytes to be sent to the server.
natsConnection_IsDraining
bool natsConnection_IsDraining(natsConnection *nc)
Test if connection is draining.
natsConnection_Close
NATS_EXTERN void natsConnection_Close(natsConnection *nc)
Closes the connection.
natsConnection_Flush
NATS_EXTERN natsStatus natsConnection_Flush(natsConnection *nc)
Flushes the connection.
natsConnection_Status
NATS_EXTERN natsConnStatus natsConnection_Status(natsConnection *nc)
Returns the current state of the connection.
natsConnection_GetConnectedServerId
NATS_EXTERN natsStatus natsConnection_GetConnectedServerId(natsConnection *nc, char *buffer, size_t bufferSize)
Gets the server Id.
natsConnection_IsClosed
NATS_EXTERN bool natsConnection_IsClosed(natsConnection *nc)
Test if connection has been closed.
natsConnection_Drain
NATS_EXTERN natsStatus natsConnection_Drain(natsConnection *nc)
Drains the connection with default timeout.
natsConnection_IsReconnecting
NATS_EXTERN bool natsConnection_IsReconnecting(natsConnection *nc)
Test if connection is reconnecting.
natsConnection_GetStats
NATS_EXTERN natsStatus natsConnection_GetStats(natsConnection *nc, natsStatistics *stats)
Gets the connection statistics.
natsConnection_GetMaxPayload
NATS_EXTERN int64_t natsConnection_GetMaxPayload(natsConnection *nc)
Returns the maximum message payload.
natsConnection_Sign
NATS_EXTERN natsStatus natsConnection_Sign(natsConnection *nc, const unsigned char *message, int messageLen, unsigned char sig[64])
Signs any 'message' using the connection's user credentials.
natsConnection_Connect
NATS_EXTERN natsStatus natsConnection_Connect(natsConnection **nc, natsOptions *options)
Connects to a NATS Server using the provided options.
natsConnection_GetClientID
NATS_EXTERN natsStatus natsConnection_GetClientID(natsConnection *nc, uint64_t *cid)
Gets the current client ID assigned by the server.
natsConnection_GetLocalIPAndPort
natsStatus natsConnection_GetLocalIPAndPort(natsConnection *nc, char **ip, int *port)
Returns the connection local IP and port.
natsConnection_FlushTimeout
NATS_EXTERN natsStatus natsConnection_FlushTimeout(natsConnection *nc, int64_t timeout)
Flushes the connection with a given timeout.
natsConnection_GetRTT
NATS_EXTERN natsStatus natsConnection_GetRTT(natsConnection *nc, int64_t *rtt)
Returns the round trip time between this client and the server.
natsConnection_ProcessReadEvent
NATS_EXTERN void natsConnection_ProcessReadEvent(natsConnection *nc)
Process a read event when using external event loop.
natsConnection_GetLastError
NATS_EXTERN natsStatus natsConnection_GetLastError(natsConnection *nc, const char **lastError)
Gets the last connection error.
natsConnection_GetDiscoveredServers
NATS_EXTERN natsStatus natsConnection_GetDiscoveredServers(natsConnection *nc, char ***servers, int *count)
Returns the list of discovered server URLs.
natsConnection_HasHeaderSupport
NATS_EXTERN natsStatus natsConnection_HasHeaderSupport(natsConnection *nc)
Returns if the connection to current server supports headers.
natsConnection_ProcessWriteEvent
NATS_EXTERN void natsConnection_ProcessWriteEvent(natsConnection *nc)
Process a write event when using external event loop.
natsConnection_GetClientIP
NATS_EXTERN natsStatus natsConnection_GetClientIP(natsConnection *nc, char **ip)
Returns the client's IP address as reported by the server.
natsConnection_DrainTimeout
NATS_EXTERN natsStatus natsConnection_DrainTimeout(natsConnection *nc, int64_t timeout)
Drains the connection with given timeout.
natsConnection_GetServers
NATS_EXTERN natsStatus natsConnection_GetServers(natsConnection *nc, char ***servers, int *count)
Returns the list of server URLs known to this connection.
natsConnection_GetConnectedUrl
NATS_EXTERN natsStatus natsConnection_GetConnectedUrl(natsConnection *nc, char *buffer, size_t bufferSize)
Gets the URL of the currently connected server.
natsConnection_ConnectTo
NATS_EXTERN natsStatus natsConnection_ConnectTo(natsConnection **nc, const char *urls)
Connects to a NATS Server using any of the URL from the given list.
natsConnection_Destroy
NATS_EXTERN void natsConnection_Destroy(natsConnection *nc)
Destroys the connection object.
natsConnection_RequestMsg
NATS_EXTERN natsStatus natsConnection_RequestMsg(natsMsg **replyMsg, natsConnection *nc, natsMsg *requestMsg, int64_t timeout)
Sends a request based on the given requestMsg and waits for a reply.
natsConnection_RequestString
NATS_EXTERN natsStatus natsConnection_RequestString(natsMsg **replyMsg, natsConnection *nc, const char *subj, const char *str, int64_t timeout)
Sends a request (as a string) and waits for a reply.
natsConnection_PublishMsg
NATS_EXTERN natsStatus natsConnection_PublishMsg(natsConnection *nc, natsMsg *msg)
Publishes a message on a subject.
natsConnection_PublishRequest
NATS_EXTERN natsStatus natsConnection_PublishRequest(natsConnection *nc, const char *subj, const char *reply, const void *data, int dataLen)
Publishes data on a subject expecting replies on the given reply.
natsConnection_PublishRequestString
NATS_EXTERN natsStatus natsConnection_PublishRequestString(natsConnection *nc, const char *subj, const char *reply, const char *str)
Publishes a string on a subject expecting replies on the given reply.
natsConnection_Publish
NATS_EXTERN natsStatus natsConnection_Publish(natsConnection *nc, const char *subj, const void *data, int dataLen)
Publishes data on a subject.
natsConnection_PublishString
NATS_EXTERN natsStatus natsConnection_PublishString(natsConnection *nc, const char *subj, const char *str)
Publishes a string on a subject.
natsConnection_Request
NATS_EXTERN natsStatus natsConnection_Request(natsMsg **replyMsg, natsConnection *nc, const char *subj, const void *data, int dataLen, int64_t timeout)
Sends a request and waits for a reply.
natsConnection_SubscribeSync
NATS_EXTERN natsStatus natsConnection_SubscribeSync(natsSubscription **sub, natsConnection *nc, const char *subject)
Creates a synchronous subcription.
natsConnection_QueueSubscribe
NATS_EXTERN natsStatus natsConnection_QueueSubscribe(natsSubscription **sub, natsConnection *nc, const char *subject, const char *queueGroup, natsMsgHandler cb, void *cbClosure)
Creates an asynchronous queue subscriber.
natsConnection_QueueSubscribeSync
NATS_EXTERN natsStatus natsConnection_QueueSubscribeSync(natsSubscription **sub, natsConnection *nc, const char *subject, const char *queueGroup)
Creates a synchronous queue subscriber.
natsConnection_QueueSubscribeTimeout
NATS_EXTERN natsStatus natsConnection_QueueSubscribeTimeout(natsSubscription **sub, natsConnection *nc, const char *subject, const char *queueGroup, int64_t timeout, natsMsgHandler cb, void *cbClosure)
Creates an asynchronous queue subscriber with a timeout.
natsConnection_SubscribeTimeout
NATS_EXTERN natsStatus natsConnection_SubscribeTimeout(natsSubscription **sub, natsConnection *nc, const char *subject, int64_t timeout, natsMsgHandler cb, void *cbClosure)
Creates an asynchronous subscription with a timeout.
natsConnection_Subscribe
NATS_EXTERN natsStatus natsConnection_Subscribe(natsSubscription **sub, natsConnection *nc, const char *subject, natsMsgHandler cb, void *cbClosure)
Creates an asynchronous subscription.
natsInbox_Create
NATS_EXTERN natsStatus natsInbox_Create(natsInbox **newInbox)
Creates an inbox.
natsInbox_Destroy
NATS_EXTERN void natsInbox_Destroy(natsInbox *inbox)
Destroys the inbox.
jsPlacement_Init
NATS_EXTERN natsStatus jsPlacement_Init(jsPlacement *placement)
Initializes a placement configuration structure.
jsConsumerNamesList_Destroy
NATS_EXTERN void jsConsumerNamesList_Destroy(jsConsumerNamesList *list)
Destroys the consumer names list object.
js_GetConsumerInfo
NATS_EXTERN natsStatus js_GetConsumerInfo(jsConsumerInfo **ci, jsCtx *js, const char *stream, const char *consumer, jsOptions *opts, jsErrCode *errCode)
Retrieves information about a consumer.
jsConsumerConfig_Init
NATS_EXTERN natsStatus jsConsumerConfig_Init(jsConsumerConfig *cc)
Initializes a consumer configuration structure.
jsRePublish_Init
NATS_EXTERN natsStatus jsRePublish_Init(jsRePublish *rp)
Initializes a republish structure.
jsStreamInfoList_Destroy
NATS_EXTERN void jsStreamInfoList_Destroy(jsStreamInfoList *list)
Destroys the stream information list object.
js_DeleteStream
NATS_EXTERN natsStatus js_DeleteStream(jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode)
Deletes a stream.
jsConsumerInfoList_Destroy
NATS_EXTERN void jsConsumerInfoList_Destroy(jsConsumerInfoList *list)
Destroys the consumer information list object.
js_DeleteConsumer
NATS_EXTERN natsStatus js_DeleteConsumer(jsCtx *js, const char *stream, const char *consumer, jsOptions *opts, jsErrCode *errCode)
Deletes a consumer.
js_Streams
NATS_EXTERN natsStatus js_Streams(jsStreamInfoList **list, jsCtx *js, jsOptions *opts, jsErrCode *errCode)
Retrieves the list of all available streams.
js_PurgeStream
NATS_EXTERN natsStatus js_PurgeStream(jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode)
Purges a stream.
js_AddStream
NATS_EXTERN natsStatus js_AddStream(jsStreamInfo **si, jsCtx *js, jsStreamConfig *cfg, jsOptions *opts, jsErrCode *errCode)
Creates a stream.
js_DirectGetMsg
NATS_EXTERN natsStatus js_DirectGetMsg(natsMsg **msg, jsCtx *js, const char *stream, jsOptions *opts, jsDirectGetMsgOptions *dgOpts)
Retrieves directly a JetStream message based on provided options.
js_GetLastMsg
NATS_EXTERN natsStatus js_GetLastMsg(natsMsg **msg, jsCtx *js, const char *stream, const char *subject, jsOptions *opts, jsErrCode *errCode)
Retrieves the last JetStream message from the stream for a given subject.
js_ConsumerNames
NATS_EXTERN natsStatus js_ConsumerNames(jsConsumerNamesList **list, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode)
Retrieves the list of all available consumer names for a stream.
js_EraseMsg
NATS_EXTERN natsStatus js_EraseMsg(jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode)
Erases a message from the stream.
js_UpdateStream
NATS_EXTERN natsStatus js_UpdateStream(jsStreamInfo **si, jsCtx *js, jsStreamConfig *cfg, jsOptions *opts, jsErrCode *errCode)
Updates a stream.
jsAccountInfo_Destroy
NATS_EXTERN void jsAccountInfo_Destroy(jsAccountInfo *ai)
Destroys the account information object.
jsStreamSource_Init
NATS_EXTERN natsStatus jsStreamSource_Init(jsStreamSource *source)
Initializes a stream source configuration structure.
jsExternalStream_Init
NATS_EXTERN natsStatus jsExternalStream_Init(jsExternalStream *external)
Initializes an external stream configuration structure.
jsDirectGetMsgOptions_Init
NATS_EXTERN natsStatus jsDirectGetMsgOptions_Init(jsDirectGetMsgOptions *opts)
Initializes a direct get message options structure.
jsStreamInfo_Destroy
NATS_EXTERN void jsStreamInfo_Destroy(jsStreamInfo *si)
Destroys the stream information object.
js_GetStreamInfo
NATS_EXTERN natsStatus js_GetStreamInfo(jsStreamInfo **si, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode)
Retreives information from a stream.
jsConsumerInfo_Destroy
NATS_EXTERN void jsConsumerInfo_Destroy(jsConsumerInfo *ci)
Destroys the consumer information object.
js_GetMsg
NATS_EXTERN natsStatus js_GetMsg(natsMsg **msg, jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode)
Retrieves a JetStream message from the stream by sequence.
jsStreamConfig_Init
NATS_EXTERN natsStatus jsStreamConfig_Init(jsStreamConfig *cfg)
Initializes a streaming configuration structure.
js_StreamNames
NATS_EXTERN natsStatus js_StreamNames(jsStreamNamesList **list, jsCtx *js, jsOptions *opts, jsErrCode *errCode)
Retrieves the list of all available stream names.
js_GetAccountInfo
NATS_EXTERN natsStatus js_GetAccountInfo(jsAccountInfo **ai, jsCtx *js, jsOptions *opts, jsErrCode *errCode)
Retrieves information about the JetStream usage from an account.
js_UpdateConsumer
NATS_EXTERN natsStatus js_UpdateConsumer(jsConsumerInfo **ci, jsCtx *js, const char *stream, jsConsumerConfig *cfg, jsOptions *opts, jsErrCode *errCode)
Updates a JetStream consumer.
js_DeleteMsg
NATS_EXTERN natsStatus js_DeleteMsg(jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode)
Deletes a message from the stream.
js_Consumers
NATS_EXTERN natsStatus js_Consumers(jsConsumerInfoList **list, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode)
Retrieves the list of all available consumers for a stream.
js_AddConsumer
NATS_EXTERN natsStatus js_AddConsumer(jsConsumerInfo **ci, jsCtx *js, const char *stream, jsConsumerConfig *cfg, jsOptions *opts, jsErrCode *errCode)
Adds a JetStream consumer.
jsStreamNamesList_Destroy
NATS_EXTERN void jsStreamNamesList_Destroy(jsStreamNamesList *list)
Destroys the stream names list object.
jsOptions_Init
NATS_EXTERN natsStatus jsOptions_Init(jsOptions *opts)
Initializes a streaming context options structure.
natsConnection_JetStream
NATS_EXTERN natsStatus natsConnection_JetStream(jsCtx **js, natsConnection *nc, jsOptions *opts)
Returns a new JetStream context.
jsCtx_Destroy
NATS_EXTERN void jsCtx_Destroy(jsCtx *js)
Destroys the JetStream context.
natsMsg_GetSequence
NATS_EXTERN uint64_t natsMsg_GetSequence(natsMsg *msg)
Returns the sequence number of this JetStream message.
natsMsg_GetTime
NATS_EXTERN int64_t natsMsg_GetTime(natsMsg *msg)
Returns the timestamp (in UTC) of this JetStream message.
natsMsg_NakWithDelay
NATS_EXTERN natsStatus natsMsg_NakWithDelay(natsMsg *msg, int64_t delay, jsOptions *opts)
Negatively acknowledges a message.
natsMsg_Nak
NATS_EXTERN natsStatus natsMsg_Nak(natsMsg *msg, jsOptions *opts)
Negatively acknowledges a message.
natsMsg_GetMetaData
NATS_EXTERN natsStatus natsMsg_GetMetaData(jsMsgMetaData **new_meta, natsMsg *msg)
Returns metadata from this JetStream message.
natsMsg_InProgress
NATS_EXTERN natsStatus natsMsg_InProgress(natsMsg *msg, jsOptions *opts)
Resets redelivery timer on the server.
natsMsg_Ack
NATS_EXTERN natsStatus natsMsg_Ack(natsMsg *msg, jsOptions *opts)
Acknowledges a message.
natsMsg_Term
NATS_EXTERN natsStatus natsMsg_Term(natsMsg *msg, jsOptions *opts)
Abandon this message.
jsMsgMetaData_Destroy
NATS_EXTERN void jsMsgMetaData_Destroy(jsMsgMetaData *meta)
Destroys the message metadata object.
natsMsg_AckSync
NATS_EXTERN natsStatus natsMsg_AckSync(natsMsg *msg, jsOptions *opts, jsErrCode *errCode)
Acknowledges a message and wait for a confirmation.
js_PublishAsync
NATS_EXTERN natsStatus js_PublishAsync(jsCtx *js, const char *subj, const void *data, int dataLen, jsPubOptions *opts)
Publishes data to JetStream but does not wait for a jsPubAck.
js_PublishAsyncComplete
NATS_EXTERN natsStatus js_PublishAsyncComplete(jsCtx *js, jsPubOptions *opts)
Wait for all outstanding messages to be acknowledged.
js_PublishAsyncGetPendingList
NATS_EXTERN natsStatus js_PublishAsyncGetPendingList(natsMsgList *pending, jsCtx *js)
Returns the list of pending messages published asynchronously.
js_PublishMsg
NATS_EXTERN natsStatus js_PublishMsg(jsPubAck **pubAck, jsCtx *js, natsMsg *msg, jsPubOptions *opts, jsErrCode *errCode)
Publishes a message to JetStream.
jsPubAck_Destroy
NATS_EXTERN void jsPubAck_Destroy(jsPubAck *pubAck)
Destroys the publish acknowledgment object.
js_PublishMsgAsync
NATS_EXTERN natsStatus js_PublishMsgAsync(jsCtx *js, natsMsg **msg, jsPubOptions *opts)
Publishes a message to JetStream but does not wait for a jsPubAck.
js_Publish
NATS_EXTERN natsStatus js_Publish(jsPubAck **pubAck, jsCtx *js, const char *subj, const void *data, int dataLen, jsPubOptions *opts, jsErrCode *errCode)
Publishes data on a subject to JetStream.
jsPubOptions_Init
NATS_EXTERN natsStatus jsPubOptions_Init(jsPubOptions *opts)
Initializes a publish options structure.
natsSubscription_GetSequenceMismatch
NATS_EXTERN natsStatus natsSubscription_GetSequenceMismatch(jsConsumerSequenceMismatch *csm, natsSubscription *sub)
Returns the consumer sequence mismatch information.
jsFetchRequest_Init
NATS_EXTERN natsStatus jsFetchRequest_Init(jsFetchRequest *request)
Initializes a fetch request options structure.
jsSubOptions_Init
NATS_EXTERN natsStatus jsSubOptions_Init(jsSubOptions *opts)
Initializes a subscribe options structure.
natsSubscription_FetchRequest
NATS_EXTERN natsStatus natsSubscription_FetchRequest(natsMsgList *list, natsSubscription *sub, jsFetchRequest *request)
Fetches messages for a pull subscription with a complete request configuration.
js_Subscribe
NATS_EXTERN natsStatus js_Subscribe(natsSubscription **sub, jsCtx *js, const char *subject, natsMsgHandler cb, void *cbClosure, jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode)
Create an asynchronous subscription.
natsSubscription_GetConsumerInfo
NATS_EXTERN natsStatus natsSubscription_GetConsumerInfo(jsConsumerInfo **ci, natsSubscription *sub, jsOptions *opts, jsErrCode *errCode)
Returns the jsConsumerInfo associated with this subscription.
js_PullSubscribe
NATS_EXTERN natsStatus js_PullSubscribe(natsSubscription **sub, jsCtx *js, const char *subject, const char *durable, jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode)
Create a pull subscriber.
js_SubscribeSync
NATS_EXTERN natsStatus js_SubscribeSync(natsSubscription **sub, jsCtx *js, const char *subject, jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode)
Create a synchronous subscription.
natsSubscription_Fetch
NATS_EXTERN natsStatus natsSubscription_Fetch(natsMsgList *list, natsSubscription *sub, int batch, int64_t timeout, jsErrCode *errCode)
Fetches messages for a pull subscription.
kvEntry_Operation
NATS_EXTERN kvOperation kvEntry_Operation(kvEntry *e)
Returns the type of operation of this value.
kvEntry_Delta
NATS_EXTERN uint64_t kvEntry_Delta(kvEntry *e)
Returns the distance from the latest value.
kvEntry_Value
NATS_EXTERN const void * kvEntry_Value(kvEntry *e)
Returns the value for this key.
kvEntry_Revision
NATS_EXTERN uint64_t kvEntry_Revision(kvEntry *e)
Returns the unique sequence for this value.
kvEntry_Created
NATS_EXTERN int64_t kvEntry_Created(kvEntry *e)
Returns the time (in UTC) the data was put in the bucket.
kvEntry_ValueString
NATS_EXTERN const char * kvEntry_ValueString(kvEntry *e)
Returns the value, as a string, for this key.
kvEntry_Destroy
NATS_EXTERN void kvEntry_Destroy(kvEntry *e)
Destroys the KeyValue entry object.
kvEntry_Key
NATS_EXTERN const char * kvEntry_Key(kvEntry *e)
Returns the name of the key that was retrieved.
kvEntry_Bucket
NATS_EXTERN const char * kvEntry_Bucket(kvEntry *e)
Returns the name of the bucket the data was loaded from.
kvEntry_ValueLen
NATS_EXTERN int kvEntry_ValueLen(kvEntry *e)
Returns the value length for this key.
kvKeysList_Destroy
NATS_EXTERN void kvKeysList_Destroy(kvKeysList *list)
Destroys this list of KeyValue store key strings.
kvStore_UpdateString
NATS_EXTERN natsStatus kvStore_UpdateString(uint64_t *rev, kvStore *kv, const char *key, const char *data, uint64_t last)
Updates the value (as a string) for the key into the store if and only if the latest revision matches...
kvStore_Put
NATS_EXTERN natsStatus kvStore_Put(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len)
Places the new value for the key into the store.
kvPurgeOptions_Init
NATS_EXTERN natsStatus kvPurgeOptions_Init(kvPurgeOptions *opts)
Initializes a KeyValue purge options structure.
kvStore_Get
NATS_EXTERN natsStatus kvStore_Get(kvEntry **new_entry, kvStore *kv, const char *key)
Returns the latest entry for the key.
kvStore_Watch
NATS_EXTERN natsStatus kvStore_Watch(kvWatcher **new_watcher, kvStore *kv, const char *keys, kvWatchOptions *opts)
Returns a watcher for any updates to keys that match the keys argument.
kvStore_PurgeDeletes
NATS_EXTERN natsStatus kvStore_PurgeDeletes(kvStore *kv, kvPurgeOptions *opts)
Purge and removes delete markers.
kvStore_Purge
NATS_EXTERN natsStatus kvStore_Purge(kvStore *kv, const char *key, kvPurgeOptions *opts)
Deletes a key by placing a purge marker and removing all revisions.
kvStore_Create
NATS_EXTERN natsStatus kvStore_Create(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len)
Places the value for the key into the store if and only if the key does not exist.
kvStore_CreateString
NATS_EXTERN natsStatus kvStore_CreateString(uint64_t *rev, kvStore *kv, const char *key, const char *data)
Places the value (as a string) for the key into the store if and only if the key does not exist.
kvStore_History
NATS_EXTERN natsStatus kvStore_History(kvEntryList *list, kvStore *kv, const char *key, kvWatchOptions *opts)
Returns all historical entries for the key.
kvStore_Keys
NATS_EXTERN natsStatus kvStore_Keys(kvKeysList *list, kvStore *kv, kvWatchOptions *opts)
Returns all keys in the bucket.
kvStore_Delete
NATS_EXTERN natsStatus kvStore_Delete(kvStore *kv, const char *key)
Deletes a key by placing a delete marker and leaving all revisions.
kvWatchOptions_Init
NATS_EXTERN natsStatus kvWatchOptions_Init(kvWatchOptions *opts)
Initializes a KeyValue watcher options structure.
kvStore_PutString
NATS_EXTERN natsStatus kvStore_PutString(uint64_t *rev, kvStore *kv, const char *key, const char *data)
Places the new value (as a string) for the key into the store.
kvStore_GetRevision
NATS_EXTERN natsStatus kvStore_GetRevision(kvEntry **new_entry, kvStore *kv, const char *key, uint64_t revision)
Returns the entry at the specific revision for the key.
kvStore_Bucket
NATS_EXTERN const char * kvStore_Bucket(kvStore *kv)
Returns the bucket name of this KeyValue store object.
kvStore_Status
NATS_EXTERN natsStatus kvStore_Status(kvStatus **new_status, kvStore *kv)
Returns the status and configuration of a bucket.
kvStore_Update
NATS_EXTERN natsStatus kvStore_Update(uint64_t *rev, kvStore *kv, const char *key, const void *data, int len, uint64_t last)
Updates the value for the key into the store if and only if the latest revision matches.
kvEntryList_Destroy
NATS_EXTERN void kvEntryList_Destroy(kvEntryList *list)
Destroys this list of KeyValue store entries.
kvStore_WatchAll
NATS_EXTERN natsStatus kvStore_WatchAll(kvWatcher **new_watcher, kvStore *kv, kvWatchOptions *opts)
Returns a watcher for any updates to any keys of the KeyValue store bucket.
kvConfig_Init
NATS_EXTERN natsStatus kvConfig_Init(kvConfig *cfg)
Initializes a KeyValue configuration structure.
js_KeyValue
NATS_EXTERN natsStatus js_KeyValue(kvStore **new_kv, jsCtx *js, const char *bucket)
Looks-up and binds to an existing KeyValue store.
js_DeleteKeyValue
NATS_EXTERN natsStatus js_DeleteKeyValue(jsCtx *js, const char *bucket)
Deletes a KeyValue store.
kvStore_Destroy
NATS_EXTERN void kvStore_Destroy(kvStore *kv)
Destroys a KeyValue store object.
js_CreateKeyValue
NATS_EXTERN natsStatus js_CreateKeyValue(kvStore **new_kv, jsCtx *js, kvConfig *cfg)
Creates a KeyValue store with a given configuration.
kvStatus_Bucket
NATS_EXTERN const char * kvStatus_Bucket(kvStatus *sts)
Returns the bucket name.
kvStatus_Values
NATS_EXTERN uint64_t kvStatus_Values(kvStatus *sts)
Returns how many messages are in the bucket, including historical values.
kvStatus_Destroy
NATS_EXTERN void kvStatus_Destroy(kvStatus *sts)
Destroys the KeyValue status object.
kvStatus_Bytes
NATS_EXTERN uint64_t kvStatus_Bytes(kvStatus *sts)
Returns the size (in bytes) of this bucket.
kvStatus_Replicas
NATS_EXTERN int64_t kvStatus_Replicas(kvStatus *sts)
Returns the number of replicas to keep for a bucket.
kvStatus_TTL
NATS_EXTERN int64_t kvStatus_TTL(kvStatus *sts)
Returns how long the bucket keeps values for.
kvStatus_History
NATS_EXTERN int64_t kvStatus_History(kvStatus *sts)
Returns the configured history kept per key.
kvWatcher_Destroy
NATS_EXTERN void kvWatcher_Destroy(kvWatcher *w)
Destroys the KeyValue watcher object.
kvWatcher_Next
NATS_EXTERN natsStatus kvWatcher_Next(kvEntry **new_entry, kvWatcher *w, int64_t timeout)
Returns the next entry for this watcher.
kvWatcher_Stop
NATS_EXTERN natsStatus kvWatcher_Stop(kvWatcher *w)
Stops the watcher.
nats_GetVersion
NATS_EXTERN const char * nats_GetVersion(void)
Returns the Library's version.
nats_Open
NATS_EXTERN natsStatus nats_Open(int64_t lockSpinCount)
Initializes the library.
nats_PrintLastErrorStack
NATS_EXTERN void nats_PrintLastErrorStack(FILE *file)
Prints the calling thread's last known error stack into the file.
nats_GetVersionNumber
NATS_EXTERN uint32_t nats_GetVersionNumber(void)
Returns the Library's version as a number.
nats_CheckCompatibility
NATS_EXTERN bool nats_CheckCompatibility(void)
Check that the header is compatible with the library.
nats_Now
NATS_EXTERN int64_t nats_Now(void)
Gives the current time in milliseconds.
nats_SetMessageDeliveryPoolSize
NATS_EXTERN natsStatus nats_SetMessageDeliveryPoolSize(int max)
Sets the maximum size of the global message delivery thread pool.
nats_GetLastErrorStack
NATS_EXTERN natsStatus nats_GetLastErrorStack(char *buffer, size_t bufLen)
Returns the calling thread's last known error stack.
nats_NowInNanoSeconds
NATS_EXTERN int64_t nats_NowInNanoSeconds(void)
Gives the current time in nanoseconds.
nats_Sleep
NATS_EXTERN void nats_Sleep(int64_t sleepTime)
Sleeps for a given number of milliseconds.
nats_GetLastError
NATS_EXTERN const char * nats_GetLastError(natsStatus *status)
Returns the calling thread's last known error.
nats_Close
NATS_EXTERN void nats_Close(void)
Tear down the library.
nats_CloseAndWait
NATS_EXTERN natsStatus nats_CloseAndWait(int64_t timeout)
Tear down the library and wait for all resources to be released.
nats_Sign
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_ReleaseThreadMemory
NATS_EXTERN void nats_ReleaseThreadMemory(void)
Release thread-local memory possibly allocated by the library.
natsMsg_Create
NATS_EXTERN natsStatus natsMsg_Create(natsMsg **newMsg, const char *subj, const char *reply, const char *data, int dataLen)
Creates a natsMsg object.
natsMsgList_Destroy
NATS_EXTERN void natsMsgList_Destroy(natsMsgList *list)
Destroys this list of messages.
natsMsg_GetDataLength
NATS_EXTERN int natsMsg_GetDataLength(const natsMsg *msg)
Returns the message length.
natsMsgHeader_Add
NATS_EXTERN natsStatus natsMsgHeader_Add(natsMsg *msg, const char *key, const char *value)
Add value to the header associated with key.
natsMsg_IsNoResponders
NATS_EXTERN bool natsMsg_IsNoResponders(natsMsg *msg)
Indicates if this message is a "no responders" message from the server.
natsMsg_GetData
NATS_EXTERN const char * natsMsg_GetData(const natsMsg *msg)
Returns the message payload.
natsMsgHeader_Keys
NATS_EXTERN natsStatus natsMsgHeader_Keys(natsMsg *msg, const char ***keys, int *count)
Get all header keys.
natsMsg_GetReply
NATS_EXTERN const char * natsMsg_GetReply(const natsMsg *msg)
Returns the reply set in this message.
natsMsg_Destroy
NATS_EXTERN void natsMsg_Destroy(natsMsg *msg)
Destroys the message object.
natsMsgHeader_Get
NATS_EXTERN natsStatus natsMsgHeader_Get(natsMsg *msg, const char *key, const char **value)
Get the header entry associated with key.
natsMsgHeader_Delete
NATS_EXTERN natsStatus natsMsgHeader_Delete(natsMsg *msg, const char *key)
Delete the value(s) associated with key.
natsMsg_GetSubject
NATS_EXTERN const char * natsMsg_GetSubject(const natsMsg *msg)
Returns the subject set in this message.
natsMsgHeader_Values
NATS_EXTERN natsStatus natsMsgHeader_Values(natsMsg *msg, const char *key, const char ***values, int *count)
Get all header values associated with key.
natsMsgHeader_Set
NATS_EXTERN natsStatus natsMsgHeader_Set(natsMsg *msg, const char *key, const char *value)
Set the header entries associated with key to the single element value.
natsOptions_SetNKey
NATS_EXTERN natsStatus natsOptions_SetNKey(natsOptions *opts, const char *pubKey, natsSignatureHandler sigCB, void *sigClosure)
Sets the NKey public key and signature callback.
natsOptions_SetExpectedHostname
NATS_EXTERN natsStatus natsOptions_SetExpectedHostname(natsOptions *opts, const char *hostname)
Sets the server certificate's expected hostname.
natsOptions_SetErrorHandler
NATS_EXTERN natsStatus natsOptions_SetErrorHandler(natsOptions *opts, natsErrHandler errHandler, void *closure)
Sets the error handler for asynchronous events.
natsOptions_SetTimeout
NATS_EXTERN natsStatus natsOptions_SetTimeout(natsOptions *opts, int64_t timeout)
Sets the (re)connect process timeout.
natsOptions_DisableNoResponders
NATS_EXTERN natsStatus natsOptions_DisableNoResponders(natsOptions *opts, bool disabled)
Enable/Disable the "no responders" feature.
natsOptions_SetIOBufSize
NATS_EXTERN natsStatus natsOptions_SetIOBufSize(natsOptions *opts, int ioBufSize)
Sets the size of the internal read/write buffers.
natsOptions_SetName
NATS_EXTERN natsStatus natsOptions_SetName(natsOptions *opts, const char *name)
Sets the name.
natsOptions_SetRetryOnFailedConnect
NATS_EXTERN natsStatus natsOptions_SetRetryOnFailedConnect(natsOptions *opts, bool retry, natsConnectionHandler connectedCb, void *closure)
Indicates if initial connect failure should be retried or not.
natsOptions_SetTokenHandler
NATS_EXTERN natsStatus natsOptions_SetTokenHandler(natsOptions *opts, natsTokenHandler tokenCb, void *closure)
Sets the tokenCb to use whenever a token is needed.
natsOptions_SetReconnectedCB
NATS_EXTERN natsStatus natsOptions_SetReconnectedCB(natsOptions *opts, natsConnectionHandler reconnectedCb, void *closure)
Sets the callback to be invoked when the connection has reconnected.
natsOptions_SetPedantic
NATS_EXTERN natsStatus natsOptions_SetPedantic(natsOptions *opts, bool pedantic)
Sets the pedantic mode.
natsOptions_SetReconnectWait
NATS_EXTERN natsStatus natsOptions_SetReconnectWait(natsOptions *opts, int64_t reconnectWait)
Sets the time between reconnect attempts.
natsOptions_SetCipherSuites
NATS_EXTERN natsStatus natsOptions_SetCipherSuites(natsOptions *opts, const char *ciphers)
Sets the list of available ciphers for TLSv1.3.
natsOptions_LoadCATrustedCertificates
NATS_EXTERN natsStatus natsOptions_LoadCATrustedCertificates(natsOptions *opts, const char *fileName)
Loads the trusted CA certificates from a file.
natsOptions_SetCustomReconnectDelay
NATS_EXTERN natsStatus natsOptions_SetCustomReconnectDelay(natsOptions *opts, natsCustomReconnectDelayHandler cb, void *closure)
Sets the handler to invoke when the library needs to wait before the next reconnect attempts.
natsOptions_LoadCertificatesChain
NATS_EXTERN natsStatus natsOptions_LoadCertificatesChain(natsOptions *opts, const char *certsFileName, const char *keyFileName)
Loads the certificate chain from a file, using the given key.
natsOptions_SetAllowReconnect
NATS_EXTERN natsStatus natsOptions_SetAllowReconnect(natsOptions *opts, bool allow)
Indicates if the connection will be allowed to reconnect.
natsOptions_SetURL
NATS_EXTERN natsStatus natsOptions_SetURL(natsOptions *opts, const char *url)
Sets the URL to connect to.
natsOptions_SetClosedCB
NATS_EXTERN natsStatus natsOptions_SetClosedCB(natsOptions *opts, natsConnectionHandler closedCb, void *closure)
Sets the callback to be invoked when a connection to a server is permanently lost.
natsOptions_SetNoEcho
NATS_EXTERN natsStatus natsOptions_SetNoEcho(natsOptions *opts, bool noEcho)
Sets if connection receives its own messages.
natsOptions_SetLameDuckModeCB
NATS_EXTERN natsStatus natsOptions_SetLameDuckModeCB(natsOptions *opts, natsConnectionHandler lameDuckCb, void *closure)
Sets the callback to be invoked when server enters lame duck mode.
natsOptions_SetCiphers
NATS_EXTERN natsStatus natsOptions_SetCiphers(natsOptions *opts, const char *ciphers)
Sets the list of available ciphers.
natsOptions_SetUserCredentialsFromFiles
NATS_EXTERN natsStatus natsOptions_SetUserCredentialsFromFiles(natsOptions *opts, const char *userOrChainedFile, const char *seedFile)
Sets the file(s) to use to fetch user JWT and seed required to sign nonce.
natsOptions_SetMessageBufferPadding
NATS_EXTERN natsStatus natsOptions_SetMessageBufferPadding(natsOptions *opts, int paddingSize)
Sets a custom padding when allocating buffer for incoming messages.
natsOptions_SetUserInfo
NATS_EXTERN natsStatus natsOptions_SetUserInfo(natsOptions *opts, const char *user, const char *password)
Sets the user name/password to use when not specified in the URL.
natsOptions_SetUserCredentialsFromMemory
NATS_EXTERN natsStatus natsOptions_SetUserCredentialsFromMemory(natsOptions *opts, const char *jwtAndSeedContent)
Sets JWT handler and handler to sign nonce that uses seed.
natsOptions_SetUserCredentialsCallbacks
NATS_EXTERN natsStatus natsOptions_SetUserCredentialsCallbacks(natsOptions *opts, natsUserJWTHandler ujwtCB, void *ujwtClosure, natsSignatureHandler sigCB, void *sigClosure)
Sets the callbacks to fetch user JWT and sign server's nonce.
natsOptions_Create
NATS_EXTERN natsStatus natsOptions_Create(natsOptions **newOpts)
Creates a natsOptions object.
natsOptions_SetNKeyFromSeed
NATS_EXTERN natsStatus natsOptions_SetNKeyFromSeed(natsOptions *opts, const char *pubKey, const char *seedFile)
Sets the NKey public key and its seed file.
natsOptions_SkipServerVerification
NATS_EXTERN natsStatus natsOptions_SkipServerVerification(natsOptions *opts, bool skip)
Switch server certificate verification.
natsOptions_UseOldRequestStyle
NATS_EXTERN natsStatus natsOptions_UseOldRequestStyle(natsOptions *opts, bool useOldStyle)
Switches the use of old style requests.
natsOptions_IPResolutionOrder
NATS_EXTERN natsStatus natsOptions_IPResolutionOrder(natsOptions *opts, int order)
Dictates the order in which host name are resolved during connect.
natsOptions_SetIgnoreDiscoveredServers
NATS_EXTERN natsStatus natsOptions_SetIgnoreDiscoveredServers(natsOptions *opts, bool ignore)
Sets if the library should ignore or not discovered servers.
natsOptions_SetSendAsap
NATS_EXTERN natsStatus natsOptions_SetSendAsap(natsOptions *opts, bool sendAsap)
Sets if Publish calls should send data right away.
natsOptions_SetReconnectJitter
NATS_EXTERN natsStatus natsOptions_SetReconnectJitter(natsOptions *opts, int64_t jitter, int64_t jitterTLS)
Set the upper bound of a random delay added to reconnect wait.
natsOptions_Destroy
NATS_EXTERN void natsOptions_Destroy(natsOptions *opts)
Destroys a natsOptions object.
natsOptions_SetMaxPendingMsgs
NATS_EXTERN natsStatus natsOptions_SetMaxPendingMsgs(natsOptions *opts, int maxPending)
Sets the maximum number of pending messages per subscription.
natsOptions_SetReconnectBufSize
NATS_EXTERN natsStatus natsOptions_SetReconnectBufSize(natsOptions *opts, int reconnectBufSize)
Sets the size of the backing buffer used during reconnect.
natsOptions_SetVerbose
NATS_EXTERN natsStatus natsOptions_SetVerbose(natsOptions *opts, bool verbose)
Sets the verbose mode.
natsOptions_SetSecure
NATS_EXTERN natsStatus natsOptions_SetSecure(natsOptions *opts, bool secure)
Sets the secure mode.
natsOptions_SetNoRandomize
NATS_EXTERN natsStatus natsOptions_SetNoRandomize(natsOptions *opts, bool noRandomize)
Indicate if the servers list should be randomized.
natsOptions_SetWriteDeadline
NATS_EXTERN natsStatus natsOptions_SetWriteDeadline(natsOptions *opts, int64_t deadline)
Sets the write deadline.
natsOptions_SetMaxPingsOut
NATS_EXTERN natsStatus natsOptions_SetMaxPingsOut(natsOptions *opts, int maxPingsOut)
Sets the limit of outstanding PINGs without corresponding PONGs.
natsOptions_SetEventLoop
NATS_EXTERN natsStatus natsOptions_SetEventLoop(natsOptions *opts, void *loop, natsEvLoop_Attach attachCb, natsEvLoop_ReadAddRemove readCb, natsEvLoop_WriteAddRemove writeCb, natsEvLoop_Detach detachCb)
Sets the external event loop and associated callbacks.
natsOptions_SetMaxReconnect
NATS_EXTERN natsStatus natsOptions_SetMaxReconnect(natsOptions *opts, int maxReconnect)
Sets the maximum number of reconnect attempts.
natsOptions_SetDiscoveredServersCB
NATS_EXTERN natsStatus natsOptions_SetDiscoveredServersCB(natsOptions *opts, natsConnectionHandler discoveredServersCb, void *closure)
Sets the callback to be invoked when new servers are discovered.
natsOptions_UseGlobalMessageDelivery
NATS_EXTERN natsStatus natsOptions_UseGlobalMessageDelivery(natsOptions *opts, bool global)
Switch on/off the use of a central message delivery thread pool.
natsOptions_SetCustomInboxPrefix
NATS_EXTERN natsStatus natsOptions_SetCustomInboxPrefix(natsOptions *opts, const char *inboxPrefix)
Sets a custom inbox prefix.
natsOptions_SetServers
NATS_EXTERN natsStatus natsOptions_SetServers(natsOptions *opts, const char **servers, int serversCount)
Set the list of servers to try to (re)connect to.
natsOptions_SetToken
NATS_EXTERN natsStatus natsOptions_SetToken(natsOptions *opts, const char *token)
Sets the token to use when not specified in the URL.
natsOptions_SetDisconnectedCB
NATS_EXTERN natsStatus natsOptions_SetDisconnectedCB(natsOptions *opts, natsConnectionHandler disconnectedCb, void *closure)
Sets the callback to be invoked when the connection to a server is lost.
natsOptions_SetFailRequestsOnDisconnect
NATS_EXTERN natsStatus natsOptions_SetFailRequestsOnDisconnect(natsOptions *opts, bool failRequests)
Fails pending requests on disconnect event.
natsOptions_SetPingInterval
NATS_EXTERN natsStatus natsOptions_SetPingInterval(natsOptions *opts, int64_t interval)
Sets the ping interval.
natsOptions_SetCertificatesChain
NATS_EXTERN natsStatus natsOptions_SetCertificatesChain(natsOptions *opts, const char *cert, const char *key)
Sets the client certificate and key.
natsOptions_SetCATrustedCertificates
NATS_EXTERN natsStatus natsOptions_SetCATrustedCertificates(natsOptions *opts, const char *certificates)
Sets the trusted CA certificates from memory.
stanConnection_GetNATSConnection
NATS_EXTERN natsStatus stanConnection_GetNATSConnection(stanConnection *sc, natsConnection **nc)
Returns the underlying NATS Connection.
stanConnection_ReleaseNATSConnection
NATS_EXTERN void stanConnection_ReleaseNATSConnection(stanConnection *sc)
Releases the NATS Connection.
stanConnection_Connect
NATS_EXTERN natsStatus stanConnection_Connect(stanConnection **sc, const char *clusterID, const char *clientID, stanConnOptions *options)
Connects to a NATS Streaming Server using the provided options.
stanConnection_Close
NATS_EXTERN natsStatus stanConnection_Close(stanConnection *sc)
Closes the connection.
stanConnection_Destroy
NATS_EXTERN natsStatus stanConnection_Destroy(stanConnection *sc)
Destroys the connection object.
stanConnOptions_SetDiscoveryPrefix
NATS_EXTERN natsStatus stanConnOptions_SetDiscoveryPrefix(stanConnOptions *opts, const char *prefix)
Sets the subject prefix the library sends the connect request to.
stanConnOptions_SetConnectionLostHandler
NATS_EXTERN natsStatus stanConnOptions_SetConnectionLostHandler(stanConnOptions *opts, stanConnectionLostHandler handler, void *closure)
Sets the connection lost handler.
stanConnOptions_SetMaxPubAcksInflight
NATS_EXTERN natsStatus stanConnOptions_SetMaxPubAcksInflight(stanConnOptions *opts, int maxPubAcksInflight, float percentage)
Sets the maximum number of published messages without outstanding ACKs from the server.
stanConnOptions_SetPubAckWait
NATS_EXTERN natsStatus stanConnOptions_SetPubAckWait(stanConnOptions *opts, int64_t wait)
Sets the timeout for waiting for an ACK for a published message.
stanConnOptions_SetURL
NATS_EXTERN natsStatus stanConnOptions_SetURL(stanConnOptions *opts, const char *url)
Sets the URL to connect to.
stanConnOptions_SetConnectionWait
NATS_EXTERN natsStatus stanConnOptions_SetConnectionWait(stanConnOptions *opts, int64_t wait)
Sets the timeout for establishing a connection.
stanConnOptions_Destroy
NATS_EXTERN void stanConnOptions_Destroy(stanConnOptions *opts)
Destroys a stanConnOptions object.
stanConnOptions_SetPings
NATS_EXTERN natsStatus stanConnOptions_SetPings(stanConnOptions *opts, int interval, int maxOut)
Sets the ping interval and max out values.
stanConnOptions_SetNATSOptions
NATS_EXTERN natsStatus stanConnOptions_SetNATSOptions(stanConnOptions *opts, natsOptions *nOpts)
Sets the NATS Options to use to create the connection.
stanConnOptions_Create
NATS_EXTERN natsStatus stanConnOptions_Create(stanConnOptions **newOpts)
Creates a stanConnOptions object.
stanConnection_PublishAsync
NATS_EXTERN natsStatus stanConnection_PublishAsync(stanConnection *sc, const char *channel, const void *data, int dataLen, stanPubAckHandler ah, void *ahClosure)
Asynchronously publishes data on a channel.
stanConnection_Publish
NATS_EXTERN natsStatus stanConnection_Publish(stanConnection *sc, const char *channel, const void *data, int dataLen)
Publishes data on a channel.
stanConnection_QueueSubscribe
NATS_EXTERN natsStatus stanConnection_QueueSubscribe(stanSubscription **sub, stanConnection *sc, const char *channel, const char *queueGroup, stanMsgHandler cb, void *cbClosure, stanSubOptions *options)
Creates a queue subscription.
stanConnection_Subscribe
NATS_EXTERN natsStatus stanConnection_Subscribe(stanSubscription **sub, stanConnection *sc, const char *channel, stanMsgHandler cb, void *cbClosure, stanSubOptions *options)
Creates a subscription.
stanMsg_GetData
NATS_EXTERN const char * stanMsg_GetData(const stanMsg *msg)
Returns the message payload.
stanMsg_GetTimestamp
NATS_EXTERN int64_t stanMsg_GetTimestamp(const stanMsg *msg)
Returns the message's timestamp.
stanMsg_GetDataLength
NATS_EXTERN int stanMsg_GetDataLength(const stanMsg *msg)
Returns the message length.
stanMsg_IsRedelivered
NATS_EXTERN bool stanMsg_IsRedelivered(const stanMsg *msg)
Returns the message's redelivered flag.
stanMsg_GetSequence
NATS_EXTERN uint64_t stanMsg_GetSequence(const stanMsg *msg)
Returns the message's sequence number.
stanMsg_Destroy
NATS_EXTERN void stanMsg_Destroy(stanMsg *msg)
Destroys the message object.
stanSubscription_AckMsg
NATS_EXTERN natsStatus stanSubscription_AckMsg(stanSubscription *sub, stanMsg *msg)
Acknowledge a message.
stanSubscription_Destroy
NATS_EXTERN void stanSubscription_Destroy(stanSubscription *sub)
Destroys the subscription.
stanSubscription_SetOnCompleteCB
NATS_EXTERN natsStatus stanSubscription_SetOnCompleteCB(stanSubscription *sub, natsOnCompleteCB cb, void *closure)
Sets a completion callback.
stanSubscription_Close
NATS_EXTERN natsStatus stanSubscription_Close(stanSubscription *sub)
Closes the subscription.
stanSubscription_Unsubscribe
NATS_EXTERN natsStatus stanSubscription_Unsubscribe(stanSubscription *sub)
Permanently remove a subscription.
stanSubOptions_Destroy
NATS_EXTERN void stanSubOptions_Destroy(stanSubOptions *opts)
Destroys a stanSubOptions object.
stanSubOptions_StartAtTimeDelta
NATS_EXTERN natsStatus stanSubOptions_StartAtTimeDelta(stanSubOptions *opts, int64_t delta)
Sets the desired start position based on the given delta.
stanSubOptions_SetMaxInflight
NATS_EXTERN natsStatus stanSubOptions_SetMaxInflight(stanSubOptions *opts, int maxInflight)
Sets the the maximum number of messages the cluster will send without an ACK.
stanSubOptions_StartAtSequence
NATS_EXTERN natsStatus stanSubOptions_StartAtSequence(stanSubOptions *opts, uint64_t seq)
Sets the desired start position based on the given sequence number.
stanSubOptions_SetManualAckMode
NATS_EXTERN natsStatus stanSubOptions_SetManualAckMode(stanSubOptions *opts, bool manual)
Sets the subscription's acknowledgment mode.
stanSubOptions_StartWithLastReceived
NATS_EXTERN natsStatus stanSubOptions_StartWithLastReceived(stanSubOptions *opts)
The subscription should start with the last message in the channel.
stanSubOptions_SetDurableName
NATS_EXTERN natsStatus stanSubOptions_SetDurableName(stanSubOptions *opts, const char *durableName)
Sets the Durable Name for this subscription.
stanSubOptions_StartAtTime
NATS_EXTERN natsStatus stanSubOptions_StartAtTime(stanSubOptions *opts, int64_t time)
Sets the desired start position based on the given time.
stanSubOptions_DeliverAllAvailable
NATS_EXTERN natsStatus stanSubOptions_DeliverAllAvailable(stanSubOptions *opts)
The subscription should start with the first message in the channel.
stanSubOptions_Create
NATS_EXTERN natsStatus stanSubOptions_Create(stanSubOptions **newOpts)
Creates a stanSubOptions object.
stanSubOptions_SetAckWait
NATS_EXTERN natsStatus stanSubOptions_SetAckWait(stanSubOptions *opts, int64_t wait)
Sets the timeout for waiting for an ACK from the cluster's point of view for delivered messages.
natsStatistics_Destroy
NATS_EXTERN void natsStatistics_Destroy(natsStatistics *stats)
Destroys the natsStatistics object.
natsStatistics_GetCounts
NATS_EXTERN natsStatus natsStatistics_GetCounts(const natsStatistics *stats, uint64_t *inMsgs, uint64_t *inBytes, uint64_t *outMsgs, uint64_t *outBytes, uint64_t *reconnects)
Extracts the various statistics values.
natsStatistics_Create
NATS_EXTERN natsStatus natsStatistics_Create(natsStatistics **newStats)
Creates a natsStatistics object.
natsStatus_GetText
NATS_EXTERN const char * natsStatus_GetText(natsStatus s)
Get the text corresponding to a natsStatus.
natsSubscription_WaitForDrainCompletion
NATS_EXTERN natsStatus natsSubscription_WaitForDrainCompletion(natsSubscription *sub, int64_t timeout)
Blocks until the drain operation completes.
natsSubscription_AutoUnsubscribe
NATS_EXTERN natsStatus natsSubscription_AutoUnsubscribe(natsSubscription *sub, int max)
Auto-Unsubscribes.
natsSubscription_GetMaxPending
NATS_EXTERN natsStatus natsSubscription_GetMaxPending(natsSubscription *sub, int *msgs, int *bytes)
Returns the maximum number of pending messages and bytes.
natsSubscription_GetStats
NATS_EXTERN natsStatus natsSubscription_GetStats(natsSubscription *sub, int *pendingMsgs, int *pendingBytes, int *maxPendingMsgs, int *maxPendingBytes, int64_t *deliveredMsgs, int64_t *droppedMsgs)
Get various statistics from this subscription.
natsSubscription_GetDropped
NATS_EXTERN natsStatus natsSubscription_GetDropped(natsSubscription *sub, int64_t *msgs)
Returns the number of dropped messages.
natsSubscription_Drain
NATS_EXTERN natsStatus natsSubscription_Drain(natsSubscription *sub)
Drains the subscription with a default timeout.
natsSubscription_NoDeliveryDelay
NATS_EXTERN natsStatus natsSubscription_NoDeliveryDelay(natsSubscription *sub)
Enables the No Delivery Delay mode.
natsSubscription_GetDelivered
NATS_EXTERN natsStatus natsSubscription_GetDelivered(natsSubscription *sub, int64_t *msgs)
Returns the number of delivered messages.
natsSubscription_Destroy
NATS_EXTERN void natsSubscription_Destroy(natsSubscription *sub)
Destroys the subscription.
natsSubscription_GetID
NATS_EXTERN int64_t natsSubscription_GetID(natsSubscription *sub)
Gets the subscription id.
natsSubscription_IsValid
NATS_EXTERN bool natsSubscription_IsValid(natsSubscription *sub)
Checks the validity of the subscription.
natsSubscription_NextMsg
NATS_EXTERN natsStatus natsSubscription_NextMsg(natsMsg **nextMsg, natsSubscription *sub, int64_t timeout)
Returns the next available message.
natsSubscription_SetPendingLimits
NATS_EXTERN natsStatus natsSubscription_SetPendingLimits(natsSubscription *sub, int msgLimit, int bytesLimit)
Sets the limit for pending messages and bytes.
natsSubscription_GetPendingLimits
NATS_EXTERN natsStatus natsSubscription_GetPendingLimits(natsSubscription *sub, int *msgLimit, int *bytesLimit)
Returns the current limit for pending messages and bytes.
natsSubscription_QueuedMsgs
NATS_EXTERN natsStatus natsSubscription_QueuedMsgs(natsSubscription *sub, uint64_t *queuedMsgs)
Gets the number of pending messages.
natsSubscription_DrainCompletionStatus
NATS_EXTERN natsStatus natsSubscription_DrainCompletionStatus(natsSubscription *sub)
Returns the status of the drain after completion.
natsSubscription_DrainTimeout
NATS_EXTERN natsStatus natsSubscription_DrainTimeout(natsSubscription *sub, int64_t timeout)
Drains the subscription with the specified timeout.
natsSubscription_GetPending
NATS_EXTERN natsStatus natsSubscription_GetPending(natsSubscription *sub, int *msgs, int *bytes)
Returns the number of pending messages and bytes.
natsSubscription_GetSubject
NATS_EXTERN const char * natsSubscription_GetSubject(natsSubscription *sub)
Gets the subject name.
natsSubscription_SetOnCompleteCB
NATS_EXTERN natsStatus natsSubscription_SetOnCompleteCB(natsSubscription *sub, natsOnCompleteCB cb, void *closure)
Sets a completion callback.
natsSubscription_Unsubscribe
NATS_EXTERN natsStatus natsSubscription_Unsubscribe(natsSubscription *sub)
Unsubscribes.
natsSubscription_ClearMaxPending
NATS_EXTERN natsStatus natsSubscription_ClearMaxPending(natsSubscription *sub)
Clears the statistics regarding the maximum pending values.
stanSubOptions
struct __stanSubOptions stanSubOptions
Way to configure a stanSubscription.
Definition: nats.h:1328
kvStore
struct __kvStore kvStore
Definition: nats.h:1164
jsDeliverPolicy
jsDeliverPolicy
Definition: nats.h:291
stanConnOptions
struct __stanConnOptions stanConnOptions
Way to configure a stanConnection.
Definition: nats.h:1322
jsStorageType
jsStorageType
Definition: nats.h:281
natsInbox
char natsInbox
Unique subject often used for point-to-point communication.
Definition: nats.h:187
stanMsg
struct __stanMsg stanMsg
The Streaming message.
Definition: nats.h:1316
jsRetentionPolicy
jsRetentionPolicy
Definition: nats.h:260
kvWatcher
struct __kvWatcher kvWatcher
Definition: nats.h:1179
natsStatistics
struct __natsStatistics natsStatistics
Statistics of a natsConnection.
Definition: nats.h:159
jsDiscardPolicy
jsDiscardPolicy
Definition: nats.h:271
jsReplayPolicy
jsReplayPolicy
Definition: nats.h:317
natsSubscription
struct __natsSubscription natsSubscription
Interest on a given subject.
Definition: nats.h:165
kvOperation
kvOperation
Definition: nats.h:1185
jsAckPolicy
jsAckPolicy
Definition: nats.h:305
stanConnection
struct __stanConnection stanConnection
A connection to a NATS Streaming Server.
Definition: nats.h:1304
jsCtx
struct __jsCtx jsCtx
Definition: nats.h:227
natsOptions
struct __natsOptions natsOptions
Way to configure a natsConnection.
Definition: nats.h:178
kvStatus
struct __kvStatus kvStatus
Definition: nats.h:1174
kvEntry
struct __kvEntry kvEntry
Definition: nats.h:1169
natsMsg
struct __natsMsg natsMsg
A structure holding a subject, optional reply and payload.
Definition: nats.h:172
stanSubscription
struct __stanSubscription stanSubscription
Interest on a given channel.
Definition: nats.h:1310
natsConnection
struct __natsConnection natsConnection
A connection to a NATS Server.
Definition: nats.h:152
js_DeliverByStartSequence
@ js_DeliverByStartSequence
Starts from a given sequence.
Definition: nats.h:295
js_DeliverByStartTime
@ js_DeliverByStartTime
Starts from a given UTC time (number of nanoseconds since epoch)
Definition: nats.h:296
js_DeliverNew
@ js_DeliverNew
Starts with messages sent after the consumer is created.
Definition: nats.h:294
js_DeliverLastPerSubject
@ js_DeliverLastPerSubject
Starts with the last message for all subjects received.
Definition: nats.h:297
js_DeliverLast
@ js_DeliverLast
Starts with the last sequence received.
Definition: nats.h:293
js_DeliverAll
@ js_DeliverAll
Starts from the very beginning of a stream. This is the default.
Definition: nats.h:292
js_FileStorage
@ js_FileStorage
Specifies on disk storage. It's the default.
Definition: nats.h:282
js_MemoryStorage
@ js_MemoryStorage
Specifies in memory only.
Definition: nats.h:283
js_LimitsPolicy
@ 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
@ js_InterestPolicy
Specifies that when all known observables have acknowledged a message it can be removed.
Definition: nats.h:262
js_WorkQueuePolicy
@ js_WorkQueuePolicy
Specifies that when the first worker or subscriber acknowledges the message it can be removed.
Definition: nats.h:263
js_DiscardNew
@ js_DiscardNew
Will fail to store new messages.
Definition: nats.h:273
js_DiscardOld
@ js_DiscardOld
Will remove older messages to return to the limits. This is the default.
Definition: nats.h:272
js_ReplayInstant
@ js_ReplayInstant
Replays messages as fast as possible.
Definition: nats.h:318
js_ReplayOriginal
@ js_ReplayOriginal
Maintains the same timing as the messages were received.
Definition: nats.h:319
kvOp_Unknown
@ kvOp_Unknown
Definition: nats.h:1186
kvOp_Delete
@ kvOp_Delete
Definition: nats.h:1188
kvOp_Put
@ kvOp_Put
Definition: nats.h:1187
kvOp_Purge
@ kvOp_Purge
Definition: nats.h:1189
js_AckExplicit
@ js_AckExplicit
Requires ack or nack for all messages.
Definition: nats.h:306
js_AckAll
@ js_AckAll
When acking a sequence number, this implicitly acks all sequences below this one as well.
Definition: nats.h:308
js_AckNone
@ js_AckNone
Requires no acks for delivered messages.
Definition: nats.h:307
NATS_EXTERN
#define NATS_EXTERN
Needed for shared library.
Definition: nats.h:49
natsSock
int natsSock
Definition: nats.h:50
status.h
jsErrCode
jsErrCode
Definition: status.h:135
natsStatus
natsStatus
Status returned by most of the APIs.
Definition: status.h:50
natsConnStatus
natsConnStatus
The connection state.
Definition: status.h:24
jsAPIStats
Definition: nats.h:953
jsAPIStats::Total
uint64_t Total
Definition: nats.h:954
jsAPIStats::Errors
uint64_t Errors
Definition: nats.h:955
jsAccountInfo
Definition: nats.h:990
jsAccountInfo::Consumers
int64_t Consumers
Definition: nats.h:994
jsAccountInfo::Streams
int64_t Streams
Definition: nats.h:993
jsAccountInfo::TiersLen
int TiersLen
Definition: nats.h:999
jsAccountInfo::Memory
uint64_t Memory
Definition: nats.h:991
jsAccountInfo::API
jsAPIStats API
Definition: nats.h:996
jsAccountInfo::Limits
jsAccountLimits Limits
Definition: nats.h:997
jsAccountInfo::Tiers
jsTier ** Tiers
Definition: nats.h:998
jsAccountInfo::Domain
char * Domain
Definition: nats.h:995
jsAccountInfo::Store
uint64_t Store
Definition: nats.h:992
jsAccountLimits
Definition: nats.h:963
jsAccountLimits::MemoryMaxStreamBytes
int64_t MemoryMaxStreamBytes
Definition: nats.h:969
jsAccountLimits::MaxStreams
int64_t MaxStreams
Definition: nats.h:966
jsAccountLimits::MaxAckPending
int64_t MaxAckPending
Definition: nats.h:968
jsAccountLimits::MaxConsumers
int64_t MaxConsumers
Definition: nats.h:967
jsAccountLimits::MaxStore
int64_t MaxStore
Definition: nats.h:965
jsAccountLimits::MaxMemory
int64_t MaxMemory
Definition: nats.h:964
jsAccountLimits::MaxBytesRequired
bool MaxBytesRequired
Definition: nats.h:971
jsAccountLimits::StoreMaxStreamBytes
int64_t StoreMaxStreamBytes
Definition: nats.h:970
jsClusterInfo
Definition: nats.h:618
jsClusterInfo::ReplicasLen
int ReplicasLen
Definition: nats.h:622
jsClusterInfo::Name
char * Name
Definition: nats.h:619
jsClusterInfo::Replicas
jsPeerInfo ** Replicas
Definition: nats.h:621
jsClusterInfo::Leader
char * Leader
Definition: nats.h:620
jsConsumerConfig
Definition: nats.h:734
jsConsumerConfig::MemoryStorage
bool MemoryStorage
Definition: nats.h:771
jsConsumerConfig::Name
const char * Name
Definition: nats.h:735
jsConsumerConfig::OptStartSeq
uint64_t OptStartSeq
Definition: nats.h:739
jsConsumerConfig::HeadersOnly
bool HeadersOnly
Definition: nats.h:754
jsConsumerConfig::RateLimit
uint64_t RateLimit
Definition: nats.h:748
jsConsumerConfig::DeliverPolicy
jsDeliverPolicy DeliverPolicy
Definition: nats.h:738
jsConsumerConfig::Description
const char * Description
Definition: nats.h:737
jsConsumerConfig::Durable
const char * Durable
Definition: nats.h:736
jsConsumerConfig::SampleFrequency
const char * SampleFrequency
Definition: nats.h:749
jsConsumerConfig::FlowControl
bool FlowControl
Definition: nats.h:752
jsConsumerConfig::MaxRequestBatch
int64_t MaxRequestBatch
Maximum Pull Consumer request batch size.
Definition: nats.h:757
jsConsumerConfig::AckWait
int64_t AckWait
Definition: nats.h:742
jsConsumerConfig::MaxRequestMaxBytes
int64_t MaxRequestMaxBytes
Maximum Pull Consumer request maximum bytes.
Definition: nats.h:759
jsConsumerConfig::OptStartTime
int64_t OptStartTime
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:740
jsConsumerConfig::MaxWaiting
int64_t MaxWaiting
Definition: nats.h:750
jsConsumerConfig::AckPolicy
jsAckPolicy AckPolicy
Definition: nats.h:741
jsConsumerConfig::DeliverSubject
const char * DeliverSubject
Definition: nats.h:762
jsConsumerConfig::BackOff
int64_t * BackOff
Redelivery durations expressed in nanoseconds.
Definition: nats.h:744
jsConsumerConfig::MaxRequestExpires
int64_t MaxRequestExpires
Maximum Pull Consumer request expiration, expressed in number of nanoseconds.
Definition: nats.h:758
jsConsumerConfig::Heartbeat
int64_t Heartbeat
Heartbeat interval expressed in number of nanoseconds.
Definition: nats.h:753
jsConsumerConfig::Replicas
int64_t Replicas
Definition: nats.h:769
jsConsumerConfig::BackOffLen
int BackOffLen
Definition: nats.h:745
jsConsumerConfig::MaxDeliver
int64_t MaxDeliver
Definition: nats.h:743
jsConsumerConfig::ReplayPolicy
jsReplayPolicy ReplayPolicy
Definition: nats.h:747
jsConsumerConfig::DeliverGroup
const char * DeliverGroup
Definition: nats.h:763
jsConsumerConfig::MaxAckPending
int64_t MaxAckPending
Definition: nats.h:751
jsConsumerConfig::FilterSubject
const char * FilterSubject
Definition: nats.h:746
jsConsumerConfig::InactiveThreshold
int64_t InactiveThreshold
How long the server keeps an ephemeral after detecting loss of interest, expressed in number of nanos...
Definition: nats.h:766
jsConsumerInfo
Definition: nats.h:905
jsConsumerInfo::Delivered
jsSequenceInfo Delivered
Definition: nats.h:910
jsConsumerInfo::Config
jsConsumerConfig * Config
Definition: nats.h:909
jsConsumerInfo::PushBound
bool PushBound
Definition: nats.h:917
jsConsumerInfo::NumWaiting
int64_t NumWaiting
Definition: nats.h:914
jsConsumerInfo::Created
int64_t Created
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:908
jsConsumerInfo::Cluster
jsClusterInfo * Cluster
Definition: nats.h:916
jsConsumerInfo::NumAckPending
int64_t NumAckPending
Definition: nats.h:912
jsConsumerInfo::Stream
char * Stream
Definition: nats.h:906
jsConsumerInfo::NumRedelivered
int64_t NumRedelivered
Definition: nats.h:913
jsConsumerInfo::Name
char * Name
Definition: nats.h:907
jsConsumerInfo::AckFloor
jsSequenceInfo AckFloor
Definition: nats.h:911
jsConsumerInfo::NumPending
uint64_t NumPending
Definition: nats.h:915
jsConsumerInfoList
Definition: nats.h:929
jsConsumerInfoList::List
jsConsumerInfo ** List
Definition: nats.h:930
jsConsumerInfoList::Count
int Count
Definition: nats.h:931
jsConsumerNamesList
Definition: nats.h:943
jsConsumerNamesList::Count
int Count
Definition: nats.h:945
jsConsumerNamesList::List
char ** List
Definition: nats.h:944
jsConsumerSequenceMismatch
Definition: nats.h:793
jsConsumerSequenceMismatch::Stream
uint64_t Stream
This is the stream sequence that the application should resume from.
Definition: nats.h:794
jsConsumerSequenceMismatch::ConsumerServer
uint64_t ConsumerServer
This is the consumer sequence last sent by the server.
Definition: nats.h:796
jsConsumerSequenceMismatch::ConsumerClient
uint64_t ConsumerClient
This is the consumer sequence that was last received by the library.
Definition: nats.h:795
jsDirectGetMsgOptions
Definition: nats.h:1063
jsDirectGetMsgOptions::NextBySubject
const char * NextBySubject
Get the next message (based on sequence) for that subject.
Definition: nats.h:1065
jsDirectGetMsgOptions::Sequence
uint64_t Sequence
Get the message at this sequence.
Definition: nats.h:1064
jsDirectGetMsgOptions::LastBySubject
const char * LastBySubject
Get the last message on that subject.
Definition: nats.h:1066
jsExternalStream
Definition: nats.h:353
jsExternalStream::DeliverPrefix
const char * DeliverPrefix
Definition: nats.h:355
jsExternalStream::APIPrefix
const char * APIPrefix
Definition: nats.h:354
jsFetchRequest
Definition: nats.h:1076
jsFetchRequest::MaxBytes
int64_t MaxBytes
Maximum bytes for the request (request complete based on whichever Batch or MaxBytes comes first)
Definition: nats.h:1079
jsFetchRequest::Batch
int Batch
Maximum number of messages to be received (see MaxBytes)
Definition: nats.h:1078
jsFetchRequest::Expires
int64_t Expires
Expiration of the request, expressed in nanoseconds.
Definition: nats.h:1077
jsFetchRequest::NoWait
bool NoWait
Will not wait if the request cannot be completed.
Definition: nats.h:1080
jsFetchRequest::Heartbeat
int64_t Heartbeat
Have server sends heartbeats to help detect communication failures.
Definition: nats.h:1081
jsLostStreamData
Definition: nats.h:520
jsLostStreamData::Msgs
uint64_t * Msgs
Definition: nats.h:521
jsLostStreamData::Bytes
uint64_t Bytes
Definition: nats.h:523
jsLostStreamData::MsgsLen
int MsgsLen
Definition: nats.h:522
jsMsgMetaData
Definition: nats.h:1011
jsMsgMetaData::NumPending
uint64_t NumPending
Definition: nats.h:1014
jsMsgMetaData::Sequence
jsSequencePair Sequence
Definition: nats.h:1012
jsMsgMetaData::Stream
char * Stream
Definition: nats.h:1016
jsMsgMetaData::Domain
char * Domain
Definition: nats.h:1018
jsMsgMetaData::Consumer
char * Consumer
Definition: nats.h:1017
jsMsgMetaData::NumDelivered
uint64_t NumDelivered
Definition: nats.h:1013
jsMsgMetaData::Timestamp
int64_t Timestamp
Definition: nats.h:1015
jsOptions::jsOptionsPublishAsync
Definition: nats.h:1100
jsOptions::jsOptionsPublishAsync::ErrHandler
jsPubAckErrHandler ErrHandler
Callback invoked when error encountered publishing a given message.
Definition: nats.h:1115
jsOptions::jsOptionsPublishAsync::AckHandler
jsPubAckHandler AckHandler
Callback invoked for each asynchronous published message.
Definition: nats.h:1108
jsOptions::jsOptionsPublishAsync::AckHandlerClosure
void * AckHandlerClosure
Closure (or user data) passed to jsPubAckHandler callback.
Definition: nats.h:1109
jsOptions::jsOptionsPublishAsync::ErrHandlerClosure
void * ErrHandlerClosure
Closure (or user data) passed to jsPubAckErrHandler callback.
Definition: nats.h:1116
jsOptions::jsOptionsPublishAsync::StallWait
int64_t StallWait
Amount of time (in milliseconds) to wait in a PublishAsync call when there is MaxPending inflight mes...
Definition: nats.h:1118
jsOptions::jsOptionsPublishAsync::MaxPending
int64_t MaxPending
Maximum outstanding asynchronous publishes that can be inflight at one time.
Definition: nats.h:1101
jsOptions::jsOptionsStream::jsOptionsStreamInfo
Definition: nats.h:1151
jsOptions::jsOptionsStream::jsOptionsStreamInfo::DeletedDetails
bool DeletedDetails
Get the list of deleted message sequences.
Definition: nats.h:1152
jsOptions::jsOptionsStream::jsOptionsStreamInfo::SubjectsFilter
const char * SubjectsFilter
Get the list of subjects in this stream.
Definition: nats.h:1153
jsOptions::jsOptionsStream::jsOptionsStreamPurge
Definition: nats.h:1140
jsOptions::jsOptionsStream::jsOptionsStreamPurge::Sequence
uint64_t Sequence
Purge up to but not including sequence.
Definition: nats.h:1142
jsOptions::jsOptionsStream::jsOptionsStreamPurge::Keep
uint64_t Keep
Number of messages to keep.
Definition: nats.h:1143
jsOptions::jsOptionsStream::jsOptionsStreamPurge::Subject
const char * Subject
This is the subject to match against messages for the purge command.
Definition: nats.h:1141
jsOptions::jsOptionsStream
Definition: nats.h:1129
jsOptions::jsOptionsStream::Info
struct jsOptions::jsOptionsStream::jsOptionsStreamInfo Info
Optional stream information retrieval options.
jsOptions::jsOptionsStream::Purge
struct jsOptions::jsOptionsStream::jsOptionsStreamPurge Purge
Optional stream purge options.
jsOptions
Definition: nats.h:1091
jsOptions::PublishAsync
struct jsOptions::jsOptionsPublishAsync PublishAsync
jsOptions::Wait
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
jsOptions::Prefix
const char * Prefix
JetStream prefix, default is "$JS.API".
Definition: nats.h:1092
jsOptions::Domain
const char * Domain
Domain changes the domain part of JetSteam API prefix.
Definition: nats.h:1093
jsOptions::Stream
struct jsOptions::jsOptionsStream Stream
Optional stream options.
jsPeerInfo
Definition: nats.h:604
jsPeerInfo::Offline
bool Offline
Definition: nats.h:607
jsPeerInfo::Lag
uint64_t Lag
Definition: nats.h:609
jsPeerInfo::Active
int64_t Active
Definition: nats.h:608
jsPeerInfo::Name
char * Name
Definition: nats.h:605
jsPeerInfo::Current
bool Current
Definition: nats.h:606
jsPlacement
Definition: nats.h:336
jsPlacement::TagsLen
int TagsLen
Definition: nats.h:339
jsPlacement::Cluster
const char * Cluster
Definition: nats.h:337
jsPlacement::Tags
const char ** Tags
Definition: nats.h:338
jsPubAckErr
Definition: nats.h:1039
jsPubAckErr::Msg
natsMsg * Msg
Definition: nats.h:1040
jsPubAckErr::Err
natsStatus Err
Definition: nats.h:1041
jsPubAckErr::ErrCode
jsErrCode ErrCode
Definition: nats.h:1042
jsPubAckErr::ErrText
const char * ErrText
Definition: nats.h:1043
jsPubAck
Definition: nats.h:1026
jsPubAck::Sequence
uint64_t Sequence
Definition: nats.h:1028
jsPubAck::Duplicate
bool Duplicate
Definition: nats.h:1030
jsPubAck::Domain
char * Domain
Definition: nats.h:1029
jsPubAck::Stream
char * Stream
Definition: nats.h:1027
jsPubOptions
Definition: nats.h:245
jsPubOptions::ExpectLastMsgId
const char * ExpectLastMsgId
Expected last message ID in the stream.
Definition: nats.h:249
jsPubOptions::MaxWait
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
jsPubOptions::ExpectLastSeq
uint64_t ExpectLastSeq
Expected last message sequence in the stream.
Definition: nats.h:250
jsPubOptions::ExpectNoMessage
bool ExpectNoMessage
Expected no message (that is, sequence == 0) for the subject in the stream.
Definition: nats.h:252
jsPubOptions::ExpectStream
const char * ExpectStream
Expected stream to respond from the publish call.
Definition: nats.h:248
jsPubOptions::MsgId
const char * MsgId
Message ID used for de-duplication.
Definition: nats.h:247
jsPubOptions::ExpectLastSubjectSeq
uint64_t ExpectLastSubjectSeq
Expected last message sequence for the subject in the stream.
Definition: nats.h:251
jsRePublish
Definition: nats.h:389
jsRePublish::HeadersOnly
bool HeadersOnly
Definition: nats.h:392
jsRePublish::Source
const char * Source
Definition: nats.h:390
jsRePublish::Destination
const char * Destination
Definition: nats.h:391
jsSequenceInfo
Definition: nats.h:891
jsSequenceInfo::Last
int64_t Last
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:894
jsSequenceInfo::Stream
uint64_t Stream
Definition: nats.h:893
jsSequenceInfo::Consumer
uint64_t Consumer
Definition: nats.h:892
jsSequencePair
Definition: nats.h:881
jsSequencePair::Consumer
uint64_t Consumer
Definition: nats.h:882
jsSequencePair::Stream
uint64_t Stream
Definition: nats.h:883
jsStreamAlternate
Definition: nats.h:642
jsStreamAlternate::Name
const char * Name
Definition: nats.h:643
jsStreamAlternate::Cluster
const char * Cluster
Definition: nats.h:645
jsStreamAlternate::Domain
const char * Domain
Definition: nats.h:644
jsStreamConfig
Definition: nats.h:472
jsStreamConfig::Discard
jsDiscardPolicy Discard
Definition: nats.h:484
jsStreamConfig::Subjects
const char ** Subjects
Definition: nats.h:475
jsStreamConfig::AllowDirect
bool AllowDirect
Definition: nats.h:507
jsStreamConfig::SourcesLen
int SourcesLen
Definition: nats.h:493
jsStreamConfig::DiscardNewPerSubject
bool DiscardNewPerSubject
Definition: nats.h:512
jsStreamConfig::Description
const char * Description
Definition: nats.h:474
jsStreamConfig::Template
const char * Template
Definition: nats.h:488
jsStreamConfig::DenyPurge
bool DenyPurge
Restrict the ability to purge messages.
Definition: nats.h:496
jsStreamConfig::Storage
jsStorageType Storage
Definition: nats.h:485
jsStreamConfig::Retention
jsRetentionPolicy Retention
Definition: nats.h:477
jsStreamConfig::MaxMsgs
int64_t MaxMsgs
Definition: nats.h:479
jsStreamConfig::MaxConsumers
int64_t MaxConsumers
Definition: nats.h:478
jsStreamConfig::Name
const char * Name
Definition: nats.h:473
jsStreamConfig::NoAck
bool NoAck
Definition: nats.h:487
jsStreamConfig::Sources
jsStreamSource ** Sources
Definition: nats.h:492
jsStreamConfig::MaxMsgSize
int32_t MaxMsgSize
Definition: nats.h:483
jsStreamConfig::RePublish
jsRePublish * RePublish
Definition: nats.h:504
jsStreamConfig::MirrorDirect
bool MirrorDirect
Definition: nats.h:509
jsStreamConfig::Duplicates
int64_t Duplicates
Definition: nats.h:489
jsStreamConfig::MaxMsgsPerSubject
int64_t MaxMsgsPerSubject
Definition: nats.h:482
jsStreamConfig::MaxAge
int64_t MaxAge
Definition: nats.h:481
jsStreamConfig::SubjectsLen
int SubjectsLen
Definition: nats.h:476
jsStreamConfig::AllowRollup
bool AllowRollup
Definition: nats.h:501
jsStreamConfig::Mirror
jsStreamSource * Mirror
Definition: nats.h:491
jsStreamConfig::Placement
jsPlacement * Placement
Definition: nats.h:490
jsStreamConfig::MaxBytes
int64_t MaxBytes
Definition: nats.h:480
jsStreamConfig::Replicas
int64_t Replicas
Definition: nats.h:486
jsStreamConfig::Sealed
bool Sealed
Seal a stream so no messages can get our or in.
Definition: nats.h:494
jsStreamConfig::DenyDelete
bool DenyDelete
Restrict the ability to delete messages.
Definition: nats.h:495
jsStreamInfo
Definition: nats.h:656
jsStreamInfo::Sources
jsStreamSourceInfo ** Sources
Definition: nats.h:662
jsStreamInfo::Created
int64_t Created
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:658
jsStreamInfo::Alternates
jsStreamAlternate ** Alternates
Definition: nats.h:664
jsStreamInfo::State
jsStreamState State
Definition: nats.h:659
jsStreamInfo::Cluster
jsClusterInfo * Cluster
Definition: nats.h:660
jsStreamInfo::Mirror
jsStreamSourceInfo * Mirror
Definition: nats.h:661
jsStreamInfo::AlternatesLen
int AlternatesLen
Definition: nats.h:665
jsStreamInfo::Config
jsStreamConfig * Config
Definition: nats.h:657
jsStreamInfo::SourcesLen
int SourcesLen
Definition: nats.h:663
jsStreamInfoList
Definition: nats.h:677
jsStreamInfoList::List
jsStreamInfo ** List
Definition: nats.h:678
jsStreamInfoList::Count
int Count
Definition: nats.h:679
jsStreamNamesList
Definition: nats.h:691
jsStreamNamesList::List
char ** List
Definition: nats.h:692
jsStreamNamesList::Count
int Count
Definition: nats.h:693
jsStreamSource
Definition: nats.h:372
jsStreamSource::External
jsExternalStream * External
Definition: nats.h:377
jsStreamSource::OptStartTime
int64_t OptStartTime
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:375
jsStreamSource::Name
const char * Name
Definition: nats.h:373
jsStreamSource::Domain
const char * Domain
Definition: nats.h:381
jsStreamSource::OptStartSeq
uint64_t OptStartSeq
Definition: nats.h:374
jsStreamSource::FilterSubject
const char * FilterSubject
Definition: nats.h:376
jsStreamSourceInfo
Definition: nats.h:630
jsStreamSourceInfo::Active
int64_t Active
Definition: nats.h:634
jsStreamSourceInfo::Name
char * Name
Definition: nats.h:631
jsStreamSourceInfo::External
jsExternalStream * External
Definition: nats.h:632
jsStreamSourceInfo::Lag
uint64_t Lag
Definition: nats.h:633
jsStreamState
Definition: nats.h:582
jsStreamState::Lost
jsLostStreamData * Lost
Definition: nats.h:594
jsStreamState::LastSeq
uint64_t LastSeq
Definition: nats.h:587
jsStreamState::Consumers
int64_t Consumers
Definition: nats.h:595
jsStreamState::DeletedLen
int DeletedLen
Definition: nats.h:593
jsStreamState::Msgs
uint64_t Msgs
Definition: nats.h:583
jsStreamState::Subjects
jsStreamStateSubjects * Subjects
Definition: nats.h:590
jsStreamState::FirstSeq
uint64_t FirstSeq
Definition: nats.h:585
jsStreamState::LastTime
int64_t LastTime
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:588
jsStreamState::NumSubjects
int64_t NumSubjects
Definition: nats.h:589
jsStreamState::Deleted
uint64_t * Deleted
Definition: nats.h:592
jsStreamState::NumDeleted
uint64_t NumDeleted
Definition: nats.h:591
jsStreamState::Bytes
uint64_t Bytes
Definition: nats.h:584
jsStreamState::FirstTime
int64_t FirstTime
UTC time expressed as number of nanoseconds since epoch.
Definition: nats.h:586
jsStreamStateSubject
Definition: nats.h:533
jsStreamStateSubject::Msgs
uint64_t Msgs
Definition: nats.h:535
jsStreamStateSubject::Subject
const char * Subject
Definition: nats.h:534
jsStreamStateSubjects
Definition: nats.h:569
jsStreamStateSubjects::Count
int Count
Definition: nats.h:571
jsStreamStateSubjects::List
jsStreamStateSubject * List
Definition: nats.h:570
jsSubOptions
Definition: nats.h:816
jsSubOptions::ManualAck
bool ManualAck
If true, the user will have to acknowledge the messages.
Definition: nats.h:861
jsSubOptions::Consumer
const char * Consumer
If specified, the subscription will be bound to an existing consumer from the Stream without attempti...
Definition: nats.h:833
jsSubOptions::Stream
const char * Stream
If specified, the consumer will be bound to this stream name.
Definition: nats.h:823
jsSubOptions::Ordered
bool Ordered
If true, this will be an ordered consumer.
Definition: nats.h:873
jsSubOptions::Queue
const char * Queue
Queue name for queue subscriptions.
Definition: nats.h:848
jsSubOptions::Config
jsConsumerConfig Config
Consumer configuration.
Definition: nats.h:866
jsTier
Definition: nats.h:976
jsTier::Name
const char * Name
Definition: nats.h:977
jsTier::Streams
int64_t Streams
Definition: nats.h:980
jsTier::Store
uint64_t Store
Definition: nats.h:979
jsTier::Consumers
int64_t Consumers
Definition: nats.h:981
jsTier::Memory
uint64_t Memory
Definition: nats.h:978
jsTier::Limits
jsAccountLimits Limits
Definition: nats.h:982
kvConfig
Definition: nats.h:1199
kvConfig::History
uint8_t History
Definition: nats.h:1203
kvConfig::Bucket
const char * Bucket
Definition: nats.h:1200
kvConfig::MaxBytes
int64_t MaxBytes
Definition: nats.h:1205
kvConfig::MaxValueSize
int32_t MaxValueSize
Definition: nats.h:1202
kvConfig::Replicas
int Replicas
Definition: nats.h:1207
kvConfig::Description
const char * Description
Definition: nats.h:1201
kvConfig::Mirror
jsStreamSource * Mirror
Definition: nats.h:1209
kvConfig::TTL
int64_t TTL
Definition: nats.h:1204
kvConfig::StorageType
jsStorageType StorageType
Definition: nats.h:1206
kvConfig::RePublish
jsRePublish * RePublish
Definition: nats.h:1208
kvConfig::SourcesLen
int SourcesLen
Definition: nats.h:1211
kvConfig::Sources
jsStreamSource ** Sources
Definition: nats.h:1210
kvEntryList
A list of KeyValue store entries.
Definition: nats.h:1269
kvEntryList::Entries
kvEntry ** Entries
Definition: nats.h:1270
kvEntryList::Count
int Count
Definition: nats.h:1271
kvKeysList
A list of KeyValue store keys.
Definition: nats.h:1293
kvKeysList::Count
int Count
Definition: nats.h:1295
kvKeysList::Keys
char ** Keys
Definition: nats.h:1294
kvPurgeOptions
Definition: nats.h:1235
kvPurgeOptions::Timeout
int64_t Timeout
Definition: nats.h:1237
kvPurgeOptions::DeleteMarkersOlderThan
int64_t DeleteMarkersOlderThan
Definition: nats.h:1247
kvWatchOptions
Definition: nats.h:1221
kvWatchOptions::IgnoreDeletes
bool IgnoreDeletes
Definition: nats.h:1222
kvWatchOptions::IncludeHistory
bool IncludeHistory
Definition: nats.h:1223
kvWatchOptions::Timeout
int64_t Timeout
How long to wait (in milliseconds) for some operations to complete.
Definition: nats.h:1225
kvWatchOptions::MetaOnly
bool MetaOnly
Definition: nats.h:1224
natsMsgList
A list of NATS messages.
Definition: nats.h:213
natsMsgList::Count
int Count
Definition: nats.h:215
natsMsgList::Msgs
natsMsg ** Msgs
Definition: nats.h:214