stan

package module
v0.0.0-...-1fdb7e3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package stan abstracts publish-subscribe https://docs.nats.io/developing-with-nats-streaming/streaming backend.

WARNING/TODO: messages can be considered not acknowledged,

because DurableName for subscriptions is not used yet:
https://godoc.org/github.com/nats-io/stan.go#DurableName

Both bps.NewPublisher and bps.NewSubscriber support:

client_id
  nats-streaming client ID, [0-9A-Za-z_-] only.
client_cert, client_key
  nats client certificate and key file paths.

bps.NewSubscriber supports:

queue_group
  optional queue group name for queue subscriptions: https://docs.nats.io/developing-with-nats/receiving/queues
durable_name
  durable subscriptions name: https://docs.nats.io/developing-with-nats-streaming/durables

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPublisher

func NewPublisher(stanClusterID, clientID string, opts []stan.Option) (bps.Publisher, error)

NewPublisher constructs a new STAN-backed publisher.

func NewSubscriber

func NewSubscriber(stanClusterID, clientID, queueGroup, durableName string, opts []stan.Option) (bps.Subscriber, error)

NewSubscriber constructs a new STAN-backed subscriber. By default, it starts handling from the newest available message (published after subscribing). If queueGroup is specified, all subscriptions will be queue ones: https://docs.nats.io/developing-with-nats/receiving/queues If durableName is specified, it will be used for durable subs: https://docs.nats.io/developing-with-nats-streaming/durables

Types

This section is empty.

Jump to

Keyboard shortcuts

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