kumnats

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

kumnats

Kumparan NATS Streaming Client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType string

EventType :nodoc:

type Logger

type Logger interface {
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
}

Logger :nodoc:

type NATS

type NATS interface {
	Publish(subject string, value []byte) error
	Subscribe(subject string, cb stan.MsgHandler, opts ...stan.SubscriptionOption) (stan.Subscription, error)
	QueueSubscribe(subject, queueGroup string, cb stan.MsgHandler, opts ...stan.SubscriptionOption) (stan.Subscription, error)
	Close() error
}

NATS :nodoc:

func NewNATSWithCallback

func NewNATSWithCallback(clusterID, clientID, url string, fn NatsCallback, stanOptions []stan.Option, options ...Option) (NATS, error)

NewNATSWithCallback IMPORTANT! Not to send any stan.NatsURL or stan.SetConnectionLostHandler as options

type NatsCallback

type NatsCallback func(conn NATS)

NatsCallback :nodoc:

type NatsMessage

type NatsMessage struct {
	ID     int64     `json:"id"`
	UserID int64     `json:"user_id"`
	Type   EventType `json:"type"`
	Body   string    `json:"body,omitempty"`
	Time   string    `json:"time"`
}

NatsMessage :nodoc:

type Option

type Option func(*Options) error

func WithDeadMessageRedisKey added in v1.2.0

func WithDeadMessageRedisKey(key string) Option

func WithFailedMessagePublishInterval

func WithFailedMessagePublishInterval(seconds uint64) Option

func WithFailedMessageRedisKey

func WithFailedMessageRedisKey(key string) Option

func WithLogger

func WithLogger(logger Logger) Option

func WithReconnectInterval

func WithReconnectInterval(duration time.Duration) Option

func WithRedis

func WithRedis(conn *redigo.Pool) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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