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
objStoreConfig Struct Reference

#include <nats.h>

Public Attributes

const char * Bucket
 Bucket is the name of the object store.
 
const char * Description
 Description is an optional description for the object store.
 
int64_t TTL
 TTL is the maximum age (expressed in milliseconds) of objects in the store.
 
int64_t MaxBytes
 MaxBytes is the maximum size of the object store.
 
jsStorageType Storage
 Storage is the type of storage to use for the object store.
 
int Replicas
 Replicas is the number of replicas to keep for the object store in clustered jetstream.
 
jsPlacementPlacement
 Placement is used to declare where the object store should be placed.
 
bool Compression
 Compression enables the underlying stream compression.
 
natsMetadata Metadata
 

Detailed Description

Object store configuration object.

In order to create an object store, a configuration needs to be set. The typical usage would be to initialize all required objects on the stack and configure them, then pass the pointer to the configuration to js_CreateObjectStore.

Note
The strings are applications owned and will not be freed by the library.
See also
objStoreConfig_Init
objStore *obs = NULL;
objStoreConfig cfg;
objStoreConfig_Init(&cfg);
cfg.Bucket = "TEST";
cfg.Description = "Testing ObjectStore";
cfg.Storage = js_MemoryStorage;
cfg.TTL = 10000; // 10 seconds
cfg.MaxBytes = 1024*1024*1024;
cfg.Metadata.List = (const char*[4]){"field1", "value1", "field2", "value2"};
cfg.Metadata.Count = 2;
s = js_CreateObjectStore(&obs, js, &cfg);

Member Data Documentation

◆ Bucket

const char* objStoreConfig::Bucket

Bucket name has to be unique and can only contain alphanumeric characters, dashes, and underscores.

◆ Description

const char* objStoreConfig::Description

◆ TTL

int64_t objStoreConfig::TTL

If an object is not updated within this time, it will be removed from the store. By default, objects do not expire.

◆ MaxBytes

int64_t objStoreConfig::MaxBytes

If not specified, the default is -1 (unlimited).

◆ Storage

jsStorageType objStoreConfig::Storage

If not specified, the default is FileStorage.

◆ Replicas

int objStoreConfig::Replicas

Defaults to 1, maximum is 5.

◆ Placement

jsPlacement* objStoreConfig::Placement

Placement is used to declare where the object store should be placed via tags and/or an explicit cluster name.

◆ Compression

bool objStoreConfig::Compression
Note
Compression is supported for nats-server 2.10.0+

◆ Metadata

natsMetadata objStoreConfig::Metadata

The documentation for this struct was generated from the following file: