pubsubconfig

package
v0.0.0-...-4125756 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Kind           string          `yaml:"kind"`
	GcpPublisher   *GcpPublisher   `yaml:"gcpPublisher"`
	GcpSubscriber  *GcpSubscriber  `yaml:"gcpSubscriber"`
	NatsPublisher  *NatsPublisher  `yaml:"natsPublisher"`
	NatsSubscriber *NatsSubscriber `yaml:"natsSubscriber"`
}

Config represent a PubSub configuration, it is defined by its kind.

func (*Config) Publisher

func (c *Config) Publisher(ctx context.Context) (kitpubsub.Publisher, func(), error)

func (*Config) Subscriber

func (c *Config) Subscriber(ctx context.Context) (kitpubsub.Subscriber, func(), error)

type GcpPublisher

type GcpPublisher struct {
	Project string `yaml:"project"`
}

type GcpSubscriber

type GcpSubscriber struct {
	GcpPublisher           `yaml:",inline"`
	MaxExtension           time.Duration `yaml:"maxExtension"`
	MaxExtensionPeriod     time.Duration `yaml:"maxExtensionPeriod"`
	MinExtensionPeriod     time.Duration `yaml:"minExtensionPeriod"`
	NumGoroutines          int           `yaml:"numGoroutines"`
	MaxOutstandingBytes    int           `yaml:"maxOutstandingBytes"`
	MaxOutstandingMessages int           `yaml:"maxOutstandingMessages"`
}

type NatsConnection

type NatsConnection struct {
	URL string
	// when we connect to nats-mqtt we might need the mqtt passwords
	MqttPasswords          string `env:"NATS_MQTT_TOKEN,overwrite"`
	PublishAsyncMaxPending int    `env:"NATS_JS_MAX_ASYNC_PUBLISH,overwrite,default=256"`
}

type NatsPublisher

type NatsPublisher struct {
	NatsConnection `yaml:",inline"`
}

NatsPublisher is a nats publisher configuration To create publisher use our k8s ressources https://github.com/nats-io/nack

type NatsSubscriber

type NatsSubscriber struct {
	NatsConnection    `yaml:",inline"`
	Stream            string `yaml:"stream"`
	ConsumerName      string `yaml:"consumerName"`
	ConsumerGroupName string `yaml:"consumerGroupName"`
}

NatsSubscriber is a nats subscriber configuration To create subscriber use our k8s ressources https://github.com/nats-io/nack

Jump to

Keyboard shortcuts

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