kumnats

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 8 Imported by: 0

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, v interface{}) 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 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