class

NATS::Objects::Client

Inherits Reference / Object

Constructors

new(nats : NATS::Client)
Source

Instance methods

create_bucket(name : String, description : String = "", *, ttl : Time::Span | Nil = nil, storage : JetStream::StreamConfig::Storage = :file, replicas : Int | Nil = nil, max_bytes : Int | Nil = nil, placement : JetStream::StreamConfig::Placement | Nil = nil)

Create a bucket in the object store

bucket = nats.objects.create_bucket("my-bucket")

Give the bucket a description that will show up when you get bucket metadata

bucket = nats.objects.create_bucket("uploads", description: "Storage for user uploads")

Set a maximum lifetime for your objects, after which they are deleted:

bucket = nats.objects.create_bucket("snapchat-images", ttl: 1.day)

Replicate your objects across multiple NATS servers in your cluster:

bucket = nats.objects.create_bucket("durable-storage", replicas: 3)
Source
delete(bucket : String, key : String)
Source
delete_bucket(name : String)
Source
get(bucket : String, key : String) : IO | Nil
Source
get_bucket(name : String)
Source
get_info(bucket : String, key : String)
Source
get_info(bucket : String, *, pattern : String)
Source
keys(bucket : String, pattern : String = ">") : Set(String)
Source
put(bucket : String, key : String, value : IO, description : String | Nil = nil, headers : Headers = Headers.new, chunk_size : Int = DEFAULT_CHUNK_SIZE)
Source
watch(bucket : String, key : String, &block : ObjectInfo, Watch -> )
Source
watch(bucket : String, *, pattern : String, &block : ObjectInfo, Watch -> )
Source

Nested types