NATS C Client with JetStream and Streaming support  3.11.0
The nats.io C Client, Supported by Synadia Communications Inc.
Loading...
Searching...
No Matches
Object Stores management

Functions

NATS_EXTERN natsStatus objStoreConfig_Init (objStoreConfig *cfg)
 Initializes an Object Store configuration structure.
 
NATS_EXTERN natsStatus js_CreateObjectStore (objStore **new_obs, jsCtx *js, objStoreConfig *cfg)
 Creates an object store with a given configuration.
 
NATS_EXTERN natsStatus js_UpdateObjectStore (objStore **new_obs, jsCtx *js, objStoreConfig *cfg)
 Updates an object store with a given configuration.
 
NATS_EXTERN natsStatus js_ObjectStore (objStore **new_obs, jsCtx *js, const char *bucket)
 Looks-up and binds to an existing object store.
 
NATS_EXTERN natsStatus js_ObjectStoreNames (objStoreNamesList **new_list, jsCtx *js)
 Retrieves a list of bucket names.
 
NATS_EXTERN void objStoreNamesList_Destroy (objStoreNamesList *list)
 Destroys the object store names list object.
 
NATS_EXTERN natsStatus js_ObjectStoreStatuses (objStoreStatusesList **new_list, jsCtx *js)
 Retrieves a list of bucket statuses.
 
NATS_EXTERN void objStoreStatusesList_Destroy (objStoreStatusesList *list)
 Destroys the object store statuses list object.
 
NATS_EXTERN natsStatus js_DeleteObjectStore (jsCtx *js, const char *bucket)
 Deletes an object store.
 

Detailed Description

These functions allow to create, get or delete an Object Store.

Function Documentation

◆ objStoreConfig_Init()

NATS_EXTERN natsStatus objStoreConfig_Init ( objStoreConfig cfg)

Use this before setting specific objStoreConfig options and passing it to js_CreateObjectStore.

See also
js_CreateObjectStore
Parameters
cfgthe pointer to the stack variable objStoreConfig to initialize.

◆ js_CreateObjectStore()

NATS_EXTERN natsStatus js_CreateObjectStore ( objStore **  new_obs,
jsCtx js,
objStoreConfig cfg 
)

Creates an object store with a given configuration.

Bucket names are restricted to this set of characters: A-Z, a-z, 0-9, _ and -.

Note
The returned objStore object needs to be destroyed using objStore_Destroy when no longer needed to free allocated memory. This is different from deleting an object store from the server using the js_DeleteObjectStore API.
Parameters
new_obsthe location where to store the pointer to the objStore object.
jsthe pointer to the jsCtx object.
cfgthe pointer to the objStoreConfig configuration information used to create the objStore object.

◆ js_UpdateObjectStore()

NATS_EXTERN natsStatus js_UpdateObjectStore ( objStore **  new_obs,
jsCtx js,
objStoreConfig cfg 
)

Updates an object store with a given configuration.

Bucket names are restricted to this set of characters: A-Z, a-z, 0-9, _ and -.

Note
If the object store with given name does not exist, this will return NATS_NOT_FOUND.
The returned objStore object needs to be destroyed using objStore_Destroy when no longer needed to free allocated memory. This is different from deleting an object store from the server using the js_DeleteObjectStore API.
Parameters
new_obsthe location where to store the pointer to the objStore object.
jsthe pointer to the jsCtx object.
cfgthe pointer to the objStoreConfig configuration information used to create the objStore object.

◆ js_ObjectStore()

NATS_EXTERN natsStatus js_ObjectStore ( objStore **  new_obs,
jsCtx js,
const char *  bucket 
)

This call is when the user wants to use an existing object store. If the store does not already exists, an error is returned.

Bucket names are restricted to this set of characters: A-Z, a-z, 0-9, _ and -.

Note
The returned objStore object needs to be destroyed using objStore_Destroy when no longer needed to free allocated memory. This is different from deleting an object store from the server using the js_DeleteObjectStore API.
Parameters
new_obsthe location where to store the pointer to the objStore object.
jsthe pointer to the jsCtx object.
bucketthe name of the bucket of the existing object store.

◆ js_ObjectStoreNames()

NATS_EXTERN natsStatus js_ObjectStoreNames ( objStoreNamesList **  new_list,
jsCtx js 
)

Retrieves the list of all object store names.

Note
The returned objStoreNamesList object needs to be destroyed using objStoreNamesList_Destroy when no longer needed to free allocated memory.
See also
objStoreNamesList_Destroy
Parameters
new_listthe location where to store the pointer to the objStoreNamesList object.
jsthe pointer to the jsCtx object.

◆ objStoreNamesList_Destroy()

NATS_EXTERN void objStoreNamesList_Destroy ( objStoreNamesList list)

Releases memory allocated for this list of object store names.

Warning
All strings contained in the list will become invalid after this call.
Parameters
listthe pointer to the objStoreNamesList object.

◆ js_ObjectStoreStatuses()

NATS_EXTERN natsStatus js_ObjectStoreStatuses ( objStoreStatusesList **  new_list,
jsCtx js 
)

Retrieves the list of all object store statuses.

Note
The returned objStoreStatusesList object needs to be destroyed using objStoreStatusesList_Destroy when no longer needed to free allocated memory.
See also
objStoreStatusesList_Destroy
Parameters
new_listthe location where to store the pointer to the objStoreStatusesList object.
jsthe pointer to the jsCtx object.

◆ objStoreStatusesList_Destroy()

NATS_EXTERN void objStoreStatusesList_Destroy ( objStoreStatusesList list)

Releases memory allocated for this list of object store statuses.

Warning
All objStoreStatus objects contained in the list will become invalid after this call.
Parameters
listthe pointer to the objStoreStatusesList object.

◆ js_DeleteObjectStore()

NATS_EXTERN natsStatus js_DeleteObjectStore ( jsCtx js,
const char *  bucket 
)

This will delete the object store with the bucket name.

Bucket names are restricted to this set of characters: A-Z, a-z, 0-9, _ and -.

Parameters
jsthe pointer to the jsCtx object.
bucketthe name of the bucket of the existing object store.