natss

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	//OffsetStartAt - to start at a given msg number"
	OffsetStartAt = Offset(iota)

	//OffsetDeliverLast - deliver from the last message
	OffsetDeliverLast

	//OffsetDeliverAll - deliver all the messages form the beginning
	OffsetDeliverAll

	//OffsetStartDuration - deliver messages from a certain time
	OffsetStartDuration
)

Variables

View Source
var ErrConnLost = errors.New("nats streaming connection lost")

ErrConnLost is the error created when the underlying nats streaming client has established that the connection to the nats streaming server has been lost

View Source
var ErrNotConnected = errors.New("nats not connected")

ErrNotConnected is returned if a status is requested before the connection has been initialized

Functions

func NewMessageSink

func NewMessageSink(config MessageSinkConfig) (pubsub.MessageSink, error)

func NewMessageSource

func NewMessageSource(conf MessageSourceConfig) (pubsub.MessageSource, error)

Types

type MessageSinkConfig

type MessageSinkConfig struct {
	NatsURL   string
	ClusterID string
	Topic     string
	ClientID  string
}

type MessageSourceConfig

type MessageSourceConfig struct {
	NatsURL    string
	ClusterID  string
	Topic      string
	ConsumerID string

	//Offset - offset used for consuming messages
	Offset Offset

	//OffsetStartAtIndex - start delivering messages from this index
	OffsetStartAtIndex uint64

	//OffsetStartDuration - start delivering messages from this duration ago
	OffsetStartDuration time.Duration

	NonDurable  bool
	AckWait     *time.Duration
	MaxInflight *int
}

type Offset

type Offset int

Offset - represents offset used for consuming msgs from the queue

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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