setup

package
v1.1.1039 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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.

func Nats

func Nats(ctx context.Context, nc common.NatsConn, js jetstream.JetStream, storageType jetstream.StorageType, config string, update bool, ns string) error

Nats sets up nats server objects.

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL