NATS C Client with JetStream and Streaming support  3.9.1
The nats.io C Client, Supported by Synadia Communications Inc.
nats.h File Reference
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <inttypes.h>
#include <stdio.h>
#include "status.h"
#include "version.h"

Go to the source code of this file.

Classes

struct  __natsClientConfig
 An initial configuration for NATS client. Provides control over the threading model, and sets many default option values. More...
 
struct  natsMsgList
 A list of NATS messages. More...
 
struct  natsMetadata
 A type to represent user-provided metadata, a list of k=v pairs. More...
 
struct  jsPubOptions
 
struct  jsPlacement
 
struct  jsExternalStream
 
struct  jsStreamSource
 
struct  jsRePublish
 
struct  jsSubjectTransformConfig
 
struct  jsStreamConsumerLimits
 
struct  jsStreamConfig
 
struct  jsLostStreamData
 
struct  jsStreamStateSubject
 
struct  jsStreamStateSubjects
 
struct  jsStreamState
 
struct  jsPeerInfo
 
struct  jsClusterInfo
 
struct  jsStreamSourceInfo
 
struct  jsStreamAlternate
 
struct  jsStreamInfo
 
struct  jsStreamInfoList
 
struct  jsStreamNamesList
 
struct  jsConsumerConfig
 
struct  jsConsumerSequenceMismatch
 
struct  jsSubOptions
 
struct  jsSequencePair
 
struct  jsSequenceInfo
 
struct  jsConsumerInfo
 
struct  jsConsumerInfoList
 
struct  jsConsumerNamesList
 
struct  jsConsumerPauseResponse
 
struct  jsAPIStats
 
struct  jsAccountLimits
 
struct  jsTier
 
struct  jsAccountInfo
 
struct  jsMsgMetaData
 
struct  jsPubAck
 
struct  jsPubAckErr
 
struct  jsDirectGetMsgOptions
 
struct  jsFetchRequest
 
struct  jsOptions
 
struct  jsOptions::jsOptionsPublishAsync
 
struct  jsOptions::jsOptionsPullSubscribeAsync
 
struct  jsOptions::jsOptionsStream
 
struct  jsOptions::jsOptionsStream::jsOptionsStreamPurge
 
struct  jsOptions::jsOptionsStream::jsOptionsStreamInfo
 
struct  kvConfig
 
struct  kvWatchOptions
 
struct  kvPurgeOptions
 
struct  kvEntryList
 A list of KeyValue store entries. More...
 
struct  kvKeysList
 A list of KeyValue store keys. More...
 
struct  micro_endpoint_config_s
 
struct  micro_endpoint_info_s
 
struct  micro_endpoint_stats_s
 
struct  micro_group_config_s
 The Microservice endpoint group configuration object. More...
 
struct  micro_service_config_s
 The Microservice top-level configuration object. More...
 
struct  micro_service_info_s
 
struct  micro_service_stats_s
 

Macros

#define NATS_EXTERN
 Needed for shared library. More...
 
#define NATS_DEFAULT_URL   "nats://localhost:4222"
 The default NATS Server URL. More...
 
#define JSMsgSize   "Nats-Msg-Size"
 Message header for JetStream messages representing the message payload size. More...
 
#define JSMsgRollup   "Nats-Rollup"
 Message header for JetStream message for rollup. More...
 
#define JSMsgRollupSubject   "sub"
 Message header value causing rollup per subject. More...
 
#define JSMsgRollupAll   "all"
 Message header value causing rollup for all subjects. More...
 
#define JSStream   "Nats-Stream"
 
#define JSSequence   "Nats-Sequence"
 
#define JSLastSequence   "Nats-Last-Sequence"
 
#define JSTimeStamp   "Nats-Time-Stamp"
 
#define JSSubject   "Nats-Subject"
 
#define MICRO_API_PREFIX   "$SRV"
 The prefix for all microservice monitoring subjects. More...
 
#define MICRO_INFO_RESPONSE_TYPE   "io.nats.micro.v1.info_response"
 The type set in the $SRV.INFO responses. More...
 
#define MICRO_INFO_VERB   "INFO"
 For $SRV.INFO.* subjects. More...
 
#define MICRO_PING_RESPONSE_TYPE   "io.nats.micro.v1.ping_response"
 The type set in the $SRV.PING response. More...
 
#define MICRO_PING_VERB   "PING"
 For $SRV.PING subjects. More...
 
#define MICRO_STATS_RESPONSE_TYPE   "io.nats.micro.v1.stats_response"
 The type set in the STATS response. More...
 
#define MICRO_STATS_VERB   "STATS"
 The "verb" used in $SRV.STATS subjects. More...
 
#define MICRO_STATUS_HDR   "Nats-Status"
 The response message header used to communicate an erroneous NATS status back to the requestor. More...
 
#define MICRO_ERROR_HDR   "Nats-Service-Error"
 The response message header used to communicate an error message back to the requestor. More...
 
#define MICRO_ERROR_CODE_HDR   "Nats-Service-Error-Code"
 The response message header used to communicate an integer error code back to the requestor. More...
 
#define microError_Ignore(__err)   microError_Destroy(__err)
 

Typedefs

typedef int natsSock
 
typedef struct __natsConnection natsConnection
 A connection to a NATS Server. More...
 
typedef struct __natsStatistics natsStatistics
 Statistics of a natsConnection. More...
 
typedef struct __natsSubscription natsSubscription
 Interest on a given subject. More...
 
typedef struct __natsMsg natsMsg
 A structure holding a subject, optional reply and payload. More...
 
typedef struct __natsOptions natsOptions
 Way to configure a natsConnection. More...
 
typedef char natsInbox
 Unique subject often used for point-to-point communication. More...
 
typedef struct __natsClientConfig natsClientConfig
 An initial configuration for NATS client. Provides control over the threading model, and sets many default option values. More...
 
typedef struct natsMsgList natsMsgList
 A list of NATS messages. More...
 
typedef struct natsMetadata natsMetadata
 A type to represent user-provided metadata, a list of k=v pairs. More...
 
typedef struct __jsCtx jsCtx
 
typedef struct jsPubOptions jsPubOptions
 
typedef struct jsPlacement jsPlacement
 
typedef struct jsExternalStream jsExternalStream
 
typedef struct jsStreamSource jsStreamSource
 
typedef struct jsRePublish jsRePublish
 
typedef struct jsSubjectTransformConfig jsSubjectTransformConfig
 
typedef struct jsStreamConsumerLimits jsStreamConsumerLimits
 
typedef struct jsStreamConfig jsStreamConfig
 
typedef struct jsLostStreamData jsLostStreamData
 
typedef struct jsStreamStateSubject jsStreamStateSubject
 
typedef struct jsStreamStateSubjects jsStreamStateSubjects
 
typedef struct jsStreamState jsStreamState
 
typedef struct jsPeerInfo jsPeerInfo
 
typedef struct jsClusterInfo jsClusterInfo
 
typedef struct jsStreamSourceInfo jsStreamSourceInfo
 
typedef struct jsStreamAlternate jsStreamAlternate
 
typedef struct jsStreamInfo jsStreamInfo
 
typedef struct jsStreamInfoList jsStreamInfoList
 
typedef struct jsStreamNamesList jsStreamNamesList
 
typedef struct jsConsumerConfig jsConsumerConfig
 
typedef struct jsConsumerSequenceMismatch jsConsumerSequenceMismatch
 
typedef struct jsSubOptions jsSubOptions
 
typedef struct jsSequencePair jsSequencePair
 
typedef struct jsSequenceInfo jsSequenceInfo
 
typedef struct jsConsumerInfo jsConsumerInfo
 
typedef struct jsConsumerInfoList jsConsumerInfoList
 
typedef struct jsConsumerNamesList jsConsumerNamesList
 
typedef struct jsConsumerPauseResponse jsConsumerPauseResponse
 
typedef struct jsAPIStats jsAPIStats
 
typedef struct jsAccountLimits jsAccountLimits
 
typedef struct jsTier jsTier
 
typedef struct jsAccountInfo jsAccountInfo
 
typedef struct jsMsgMetaData jsMsgMetaData
 
typedef struct jsPubAck jsPubAck
 
typedef struct jsPubAckErr jsPubAckErr
 
typedef struct jsDirectGetMsgOptions jsDirectGetMsgOptions
 
typedef struct jsFetchRequest jsFetchRequest
 
typedef void(* jsFetchCompleteHandler) (natsConnection *nc, natsSubscription *sub, natsStatus s, void *closure)
 Callback used to indicate that the work of js_PullSubscribeAsync is done. More...
 
typedef bool(* jsFetchNextHandler) (int *messages, int64_t *maxBytes, natsSubscription *sub, void *closure)
 Callback used to customize flow control for js_PullSubscribeAsync. More...
 
typedef struct jsOptions jsOptions
 
typedef struct __kvStore kvStore
 
typedef struct __kvEntry kvEntry
 
typedef struct __kvStatus kvStatus
 
typedef struct __kvWatcher kvWatcher
 
typedef struct kvConfig kvConfig
 
typedef struct kvWatchOptions kvWatchOptions
 
typedef struct kvPurgeOptions kvPurgeOptions
 
typedef struct kvEntryList kvEntryList
 A list of KeyValue store entries. More...
 
typedef struct kvKeysList kvKeysList
 A list of KeyValue store keys. More...
 
typedef struct __stanConnection stanConnection
 A connection to a NATS Streaming Server. More...
 
typedef struct __stanSubscription stanSubscription
 Interest on a given channel. More...
 
typedef struct __stanMsg stanMsg
 The Streaming message. More...
 
typedef struct __stanConnOptions stanConnOptions
 Way to configure a stanConnection. More...
 
typedef struct __stanSubOptions stanSubOptions
 Way to configure a stanSubscription. More...
 
typedef void(* natsMsgHandler) (natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure)
 Callback used to deliver messages to the application. More...
 
typedef void(* natsConnectionHandler) (natsConnection *nc, void *closure)
 Callback used to notify the user of asynchronous connection events. More...
 
typedef void(* natsErrHandler) (natsConnection *nc, natsSubscription *subscription, natsStatus err, void *closure)
 Callback used to notify the user of errors encountered while processing inbound messages. More...
 
typedef natsStatus(* natsEvLoop_Attach) (void **userData, void *loop, natsConnection *nc, natsSock socket)
 Attach this connection to the external event loop. More...
 
typedef natsStatus(* natsEvLoop_ReadAddRemove) (void *userData, bool add)
 Read event needs to be added or removed. More...
 
typedef natsStatus(* natsEvLoop_WriteAddRemove) (void *userData, bool add)
 Write event needs to be added or removed. More...
 
typedef natsStatus(* natsEvLoop_Detach) (void *userData)
 Detach from the event loop. More...
 
typedef natsStatus(* natsUserJWTHandler) (char **userJWT, char **customErrTxt, void *closure)
 Callback used to fetch and return account signed user JWT. More...
 
typedef natsStatus(* natsSignatureHandler) (char **customErrTxt, unsigned char **signature, int *signatureLength, const char *nonce, void *closure)
 Callback used to sign a nonce sent by the server. More...
 
typedef const char *(* natsTokenHandler) (void *closure)
 Callback used to build a token on connections and reconnections. More...
 
typedef void(* natsOnCompleteCB) (void *closure)
 Callback used to notify that an object lifecycle is complete. More...
 
typedef int64_t(* natsCustomReconnectDelayHandler) (natsConnection *nc, int attempts, void *closure)
 Callback used to specify how long to wait between reconnects. More...
 
typedef void(* jsPubAckErrHandler) (jsCtx *js, jsPubAckErr *pae, void *closure)
 Callback used to process asynchronous publish errors from JetStream. More...
 
typedef void(* jsPubAckHandler) (jsCtx *js, natsMsg *msg, jsPubAck *pa, jsPubAckErr *pae, void *closure)
 Callback used to process asynchronous publish responses from JetStream. More...
 
typedef void(* stanPubAckHandler) (const char *guid, const char *error, void *closure)
 Callback used to notify of an asynchronous publish result. More...
 
typedef void(* stanMsgHandler) (stanConnection *sc, stanSubscription *sub, const char *channel, stanMsg *msg, void *closure)
 Callback used to deliver messages to the application. More...
 
typedef void(* stanConnectionLostHandler) (stanConnection *sc, const char *errorTxt, void *closure)
 Callback used to notify the user of the permanent loss of the connection. More...
 
typedef struct micro_client_s microClient
 The Microservice client. More...
 
typedef struct __for_forward_compatibility_only microClientConfig
 The Microservice configuration object. For forward compatibility only. More...
 
typedef struct micro_endpoint_s microEndpoint
 microEndpoint represents a microservice endpoint. More...
 
typedef struct micro_endpoint_config_s microEndpointConfig
 The Microservice endpoint configuration object. More...
 
typedef struct micro_endpoint_info_s microEndpointInfo
 static information about an endpoint. More...
 
typedef struct micro_endpoint_stats_s microEndpointStats
 The Microservice endpoint-level stats struct. More...
 
typedef struct micro_error_s microError
 the Microservice error object. More...
 
typedef struct micro_group_s microGroup
 a collection of endpoints and other groups, with a common prefix to their subjects and names. More...
 
typedef struct micro_group_config_s microGroupConfig
 The Microservice endpoint group configuration object. More...
 
typedef struct micro_request_s microRequest
 a request received by a microservice endpoint. More...
 
typedef struct micro_service_s microService
 the main object for a configured microservice. More...
 
typedef struct micro_service_config_s microServiceConfig
 The microservice configuration object. More...
 
typedef struct micro_service_info_s microServiceInfo
 Information about a running microservice. More...
 
typedef struct micro_service_stats_s microServiceStats
 The Microservice service-level stats struct. More...
 
typedef microError *(* microRequestHandler) (microRequest *req)
 Callback type for request processing. More...
 
typedef void(* microErrorHandler) (microService *m, microEndpoint *ep, natsStatus s)
 Callback type for async error notifications. More...
 
typedef void(* microDoneHandler) (microService *m)
 Callback type for Done (service stopped) notifications. More...
 

Enumerations

enum  jsRetentionPolicy { js_LimitsPolicy = 0 , js_InterestPolicy , js_WorkQueuePolicy }
 
enum  jsDiscardPolicy { js_DiscardOld = 0 , js_DiscardNew }
 
enum  jsStorageType { js_FileStorage = 0 , js_MemoryStorage }
 
enum  jsStorageCompression { js_StorageCompressionNone = 0 , js_StorageCompressionS2 }
 
enum  jsDeliverPolicy {
  js_DeliverAll = 0 , js_DeliverLast , js_DeliverNew , js_DeliverByStartSequence ,
  js_DeliverByStartTime , js_DeliverLastPerSubject
}
 
enum  jsAckPolicy { js_AckExplicit = 0 , js_AckNone , js_AckAll }
 
enum  jsReplayPolicy { js_ReplayInstant = 0 , js_ReplayOriginal }
 
enum  kvOperation { kvOp_Unknown = 0 , kvOp_Put , kvOp_Delete , kvOp_Purge }
 

Functions

natsStatus nats_OpenWithConfig (natsClientConfig *config)
 Initializes the library. More...
 
NATS_EXTERN natsStatus nats_Open (int64_t lockSpinCount)
 Initializes the library. More...
 
NATS_EXTERN const char * nats_GetVersion (void)
 Returns the Library's version. More...
 
NATS_EXTERN uint32_t nats_GetVersionNumber (void)
 Returns the Library's version as a number. More...
 
NATS_EXTERN bool nats_CheckCompatibility (void)
 Check that the header is compatible with the library. More...
 
NATS_EXTERN int64_t nats_Now (void)
 Gives the current time in milliseconds. More...
 
NATS_EXTERN int64_t nats_NowInNanoSeconds (void)
 Gives the current time in nanoseconds. More...
 
NATS_EXTERN void nats_Sleep (int64_t sleepTime)
 Sleeps for a given number of milliseconds. More...
 
NATS_EXTERN const char * nats_GetLastError (natsStatus *status)
 Returns the calling thread's last known error. More...
 
NATS_EXTERN natsStatus nats_GetLastErrorStack (char *buffer, size_t bufLen)
 Returns the calling thread's last known error stack. More...
 
NATS_EXTERN void nats_PrintLastErrorStack (FILE *file)
 Prints the calling thread's last known error stack into the file. More...
 
NATS_EXTERN natsStatus nats_SetMessageDeliveryPoolSize (int max)
 Sets the maximum size of the global message delivery thread pool. More...
 
NATS_EXTERN void nats_ReleaseThreadMemory (void)
 Release thread-local memory possibly allocated by the library. More...
 
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. More...
 
NATS_EXTERN void nats_Close (void)
 Tear down the library. More...
 
NATS_EXTERN natsStatus nats_CloseAndWait (int64_t timeout)
 Tear down the library and wait for all resources to be released. More...
 
NATS_EXTERN const char * natsStatus_GetText (natsStatus s)
 Get the text corresponding to a natsStatus. More...
 
NATS_EXTERN natsStatus natsStatistics_Create (natsStatistics **newStats)
 Creates a natsStatistics object. More...
 
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. More...
 
NATS_EXTERN void natsStatistics_Destroy (natsStatistics *stats)
 Destroys the natsStatistics object. More...
 
NATS_EXTERN natsStatus natsOptions_Create (natsOptions **newOpts)
 Creates a natsOptions object. More...
 
NATS_EXTERN natsStatus natsOptions_SetURL (natsOptions *opts, const char *url)
 Sets the URL to connect to. More...
 
NATS_EXTERN natsStatus natsOptions_SetServers (natsOptions *opts, const char **servers, int serversCount)
 Set the list of servers to try to (re)connect to. More...
 
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. More...
 
NATS_EXTERN natsStatus natsOptions_SetToken (natsOptions *opts, const char *token)
 Sets the token to use when not specified in the URL. More...
 
NATS_EXTERN natsStatus natsOptions_SetTokenHandler (natsOptions *opts, natsTokenHandler tokenCb, void *closure)
 Sets the tokenCb to use whenever a token is needed. More...
 
NATS_EXTERN natsStatus natsOptions_SetNoRandomize (natsOptions *opts, bool noRandomize)
 Indicate if the servers list should be randomized. More...
 
NATS_EXTERN natsStatus natsOptions_SetTimeout (natsOptions *opts, int64_t timeout)
 Sets the (re)connect process timeout. More...
 
NATS_EXTERN natsStatus natsOptions_SetName (natsOptions *opts, const char *name)
 Sets the name. More...
 
NATS_EXTERN natsStatus natsOptions_SetSecure (natsOptions *opts, bool secure)
 Sets the secure mode. More...
 
NATS_EXTERN natsStatus natsOptions_TLSHandshakeFirst (natsOptions *opts)
 Performs TLS handshake first. More...
 
NATS_EXTERN natsStatus natsOptions_LoadCATrustedCertificates (natsOptions *opts, const char *fileName)
 Loads the trusted CA certificates from a file. More...
 
NATS_EXTERN natsStatus natsOptions_SetCATrustedCertificates (natsOptions *opts, const char *certificates)
 Sets the trusted CA certificates from memory. More...
 
NATS_EXTERN natsStatus natsOptions_LoadCertificatesChain (natsOptions *opts, const char *certsFileName, const char *keyFileName)
 Loads the certificate chain from a file, using the given key. More...
 
NATS_EXTERN natsStatus natsOptions_SetCertificatesChain (natsOptions *opts, const char *cert, const char *key)
 Sets the client certificate and key. More...
 
NATS_EXTERN natsStatus natsOptions_SetCiphers (natsOptions *opts, const char *ciphers)
 Sets the list of available ciphers. More...
 
NATS_EXTERN natsStatus natsOptions_SetCipherSuites (natsOptions *opts, const char *ciphers)
 Sets the list of available ciphers for TLSv1.3. More...
 
NATS_EXTERN natsStatus natsOptions_SetExpectedHostname (natsOptions *opts, const char *hostname)
 Sets the server certificate's expected hostname. More...
 
NATS_EXTERN natsStatus natsOptions_SkipServerVerification (natsOptions *opts, bool skip)
 Switch server certificate verification. More...
 
NATS_EXTERN natsStatus natsOptions_SetVerbose (natsOptions *opts, bool verbose)
 Sets the verbose mode. More...
 
NATS_EXTERN natsStatus natsOptions_SetPedantic (natsOptions *opts, bool pedantic)
 Sets the pedantic mode. More...
 
NATS_EXTERN natsStatus natsOptions_SetPingInterval (natsOptions *opts, int64_t interval)
 Sets the ping interval. More...
 
NATS_EXTERN natsStatus natsOptions_SetMaxPingsOut (natsOptions *opts, int maxPingsOut)
 Sets the limit of outstanding PINGs without corresponding PONGs. More...
 
NATS_EXTERN natsStatus natsOptions_SetIOBufSize (natsOptions *opts, int ioBufSize)
 Sets the size of the internal read/write buffers. More...
 
NATS_EXTERN natsStatus natsOptions_SetAllowReconnect (natsOptions *opts, bool allow)
 Indicates if the connection will be allowed to reconnect. More...
 
NATS_EXTERN natsStatus natsOptions_SetMaxReconnect (natsOptions *opts, int maxReconnect)
 Sets the maximum number of reconnect attempts. More...
 
NATS_EXTERN natsStatus natsOptions_SetReconnectWait (natsOptions *opts, int64_t reconnectWait)
 Sets the time between reconnect attempts. More...
 
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. More...
 
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. More...
 
NATS_EXTERN natsStatus natsOptions_SetReconnectBufSize (natsOptions *opts, int reconnectBufSize)
 Sets the size of the backing buffer used during reconnect. More...
 
NATS_EXTERN natsStatus natsOptions_SetMaxPendingMsgs (natsOptions *opts, int maxPending)
 Sets the maximum number of pending messages per subscription. More...
 
NATS_EXTERN natsStatus natsOptions_SetMaxPendingBytes (natsOptions *opts, int64_t maxPending)
 Sets the maximum number of pending bytes per subscription. More...
 
NATS_EXTERN natsStatus natsOptions_SetErrorHandler (natsOptions *opts, natsErrHandler errHandler, void *closure)
 Sets the error handler for asynchronous events. More...
 
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. More...
 
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. More...
 
NATS_EXTERN natsStatus natsOptions_SetReconnectedCB (natsOptions *opts, natsConnectionHandler reconnectedCb, void *closure)
 Sets the callback to be invoked when the connection has reconnected. More...
 
NATS_EXTERN natsStatus natsOptions_SetDiscoveredServersCB (natsOptions *opts, natsConnectionHandler discoveredServersCb, void *closure)
 Sets the callback to be invoked when new servers are discovered. More...
 
NATS_EXTERN natsStatus natsOptions_SetIgnoreDiscoveredServers (natsOptions *opts, bool ignore)
 Sets if the library should ignore or not discovered servers. More...
 
NATS_EXTERN natsStatus natsOptions_SetLameDuckModeCB (natsOptions *opts, natsConnectionHandler lameDuckCb, void *closure)
 Sets the callback to be invoked when server enters lame duck mode. More...
 
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. More...
 
NATS_EXTERN natsStatus natsOptions_UseGlobalMessageDelivery (natsOptions *opts, bool global)
 Switch on/off the use of a central message delivery thread pool. More...
 
NATS_EXTERN natsStatus natsOptions_IPResolutionOrder (natsOptions *opts, int order)
 Dictates the order in which host name are resolved during connect. More...
 
NATS_EXTERN natsStatus natsOptions_SetSendAsap (natsOptions *opts, bool sendAsap)
 Sets if Publish calls should send data right away. More...
 
NATS_EXTERN natsStatus natsOptions_UseOldRequestStyle (natsOptions *opts, bool useOldStyle)
 Switches the use of old style requests. More...
 
NATS_EXTERN natsStatus natsOptions_SetFailRequestsOnDisconnect (natsOptions *opts, bool failRequests)
 Fails pending requests on disconnect event. More...
 
NATS_EXTERN natsStatus natsOptions_SetNoEcho (natsOptions *opts, bool noEcho)
 Sets if connection receives its own messages. More...
 
NATS_EXTERN natsStatus natsOptions_SetRetryOnFailedConnect (natsOptions *opts, bool retry, natsConnectionHandler connectedCb, void *closure)
 Indicates if initial connect failure should be retried or not. More...
 
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. More...
 
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. More...
 
NATS_EXTERN natsStatus natsOptions_SetUserCredentialsFromMemory (natsOptions *opts, const char *jwtAndSeedContent)
 Sets JWT handler and handler to sign nonce that uses seed. More...
 
NATS_EXTERN natsStatus natsOptions_SetNKey (natsOptions *opts, const char *pubKey, natsSignatureHandler sigCB, void *sigClosure)
 Sets the NKey public key and signature callback. More...
 
NATS_EXTERN natsStatus natsOptions_SetNKeyFromSeed (natsOptions *opts, const char *pubKey, const char *seedFile)
 Sets the NKey public key and its seed file. More...
 
NATS_EXTERN natsStatus natsOptions_SetWriteDeadline (natsOptions *opts, int64_t deadline)
 Sets the write deadline. More...
 
