Documentation
¶
Index ¶
- Constants
- func AcquireNATSConnection(ctx context.Context, opts ...natsAcquireOption) (*nats.Conn, error)
- func ExternalNatsObjects(ctx context.Context, k8sClient client.Client, ...) (envVars []corev1.EnvVar, volumeMounts []corev1.VolumeMount, ...)
- func NatsObjectNameFromURL(url string) string
- func NewDurableReplayConsumer(mgr nats.JetStreamContext, streamName string, ...) error
- func NewPersistentStream(mgr nats.JetStreamContext, streamConfig *nats.StreamConfig) error
- func WithCreateStreams(streamNames ...*nats.StreamConfig) natsAcquireOption
- func WithLogger(lg *zap.SugaredLogger) natsAcquireOption
- func WithNatsOptions(opts []nats.Option) natsAcquireOption
- func WithRetrier(retrier backoffv2.Policy) natsAcquireOption
Constants ¶
View Source
const ( DefaultImage = "bitnami/nats:2.3.2-debian-10-r0" DefaultConfigReloaderImage = "connecteverything/nats-server-config-reloader:0.4.5-v1alpha2" DefaultPidFilePath = "/opt/nats/pid" DefaultPidFileName = "nats-server.pid" DefaultConfigPath = "/opt/nats/conf" ConfigFileName = "nats-config.conf" DefaultClientPort = 4222 DefaultClusterPort = 6222 DefaultHTTPPort = 8222 NkeyDir = "/etc/nkey" )
Variables ¶
This section is empty.
Functions ¶
func AcquireNATSConnection ¶ added in v0.6.1
!!blocking
default retrier policy :
retrier := backoffv2.Exponential(
backoffv2.WithMaxRetries(0), backoffv2.WithMinInterval(5*time.Second), backoffv2.WithMaxInterval(1*time.Minute), backoffv2.WithMultiplier(1.1),
)
default nats client options:
SeedKey : os.Getenv("NKEY_SEED_FILENAME")
nats.MaxReconnects(-1), nats.CustomReconnectDelay(
func(i int) time.Duration { if i == 1 { retryBackoff.Reset() } return retryBackoff.NextBackOff() },
), nats.DisconnectErrHandler(
func(nc *nats.Conn, err error) { lg.Error(err) },
),
func ExternalNatsObjects ¶
func NatsObjectNameFromURL ¶ added in v0.8.0
func NewDurableReplayConsumer ¶ added in v0.8.0
func NewPersistentStream ¶ added in v0.6.1
func NewPersistentStream(mgr nats.JetStreamContext, streamConfig *nats.StreamConfig) error
func WithCreateStreams ¶ added in v0.6.1
func WithCreateStreams(streamNames ...*nats.StreamConfig) natsAcquireOption
func WithLogger ¶ added in v0.6.1
func WithLogger(lg *zap.SugaredLogger) natsAcquireOption
func WithNatsOptions ¶ added in v0.6.1
func WithNatsOptions(opts []nats.Option) natsAcquireOption
func WithRetrier ¶ added in v0.6.1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.