NATS::Objects::Client
Constructors
new(nats : NATS::Client)
SourceInstance 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)