NATS_EXTERN natsStatus natsOptions_DisableNoResponders (natsOptions *opts, bool disabled)
 Enable/Disable the "no responders" feature. More...
 
NATS_EXTERN natsStatus natsOptions_SetCustomInboxPrefix (natsOptions *opts, const char *inboxPrefix)
 Sets a custom inbox prefix. More...
 
NATS_EXTERN natsStatus natsOptions_SetMessageBufferPadding (natsOptions *opts, int paddingSize)
 Sets a custom padding when allocating buffer for incoming messages. More...
 
NATS_EXTERN void natsOptions_Destroy (natsOptions *opts)
 Destroys a natsOptions object. More...
 
NATS_EXTERN natsStatus stanConnOptions_Create (stanConnOptions **newOpts)
 Creates a stanConnOptions object. More...
 
NATS_EXTERN natsStatus stanConnOptions_SetURL (stanConnOptions *opts, const char *url)
 Sets the URL to connect to. More...
 
NATS_EXTERN natsStatus stanConnOptions_SetNATSOptions (stanConnOptions *opts, natsOptions *nOpts)
 Sets the NATS Options to use to create the connection. More...
 
NATS_EXTERN natsStatus stanConnOptions_SetConnectionWait (stanConnOptions *opts, int64_t wait)
 Sets the timeout for establishing a connection. More...
 
NATS_EXTERN natsStatus stanConnOptions_SetPubAckWait (stanConnOptions *opts, int64_t wait)
 Sets the timeout for waiting for an ACK for a published message. More...
 
NATS_EXTERN natsStatus stanConnOptions_SetDiscoveryPrefix (stanConnOptions *opts, const char *prefix)
 Sets the subject prefix the library sends the connect request to. More...
 
NATS_EXTERN natsStatus stanConnOptions_SetMaxPubAcksInflight (stanConnOptions *opts, int maxPubAcksInflight, float percentage)
 Sets the maximum number of published messages without outstanding ACKs from the server. More...
 
NATS_EXTERN natsStatus stanConnOptions_SetPings (stanConnOptions *opts, int interval, int maxOut)
 Sets the ping interval and max out values. More...
 
NATS_EXTERN natsStatus stanConnOptions_SetConnectionLostHandler (stanConnOptions *opts, stanConnectionLostHandler handler, void *closure)
 Sets the connection lost handler. More...
 
NATS_EXTERN void stanConnOptions_Destroy (stanConnOptions *opts)
 Destroys a stanConnOptions object. More...
 
NATS_EXTERN natsStatus stanSubOptions_Create (stanSubOptions **newOpts)
 Creates a stanSubOptions object. More...
 
NATS_EXTERN natsStatus stanSubOptions_SetDurableName (stanSubOptions *opts, const char *durableName)
 Sets the Durable Name for this subscription. More...
 
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. More...
 
NATS_EXTERN natsStatus stanSubOptions_SetMaxInflight (stanSubOptions *opts, int maxInflight)
 Sets the the maximum number of messages the cluster will send without an ACK. More...
 
NATS_EXTERN natsStatus stanSubOptions_StartAtSequence (stanSubOptions *opts, uint64_t seq)
 Sets the desired start position based on the given sequence number. More...
 
NATS_EXTERN natsStatus stanSubOptions_StartAtTime (stanSubOptions *opts, int64_t time)
 Sets the desired start position based on the given time. More...
 
NATS_EXTERN natsStatus stanSubOptions_StartAtTimeDelta (stanSubOptions *opts, int64_t delta)
 Sets the desired start position based on the given delta. More...
 
NATS_EXTERN natsStatus stanSubOptions_StartWithLastReceived (stanSubOptions *opts)
 The subscription should start with the last message in the channel. More...
 
NATS_EXTERN natsStatus stanSubOptions_DeliverAllAvailable (stanSubOptions *opts)
 The subscription should start with the first message in the channel. More...
 
NATS_EXTERN natsStatus stanSubOptions_SetManualAckMode (stanSubOptions *opts, bool manual)
 Sets the subscription's acknowledgment mode. More...
 
NATS_EXTERN void stanSubOptions_Destroy (stanSubOptions *opts)
 Destroys a stanSubOptions object. More...
 
NATS_EXTERN natsStatus natsInbox_Create (natsInbox **newInbox)
 Creates an inbox. More...
 
NATS_EXTERN void natsInbox_Destroy (natsInbox *inbox)
 Destroys the inbox. More...
 
NATS_EXTERN void natsMsgList_Destroy (natsMsgList *list)
 Destroys this list of messages. More...
 
NATS_EXTERN natsStatus natsMsg_Create (natsMsg **newMsg, const char *subj, const char *reply, const char *data, int dataLen)
 Creates a natsMsg object. More...
 
NATS_EXTERN const char * natsMsg_GetSubject (const natsMsg *msg)
 Returns the subject set in this message. More...
 
NATS_EXTERN const char * natsMsg_GetReply (const natsMsg *msg)
 Returns the reply set in this message. More...
 
NATS_EXTERN const char * natsMsg_GetData (const natsMsg *msg)
 Returns the message payload. More...
 
NATS_EXTERN int natsMsg_GetDataLength (const natsMsg *msg)
 Returns the message length. More...
 
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. More...
 
NATS_EXTERN natsStatus natsMsgHeader_Add (natsMsg *msg, const char *key, const char *value)
 Add value to the header associated with key. More...
 
NATS_EXTERN natsStatus natsMsgHeader_Get (natsMsg *msg, const char *key, const char **value)
 Get the header entry associated with key. More...
 
NATS_EXTERN natsStatus natsMsgHeader_Values (natsMsg *msg, const char *key, const char ***values, int *count)
 Get all header values associated with key. More...
 
NATS_EXTERN natsStatus natsMsgHeader_Keys (natsMsg *msg, const char ***keys, int *count)
 Get all header keys. More...
 
NATS_EXTERN natsStatus natsMsgHeader_Delete (natsMsg *msg, const char *key)
 Delete the value(s) associated with key. More...
 
NATS_EXTERN bool natsMsg_IsNoResponders (natsMsg *msg)
 Indicates if this message is a "no responders" message from the server. More...
 
NATS_EXTERN void natsMsg_Destroy (natsMsg *msg)
 Destroys the message object. More...
 
NATS_EXTERN uint64_t stanMsg_GetSequence (const stanMsg *msg)
 Returns the message's sequence number. More...
 
NATS_EXTERN int64_t stanMsg_GetTimestamp (const stanMsg *msg)
 Returns the message's timestamp. More...
 
NATS_EXTERN bool stanMsg_IsRedelivered (const stanMsg *msg)
 Returns the message's redelivered flag. More...
 
NATS_EXTERN const char * stanMsg_GetData (const stanMsg *msg)
 Returns the message payload. More...
 
NATS_EXTERN int stanMsg_GetDataLength (const stanMsg *msg)
 Returns the message length. More...
 
NATS_EXTERN void stanMsg_Destroy (stanMsg *msg)
 Destroys the message object. More...
 
NATS_EXTERN natsStatus natsConnection_Connect (natsConnection **nc, natsOptions *options)
 Connects to a NATS Server using the provided options. More...
 
natsStatus natsConnection_Reconnect (natsConnection *nc)
 Drops the current connection, reconnects including re-subscribing. More...
 
NATS_EXTERN void natsConnection_ProcessReadEvent (natsConnection *nc)
 Process a read event when using external event loop. More...
 
NATS_EXTERN void natsConnection_ProcessWriteEvent (natsConnection *nc)
 Process a write event when using external event loop. More...
 
NATS_EXTERN natsStatus natsConnection_ConnectTo (natsConnection **nc, const char *urls)
 Connects to a NATS Server using any of the URL from the given list. More...
 
NATS_EXTERN bool natsConnection_IsClosed (natsConnection *nc)
 Test if connection has been closed. More...
 
NATS_EXTERN bool natsConnection_IsReconnecting (natsConnection *nc)
 Test if connection is reconnecting. More...
 
NATS_EXTERN bool natsConnection_IsDraining (natsConnection *nc)
 Test if connection is draining. More...
 
NATS_EXTERN natsConnStatus natsConnection_Status (natsConnection *nc)
 Returns the current state of the connection. More...
 
NATS_EXTERN int natsConnection_Buffered (natsConnection *nc)
 Returns the number of bytes to be sent to the server. More...
 
NATS_EXTERN natsStatus natsConnection_Flush (natsConnection *nc)
 Flushes the connection. More...
 
NATS_EXTERN natsStatus natsConnection_FlushTimeout (natsConnection *nc, int64_t timeout)
 Flushes the connection with a given timeout. More...
 
NATS_EXTERN int64_t natsConnection_GetMaxPayload (natsConnection *nc)
 Returns the maximum message payload. More...
 
NATS_EXTERN natsStatus natsConnection_GetStats (natsConnection *nc, natsStatistics *stats)
 Gets the connection statistics. More...
 
NATS_EXTERN natsStatus natsConnection_GetConnectedUrl (natsConnection *nc, char *buffer, size_t bufferSize)
 Gets the URL of the currently connected server. More...
 
NATS_EXTERN natsStatus natsConnection_GetConnectedServerId (natsConnection *nc, char *buffer, size_t bufferSize)
 Gets the server Id. More...
 
NATS_EXTERN natsStatus natsConnection_GetServers (natsConnection *nc, char ***servers, int *count)
 Returns the list of server URLs known to this connection. More...
 
NATS_EXTERN natsStatus natsConnection_GetDiscoveredServers (natsConnection *nc, char ***servers, int *count)
 Returns the list of discovered server URLs. More...
 
NATS_EXTERN natsStatus natsConnection_GetLastError (natsConnection *nc, const char **lastError)
 Gets the last connection error. More...
 
NATS_EXTERN natsStatus natsConnection_GetClientID (natsConnection *nc, uint64_t *cid)
 Gets the current client ID assigned by the server. More...
 
NATS_EXTERN natsStatus natsConnection_Drain (natsConnection *nc)
 Drains the connection with default timeout. More...
 
NATS_EXTERN natsStatus natsConnection_DrainTimeout (natsConnection *nc, int64_t timeout)
 Drains the connection with given timeout. More...
 
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. More...
 
NATS_EXTERN natsStatus natsConnection_GetClientIP (natsConnection *nc, char **ip)
 Returns the client's IP address as reported by the server. More...
 
NATS_EXTERN natsStatus natsConnection_GetRTT (natsConnection *nc, int64_t *rtt)
 Returns the round trip time between this client and the server. More...
 
NATS_EXTERN natsStatus natsConnection_HasHeaderSupport (natsConnection *nc)
 Returns if the connection to current server supports headers. More...
 
NATS_EXTERN natsStatus natsConnection_GetLocalIPAndPort (natsConnection *nc, char **ip, int *port)
 Returns the connection local IP and port. More...
 
NATS_EXTERN void natsConnection_Close (natsConnection *nc)
 Closes the connection. More...
 
NATS_EXTERN void natsConnection_Destroy (natsConnection *nc)
 Destroys the connection object. More...
 
NATS_EXTERN natsStatus natsConnection_Publish (natsConnection *nc, const char *subj, const void *data, int dataLen)
 Publishes data on a subject. More...
 
NATS_EXTERN natsStatus natsConnection_PublishString (natsConnection *nc, const char *subj, const char *str)
 Publishes a string on a subject. More...
 
NATS_EXTERN natsStatus natsConnection_PublishMsg (natsConnection *nc, natsMsg *msg)
 Publishes a message on a subject. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
NATS_EXTERN natsStatus natsConnection_Subscribe (natsSubscription **sub, natsConnection *nc, const char *subject, natsMsgHandler cb, void *cbClosure)
 Creates an asynchronous subscription. More...
 
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. More...
 
NATS_EXTERN natsStatus natsConnection_SubscribeSync (natsSubscription **sub, natsConnection *nc, const char *subject)
 Creates a synchronous subcription. More...
 
NATS_EXTERN natsStatus natsConnection_QueueSubscribe (natsSubscription **sub, natsConnection *nc, const char *subject, const char *queueGroup, natsMsgHandler cb, void *cbClosure)
 Creates an asynchronous queue subscriber. More...
 
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. More...
 
NATS_EXTERN natsStatus natsConnection_QueueSubscribeSync (natsSubscription **sub, natsConnection *nc, const char *subject, const char *queueGroup)
 Creates a synchronous queue subscriber. More...
 
NATS_EXTERN natsStatus natsSubscription_NoDeliveryDelay (natsSubscription *sub)
 Enables the No Delivery Delay mode. More...
 
NATS_EXTERN natsStatus natsSubscription_NextMsg (natsMsg **nextMsg, natsSubscription *sub, int64_t timeout)
 Returns the next available message. More...
 
NATS_EXTERN natsStatus natsSubscription_Unsubscribe (natsSubscription *sub)
 Unsubscribes. More...
 
NATS_EXTERN natsStatus natsSubscription_AutoUnsubscribe (natsSubscription *sub, int max)
 Auto-Unsubscribes. More...
 
NATS_EXTERN natsStatus natsSubscription_QueuedMsgs (natsSubscription *sub, uint64_t *queuedMsgs)
 Gets the number of pending messages. More...
 
NATS_EXTERN int64_t natsSubscription_GetID (natsSubscription *sub)
 Gets the subscription id. More...
 
NATS_EXTERN const char * natsSubscription_GetSubject (natsSubscription *sub)
 Gets the subject name. More...
 
NATS_EXTERN natsStatus natsSubscription_SetPendingLimits (natsSubscription *sub, int msgLimit, int bytesLimit)
 Sets the limit for pending messages and bytes. More...
 
NATS_EXTERN natsStatus natsSubscription_GetPendingLimits (natsSubscription *sub, int *msgLimit, int *bytesLimit)
 Returns the current limit for pending messages and bytes. More...
 
NATS_EXTERN natsStatus natsSubscription_GetPending (natsSubscription *sub, int *msgs, int *bytes)
 Returns the number of pending messages and bytes. More...
 
NATS_EXTERN natsStatus natsSubscription_GetDelivered (natsSubscription *sub, int64_t *msgs)
 Returns the number of delivered messages. More...
 
NATS_EXTERN natsStatus natsSubscription_GetDropped (natsSubscription *sub, int64_t *msgs)
 Returns the number of dropped messages. More...
 
NATS_EXTERN natsStatus natsSubscription_GetMaxPending (natsSubscription *sub, int *msgs, int *bytes)
 Returns the maximum number of pending messages and bytes. More...
 
NATS_EXTERN natsStatus natsSubscription_ClearMaxPending (natsSubscription *sub)
 Clears the statistics regarding the maximum pending values. More...
 
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. More...
 
NATS_EXTERN bool natsSubscription_IsValid (natsSubscription *sub)
 Checks the validity of the subscription. More...
 
NATS_EXTERN natsStatus natsSubscription_Drain (natsSubscription *sub)
 Drains the subscription with a default timeout. More...
 
NATS_EXTERN natsStatus natsSubscription_DrainTimeout (natsSubscription *sub, int64_t timeout)
 Drains the subscription with the specified timeout. More...
 
NATS_EXTERN natsStatus natsSubscription_WaitForDrainCompletion (natsSubscription *sub, int64_t timeout)
 Blocks until the drain operation completes. More...
 
NATS_EXTERN natsStatus natsSubscription_DrainCompletionStatus (natsSubscription *sub)
 Returns the status of the drain after completion. More...
 
NATS_EXTERN natsStatus natsSubscription_SetOnCompleteCB (natsSubscription *sub, natsOnCompleteCB cb, void *closure)
 Sets a completion callback. More...
 
NATS_EXTERN void natsSubscription_Destroy (natsSubscription *sub)
 Destroys the subscription. More...
 
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. More...
 
NATS_EXTERN natsStatus stanConnection_GetNATSConnection (stanConnection *sc, natsConnection **nc)
 Returns the underlying NATS Connection. More...
 
NATS_EXTERN void stanConnection_ReleaseNATSConnection (stanConnection *sc)
 Releases the NATS Connection. More...
 
NATS_EXTERN natsStatus stanConnection_Close (stanConnection *sc)
 Closes the connection. More...
 
NATS_EXTERN natsStatus stanConnection_Destroy (stanConnection *sc)
 Destroys the connection object. More...
 
NATS_EXTERN natsStatus stanConnection_Publish (stanConnection *sc, const char *channel, const void *data, int dataLen)
 Publishes data on a channel. More...
 
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. More...
 
NATS_EXTERN natsStatus stanConnection_Subscribe (stanSubscription **sub, stanConnection *sc, const char *channel, stanMsgHandler cb, void *cbClosure, stanSubOptions *options)
 Creates a subscription. More...
 
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. More...
 
NATS_EXTERN natsStatus stanSubscription_SetOnCompleteCB (stanSubscription *sub, natsOnCompleteCB cb, void *closure)
 Sets a completion callback. More...
 
