Documentation ¶
Index ¶
- func EnsureBucket(ctx context.Context, js jetstream.JetStream, cfg jetstream.KeyValueConfig, ...) error
- func EnsureBuckets(ctx context.Context, cfg *NatsConfig, js jetstream.JetStream, ...) error
- func EnsureConsumer(ctx context.Context, js jetstream.JetStream, streamName string, ...) error
- func EnsureStream(ctx context.Context, nc common.NatsConn, js jetstream.JetStream, ...) error
- func Nats(ctx context.Context, nc common.NatsConn, js jetstream.JetStream, ...) error
- type NatsConfig
- type NatsConsumer
- type NatsKeyValue
- type NatsStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureBucket ¶ added in v1.1.754
func EnsureBucket(ctx context.Context, js jetstream.JetStream, cfg jetstream.KeyValueConfig, storageType jetstream.StorageType, namespaceBucketNameFn func(*jetstream.KeyValueConfig)) error
EnsureBucket creates a bucket if it does not exist
func EnsureBuckets ¶ added in v1.1.797
func EnsureBuckets(ctx context.Context, cfg *NatsConfig, js jetstream.JetStream, storageType jetstream.StorageType, ns string) error
EnsureBuckets creates a list of buckets if they do not exist
func EnsureConsumer ¶
func EnsureConsumer(ctx context.Context, js jetstream.JetStream, streamName string, consumerConfig jetstream.ConsumerConfig, update bool, storageType jetstream.StorageType) error
EnsureConsumer creates a new consumer appending the current semantic version number to the description. If the consumer exists and has a previous version, it upgrader it.
func EnsureStream ¶
func EnsureStream(ctx context.Context, nc common.NatsConn, js jetstream.JetStream, streamConfig jetstream.StreamConfig, storageType jetstream.StorageType) error
EnsureStream creates a new stream appending the current semantic version number to the description. If the stream exists and has a previous version, it upgrader it.
Types ¶
type NatsConfig ¶ added in v1.1.754
type NatsConfig struct { Streams []NatsStream `json:"streams"` KeyValue []NatsKeyValue `json:"buckets"` }
NatsConfig is the SHAR NATS configuration format
type NatsConsumer ¶ added in v1.1.754
type NatsConsumer struct {
Config jetstream.ConsumerConfig `json:"nats-config"`
}
NatsConsumer holds information about a NATS Consumer
type NatsKeyValue ¶ added in v1.1.754
type NatsKeyValue struct {
Config jetstream.KeyValueConfig `json:"nats-config"`
}
NatsKeyValue holds information about a NATS Key-Value store (bucket)
type NatsStream ¶ added in v1.1.754
type NatsStream struct { Config jetstream.StreamConfig `json:"nats-config"` Consumers []NatsConsumer `json:"nats-consumers"` }
NatsStream holds information about a NATS Stream