NATS_EXTERN natsStatus stanSubscription_AckMsg (stanSubscription *sub, stanMsg *msg)
 Acknowledge a message. More...
 
NATS_EXTERN natsStatus stanSubscription_Unsubscribe (stanSubscription *sub)
 Permanently remove a subscription. More...
 
NATS_EXTERN natsStatus stanSubscription_Close (stanSubscription *sub)
 Closes the subscription. More...
 
NATS_EXTERN void stanSubscription_Destroy (stanSubscription *sub)
 Destroys the subscription. More...
 
NATS_EXTERN natsStatus jsOptions_Init (jsOptions *opts)
 Initializes a streaming context options structure. More...
 
NATS_EXTERN natsStatus natsConnection_JetStream (jsCtx **js, natsConnection *nc, jsOptions *opts)
 Returns a new JetStream context. More...
 
NATS_EXTERN void jsCtx_Destroy (jsCtx *js)
 Destroys the JetStream context. More...
 
NATS_EXTERN natsStatus jsStreamConfig_Init (jsStreamConfig *cfg)
 Initializes a streaming configuration structure. More...
 
NATS_EXTERN natsStatus jsPlacement_Init (jsPlacement *placement)
 Initializes a placement configuration structure. More...
 
NATS_EXTERN natsStatus jsStreamSource_Init (jsStreamSource *source)
 Initializes a stream source configuration structure. More...
 
NATS_EXTERN natsStatus jsExternalStream_Init (jsExternalStream *external)
 Initializes an external stream configuration structure. More...
 
NATS_EXTERN natsStatus jsRePublish_Init (jsRePublish *rp)
 Initializes a republish structure. More...
 
NATS_EXTERN natsStatus js_AddStream (jsStreamInfo **si, jsCtx *js, jsStreamConfig *cfg, jsOptions *opts, jsErrCode *errCode)
 Creates a stream. More...
 
NATS_EXTERN natsStatus js_UpdateStream (jsStreamInfo **si, jsCtx *js, jsStreamConfig *cfg, jsOptions *opts, jsErrCode *errCode)
 Updates a stream. More...
 
NATS_EXTERN natsStatus js_PurgeStream (jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode)
 Purges a stream. More...
 
NATS_EXTERN natsStatus js_DeleteStream (jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode)
 Deletes a stream. More...
 
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. More...
 
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. More...
 
NATS_EXTERN natsStatus jsDirectGetMsgOptions_Init (jsDirectGetMsgOptions *opts)
 Initializes a direct get message options structure. More...
 
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. More...
 
NATS_EXTERN natsStatus js_DeleteMsg (jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode)
 Deletes a message from the stream. More...
 
NATS_EXTERN natsStatus js_EraseMsg (jsCtx *js, const char *stream, uint64_t seq, jsOptions *opts, jsErrCode *errCode)
 Erases a message from the stream. More...
 
NATS_EXTERN natsStatus js_GetStreamInfo (jsStreamInfo **si, jsCtx *js, const char *stream, jsOptions *opts, jsErrCode *errCode)
 Retreives information from a stream. More...
 
NATS_EXTERN void jsStreamInfo_Destroy (jsStreamInfo *si)
 Destroys the stream information object. More...
 
NATS_EXTERN natsStatus js_Streams (jsStreamInfoList **list, jsCtx *js, jsOptions *opts, jsErrCode *errCode)
 Retrieves the list of all available streams. More...
 
NATS_EXTERN void jsStreamInfoList_Destroy (jsStreamInfoList *list)
 Destroys the stream information list object. More...
 
NATS_EXTERN natsStatus js_StreamNames (jsStreamNamesList **list, jsCtx *js, jsOptions *opts, jsErrCode *errCode)
 Retrieves the list of all available stream names. More...
 
NATS_EXTERN void jsStreamNamesList_Destroy (jsStreamNamesList *list)
 Destroys the stream names list object. More...
 
NATS_EXTERN natsStatus jsConsumerConfig_Init (jsConsumerConfig *cc)
 Initializes a consumer configuration structure. More...
 
NATS_EXTERN natsStatus js_AddConsumer (jsConsumerInfo **ci, jsCtx *js, const char *stream, jsConsumerConfig *cfg, jsOptions *opts, jsErrCode *errCode)
 Adds a JetStream consumer. More...
 
NATS_EXTERN natsStatus js_UpdateConsumer (jsConsumerInfo **ci, jsCtx *js, const char *stream, jsConsumerConfig *cfg, jsOptions *opts, jsErrCode *errCode)
 Updates a JetStream consumer. More...
 
NATS_EXTERN natsStatus js_GetConsumerInfo (jsConsumerInfo **ci, jsCtx *js, const char *stream, const char *consumer, jsOptions *opts, jsErrCode *errCode)
 Retrieves information about a consumer. More...
 
NATS_EXTERN natsStatus js_DeleteConsumer (jsCtx *js, const char *stream, const char *consumer, jsOptions *opts, jsErrCode *errCode)
 Deletes a consumer. More...
 
NATS_EXTERN natsStatus js_PauseConsumer (jsConsumerPauseResponse **new_cpr, jsCtx *js, const char *stream, const char *consumer, uint64_t pauseUntil, jsOptions *opts, jsErrCode *errCode)
 Pauses a consumer. More...
 
NATS_EXTERN void jsConsumerPauseResponse_Destroy (jsConsumerPauseResponse *cpr)
 Destroys the PauseConsumer response object. More...
 
NATS_EXTERN void jsConsumerInfo_Destroy (jsConsumerInfo *ci)
 Destroys the consumer information object. More...
 
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. More...
 
NATS_EXTERN void jsConsumerInfoList_Destroy (jsConsumerInfoList *list)
 Destroys the consumer information list object. More...
 
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. More...
 
NATS_EXTERN void jsConsumerNamesList_Destroy (jsConsumerNamesList *list)
 Destroys the consumer names list object. More...
 
NATS_EXTERN natsStatus js_GetAccountInfo (jsAccountInfo **ai, jsCtx *js, jsOptions *opts, jsErrCode *errCode)
 Retrieves information about the JetStream usage from an account. More...
 
NATS_EXTERN void jsAccountInfo_Destroy (jsAccountInfo *ai)
 Destroys the account information object. More...
 
NATS_EXTERN natsStatus jsPubOptions_Init (jsPubOptions *opts)
 Initializes a publish options structure. More...
 
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. More...
 
NATS_EXTERN natsStatus js_PublishMsg (jsPubAck **pubAck, jsCtx *js, natsMsg *msg, jsPubOptions *opts, jsErrCode *errCode)
 Publishes a message to JetStream. More...
 
NATS_EXTERN void jsPubAck_Destroy (jsPubAck *pubAck)
 Destroys the publish acknowledgment object. More...
 
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. More...
 
NATS_EXTERN natsStatus js_PublishMsgAsync (jsCtx *js, natsMsg **msg, jsPubOptions *opts)
 Publishes a message to JetStream but does not wait for a jsPubAck. More...
 
NATS_EXTERN natsStatus js_PublishAsyncComplete (jsCtx *js, jsPubOptions *opts)
 Wait for all outstanding messages to be acknowledged. More...
 
NATS_EXTERN natsStatus js_PublishAsyncGetPendingList (natsMsgList *pending, jsCtx *js)
 Returns the list of pending messages published asynchronously. More...
 
NATS_EXTERN natsStatus jsSubOptions_Init (jsSubOptions *opts)
 Initializes a subscribe options structure. More...
 
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. More...
 
NATS_EXTERN natsStatus js_SubscribeMulti (natsSubscription **sub, jsCtx *js, const char **subjects, int numSubjects, natsMsgHandler cb, void *cbClosure, jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode)
 Create an asynchronous subscription to multiple subjects. More...
 
NATS_EXTERN natsStatus js_SubscribeSync (natsSubscription **sub, jsCtx *js, const char *subject, jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode)
 Create a synchronous subscription. More...
 
NATS_EXTERN natsStatus js_SubscribeSyncMulti (natsSubscription **sub, jsCtx *js, const char **subjects, int numSubjects, jsOptions *opts, jsSubOptions *subOpts, jsErrCode *errCode)
 Create an asynchronous subscription to multiple subjects. More...
 
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. More...
 
NATS_EXTERN natsStatus natsSubscription_Fetch (natsMsgList *list, natsSubscription *sub, int batch, int64_t timeout, jsErrCode *errCode)
 Fetches messages for a pull subscription. More...
 
NATS_EXTERN natsStatus jsFetchRequest_Init (jsFetchRequest *request)
 Initializes a fetch request options structure. More...
 
NATS_EXTERN natsStatus js_PullSubscribeAsync (natsSubscription **newsub, jsCtx *js, const char *subject, const char *durable, natsMsgHandler msgCB, void *msgCBClosure, jsOptions *jsOpts, jsSubOptions *opts, jsErrCode *errCode)
 Starts a Pull based JetStream subscription, and delivers messages to a user callback asynchronously. More...
 
NATS_EXTERN natsStatus natsSubscription_FetchRequest (natsMsgList *list, natsSubscription *sub, jsFetchRequest *request)
 Fetches messages for a pull subscription with a complete request configuration. More...
 
NATS_EXTERN natsStatus natsSubscription_GetConsumerInfo (jsConsumerInfo **ci, natsSubscription *sub, jsOptions *opts, jsErrCode *errCode)
 Returns the jsConsumerInfo associated with this subscription. More...
 
NATS_EXTERN natsStatus natsSubscription_GetSequenceMismatch (jsConsumerSequenceMismatch *csm, natsSubscription *sub)
 Returns the consumer sequence mismatch information. More...
 
NATS_EXTERN natsStatus natsMsg_GetMetaData (jsMsgMetaData **new_meta, natsMsg *msg)
 Returns metadata from this JetStream message. More...
 
NATS_EXTERN void jsMsgMetaData_Destroy (jsMsgMetaData *meta)
 Destroys the message metadata object. More...
 
NATS_EXTERN natsStatus natsMsg_Ack (natsMsg *msg, jsOptions *opts)
 Acknowledges a message. More...
 
NATS_EXTERN natsStatus natsMsg_AckSync (natsMsg *msg, jsOptions *opts, jsErrCode *errCode)
 Acknowledges a message and wait for a confirmation. More...
 
NATS_EXTERN natsStatus natsMsg_Nak (natsMsg *msg, jsOptions *opts)
 Negatively acknowledges a message. More...
 
NATS_EXTERN natsStatus natsMsg_NakWithDelay (natsMsg *msg, int64_t delay, jsOptions *opts)
 Negatively acknowledges a message. More...
 
NATS_EXTERN natsStatus natsMsg_InProgress (natsMsg *msg, jsOptions *opts)
 Resets redelivery timer on the server. More...
 
NATS_EXTERN natsStatus natsMsg_Term (natsMsg *msg, jsOptions *opts)
 Abandon this message. More...
 
NATS_EXTERN uint64_t natsMsg_GetSequence (natsMsg *msg)
 Returns the sequence number of this JetStream message. More...
 
NATS_EXTERN int64_t natsMsg_GetTime (natsMsg *msg)
 Returns the timestamp (in UTC) of this JetStream message. More...
 
NATS_EXTERN natsStatus kvConfig_Init (kvConfig *cfg)
 Initializes a KeyValue configuration structure. More...
 
NATS_EXTERN natsStatus js_CreateKeyValue (kvStore **new_kv, jsCtx *js, kvConfig *cfg)
 Creates a KeyValue store with a given configuration. More...
 
NATS_EXTERN natsStatus js_KeyValue (kvStore **new_kv, jsCtx *js, const char *bucket)
 Looks-up and binds to an existing KeyValue store. More...
 
NATS_EXTERN natsStatus js_DeleteKeyValue (jsCtx *js, const char *bucket)
 Deletes a KeyValue store. More...
 
NATS_EXTERN void kvStore_Destroy (kvStore *kv)
 Destroys a KeyValue store object. More...
 
NATS_EXTERN const char * kvEntry_Bucket (kvEntry *e)
 Returns the name of the bucket the data was loaded from. More...
 
NATS_EXTERN const char * kvEntry_Key (kvEntry *e)
 Returns the name of the key that was retrieved. More...
 
NATS_EXTERN const void * kvEntry_Value (kvEntry *e)
 Returns the value for this key. More...
 
NATS_EXTERN int kvEntry_ValueLen (kvEntry *e)
 Returns the value length for this key. More...
 
NATS_EXTERN const char * kvEntry_ValueString (kvEntry *e)
 Returns the value, as a string, for this key. More...
 
NATS_EXTERN uint64_t kvEntry_Revision (kvEntry *e)
 Returns the unique sequence for this value. More...
 
NATS_EXTERN int64_t kvEntry_Created (kvEntry *e)
 Returns the time (in UTC) the data was put in the bucket. More...
 
NATS_EXTERN uint64_t kvEntry_Delta (kvEntry *e)
 Returns the distance from the latest value. More...
 
NATS_EXTERN kvOperation kvEntry_Operation (kvEntry *e)
 Returns the type of operation of this value. More...
 
NATS_EXTERN void kvEntry_Destroy (kvEntry *e)
 Destroys the KeyValue entry object. More...
 
NATS_EXTERN natsStatus kvStore_Get (kvEntry **new_entry, kvStore *kv, const char *key)
 Returns the latest entry for the key. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
NATS_EXTERN natsStatus kvStore_Delete (kvStore *kv, const char *key)
 Deletes a key by placing a delete marker and leaving all revisions. More...
 
NATS_EXTERN natsStatus kvStore_Purge (kvStore *kv, const char *key, kvPurgeOptions *opts)
 Deletes a key by placing a purge marker and removing all revisions. More...
 
NATS_EXTERN natsStatus kvWatchOptions_Init (kvWatchOptions *opts)
 Initializes a KeyValue watcher options structure. More...
 
NATS_EXTERN natsStatus kvPurgeOptions_Init (kvPurgeOptions *opts)
 Initializes a KeyValue purge options structure. More...
 
NATS_EXTERN natsStatus kvStore_PurgeDeletes (kvStore *kv, kvPurgeOptions *opts)
 Purge and removes delete markers. More...
 
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. More...
 
NATS_EXTERN natsStatus kvStore_WatchMulti (kvWatcher **new_watcher, kvStore *kv, const char **keys, int numKeys, kvWatchOptions *opts)
 Returns a watcher for any updates to keys that match one of the keys argument. More...
 
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. More...
 
NATS_EXTERN natsStatus kvStore_Keys (kvKeysList *list, kvStore *kv, kvWatchOptions *opts)
 Returns all keys in the bucket. More...
 
NATS_EXTERN natsStatus kvStore_KeysWithFilters (kvKeysList *list, kvStore *kv, const char **filters, int numFilters, kvWatchOptions *opts)
 Returns all keys in the bucket which matches the list of subject like filters. More...
 
NATS_EXTERN void kvKeysList_Destroy (kvKeysList *list)
 Destroys this list of KeyValue store key strings. More...
 
NATS_EXTERN natsStatus kvStore_History (kvEntryList *list, kvStore *kv, const char *key, kvWatchOptions *opts)
 Returns all historical entries for the key. More...
 
NATS_EXTERN void kvEntryList_Destroy (kvEntryList *list)
 Destroys this list of KeyValue store entries. More...
 
NATS_EXTERN const char * kvStore_Bucket (kvStore *kv)
 Returns the bucket name of this KeyValue store object. More...
 
NATS_EXTERN natsStatus kvStore_Status (kvStatus **new_status, kvStore *kv)
 Returns the status and configuration of a bucket. More...
 
NATS_EXTERN natsStatus kvWatcher_Next (kvEntry **new_entry, kvWatcher *w, int64_t timeout)
 Returns the next entry for this watcher. More...
 
NATS_EXTERN natsStatus kvWatcher_Stop (kvWatcher *w)
 Stops the watcher. More...
 
NATS_EXTERN void kvWatcher_Destroy (kvWatcher *w)
 Destroys the KeyValue watcher object. More...
 
NATS_EXTERN const char * kvStatus_Bucket (kvStatus *sts)
 Returns the bucket name. More...
 
NATS_EXTERN uint64_t kvStatus_Values (kvStatus *sts)
 Returns how many messages are in the bucket, including historical values. More...
 
NATS_EXTERN int64_t kvStatus_History (kvStatus *sts)
 Returns the configured history kept per key. More...
 
NATS_EXTERN int64_t kvStatus_TTL (kvStatus *sts)
 Returns how long the bucket keeps values for. More...
 
NATS_EXTERN int64_t kvStatus_Replicas (kvStatus *sts)
 Returns the number of replicas to keep for a bucket. More...
 
NATS_EXTERN uint64_t kvStatus_Bytes (kvStatus *sts)
 Returns the size (in bytes) of this bucket. More...
 
NATS_EXTERN void kvStatus_Destroy (kvStatus *sts)
 Destroys the KeyValue status object. More...
 
NATS_EXTERN microErrormicro_AddService (microService **new_microservice, natsConnection *nc, microServiceConfig *config)
 Creates and starts a new microservice. More...
 
NATS_EXTERN microErrormicroService_AddEndpoint (microService *m, microEndpointConfig *config)
 Adds an endpoint to a microservice and starts listening for messages. More...
 
NATS_EXTERN microErrormicroService_AddGroup (microGroup **new_group, microService *m, microGroupConfig *config)
 Adds an group (prefix) to a microservice. More...
 
NATS_EXTERN microErrormicroService_Destroy (microService *m)
 Destroys a microservice, stopping it first if needed. More...
 
NATS_EXTERN natsConnectionmicroService_GetConnection (microService *m)
 Returns the connection associated with the service. If the service was successfully started, it is safe to assume it's not NULL, however it may already have been disconnected or closed. More...
 
NATS_EXTERN microErrormicroService_GetInfo (microServiceInfo **new_info, microService *m)
 Returns a microServiceInfo for a microservice. More...
 
NATS_EXTERN void * microService_GetState (microService *m)
 Returns the pointer to state data (closure). It is originally provided in microServiceConfig.State. More...
 
NATS_EXTERN microErrormicroService_GetStats (microServiceStats **new_stats, microService *m)
 Returns run-time statistics for a microservice. More...
 
NATS_EXTERN bool microService_IsStopped (microService *m)
 Checks if the service is stopped. More...
 
NATS_EXTERN microErrormicroService_Run (microService *m)
 Waits for a microservice to stop. More...
 
NATS_EXTERN microErrormicroService_Stop (microService *m)
 Stops a running microservice. More...
 
NATS_EXTERN microErrormicroGroup_AddGroup (microGroup **new_group, microGroup *parent, microGroupConfig *config)
 Adds a sub-group to microGroup. More...
 
NATS_EXTERN microErrormicroGroup_AddEndpoint (microGroup *g, microEndpointConfig *config)
 Adds an endpoint to a microGroup and starts listening for messages. More...
 
NATS_EXTERN microErrormicroRequest_AddHeader (microRequest *req, const char *key, const char *value)
 Adds a header to the underlying NATS request message. More...
 
NATS_EXTERN microErrormicroRequest_DeleteHeader (microRequest *req, const char *key)
 Deletes a header from the underlying NATS request message. More...
 
NATS_EXTERN natsConnectionmicroRequest_GetConnection (microRequest *req)
 Returns the connection associated with the request. More...
 
NATS_EXTERN const char * microRequest_GetData (microRequest *req)
 Returns the data in the the request, as a byte array. More...
 
NATS_EXTERN int microRequest_GetDataLength (microRequest *req)
 Returns the number of data bytes in the the request. More...
 
NATS_EXTERN void * microRequest_GetEndpointState (microRequest *req)
 Returns the pointer to the user-provided endpoint state, if the request is associated with an endpoint. More...
 
NATS_EXTERN microErrormicroRequest_GetHeaderKeys (microRequest *req, const char ***keys, int *count)
 Gets the list of all header keys in the NATS message underlying the request. More...
 
NATS_EXTERN microErrormicroRequest_GetHeaderValue (microRequest *req, const char *key, const char **value)
 Get the header entry associated with key from the NATS message underlying the request. More...
 
NATS_EXTERN microErrormicroRequest_GetHeaderValues (microRequest *req, const char *key, const char ***values, int *count)
 Get all header values associated with key from the NATS message underlying the request. More...
 
NATS_EXTERN natsMsgmicroRequest_GetMsg (microRequest *req)
 Get the NATS message underlying the request. More...
 
NATS_EXTERN const char * microRequest_GetReply (microRequest *req)
 Returns the reply subject set in this message. More...
 
NATS_EXTERN microServicemicroRequest_GetService (microRequest *req)
 Returns the pointer to the microservice associated with the request. More...
 
NATS_EXTERN void * microRequest_GetServiceState (microRequest *req)
 Returns the pointer to the user-provided service state. More...
 
NATS_EXTERN const char * microRequest_GetSubject (microRequest *req)
 Returns the subject of the request message. More...
 
NATS_EXTERN microErrormicroRequest_Respond (microRequest *req, const char *data, size_t len)
 Respond to a request, on the same NATS connection. More...
 
NATS_EXTERN microErrormicroRequest_RespondError (microRequest *req, microError *err)
 Respond to a request with a simple error. More...
 
NATS_EXTERN microErrormicroRequest_RespondCustom (microRequest *req, microError *err, const char *data, size_t len)
 Respond to a message, with an OK or an error. More...
 
NATS_EXTERN microErrormicroRequest_SetHeader (microRequest *req, const char *key, const char *value)
 Add value to the header associated with key in the NATS message underlying the request. More...
 
NATS_EXTERN microErrormicro_Errorf (const char *format,...)
 creates a new microError, with a printf-like formatted message. More...
 
NATS_EXTERN microErrormicro_ErrorfCode (int code, const char *format,...)
 creates a new microError, with a code and a printf-like formatted message. More...
 
NATS_EXTERN microErrormicro_ErrorFromStatus (natsStatus s)
 Wraps a NATS status into a microError, if not a NATS_OK. More...
 
NATS_EXTERN int microError_Code (microError *err)
 returns the int code of the error. More...
 
NATS_EXTERN void microError_Destroy (microError *err)
 destroys a microError. More...
 
NATS_EXTERN natsStatus microError_Status (microError *err)
 Returns the NATS status associated with the error. More...
 
NATS_EXTERN const char * microError_String (microError *err, char *buf, size_t len)
 Returns a printable string with the error message. More...
 
NATS_EXTERN microErrormicroError_Wrapf (microError *err, const char *format,...)
 Wraps an exising microError with a higher printf-like formatted message. More...
 
NATS_EXTERN microErrormicro_NewClient (microClient **new_client, natsConnection *nc, microClientConfig *cfg)
 Creates a new microservice client. More...
 
NATS_EXTERN void microClient_Destroy (microClient *client)
 Destroys a microservice client. More...
 
NATS_EXTERN microErrormicroClient_DoRequest (natsMsg **reply, microClient *client, const char *subject, const char *data, int data_len)
 Sends a request to a microservice and receives the response. More...
 
NATS_EXTERN void microServiceInfo_Destroy (microServiceInfo *info)
 Destroys a microServiceInfo object. More...
 
NATS_EXTERN void microServiceStats_Destroy (microServiceStats *stats)
 Destroys a microServiceStats object. More...
 

Variables

NATS_EXTERN microErrormicro_ErrorOutOfMemory
 
NATS_EXTERN microErrormicro_ErrorInvalidArg
 

Macro Definition Documentation

◆ NATS_EXTERN

#define NATS_EXTERN

Based on the platform this is compiled on, it will resolve to the appropriate instruction so that objects are properly exported when building the shared library.

◆ NATS_DEFAULT_URL

#define NATS_DEFAULT_URL   "nats://localhost:4222"

This is the default URL a NATS Server, running with default listen port, can be reached at.

◆ JSMsgSize

#define JSMsgSize   "Nats-Msg-Size"

When creating a JetStream consumer, if the HeadersOnly boolean is specified, the subscription will receive messages with headers only (no message payload), and a header of this name containing the size of the message payload that was omitted.

See also
jsConsumerConfig

◆ JSMsgRollup

#define JSMsgRollup   "Nats-Rollup"

If message is sent to a stream's subject with this header set, and the stream is configured with AllowRollup option, then the server will insert this message and delete all previous messages in the stream.

If the header is set to JSMsgRollupSubject, then only messages on the specific subject this message is sent to are deleted.

If the header is set to JSMsgRollupAll, then all messages on all subjects are deleted.

◆ JSMsgRollupSubject

#define JSMsgRollupSubject   "sub"

This is a possible value for the JSMsgRollup header indicating that only messages for the subject the rollup message is sent will be removed.

See also
JSMsgRollup

◆ JSMsgRollupAll

#define JSMsgRollupAll   "all"

This is a possible value for the JSMsgRollup header indicating that all messages for all subjects will be removed.

See also
JSMsgRollup

◆ JSStream

#define JSStream   "Nats-Stream"

◆ JSSequence

#define JSSequence   "Nats-Sequence"

◆ JSLastSequence

#define JSLastSequence   "Nats-Last-Sequence"

◆ JSTimeStamp

#define JSTimeStamp   "Nats-Time-Stamp"

◆ JSSubject

#define JSSubject   "Nats-Subject"

Typedef Documentation

◆ natsSock

typedef int natsSock