bruya

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: MIT Imports: 10 Imported by: 0

README

bruya

Forward Redis pub/sub messages to a NATS or NATS Streaming endpoint.

Usage:
    bruya [options] [-v ...] [--redis=<url>] --nats=<url> [--channel=<channel>...]
    bruya [options] [-v ...] [--redis=<url>] --stan=<url> [--channel=<channel>...]
    bruya -h | --help | --version

Options:
    --redis=<url>           Redis URL [default: redis://localhost:6379]
    --nats=<url>            NATS URL
    --stan=<url>            NATS Streaming URL
    --channel=<channel>     Redis channel(s) to subscribe to [default: *]
    --nats-cluster-id=<id>  NATS cluster ID [default: test-cluster]
    --debug-http=<bind>     Enable pprof/expvar HTTP server.
                            Examples: "localhost:6060", ":6060"
    --debug-force-color     Force colorized logs.
    -h --help               Show this screen.
    --version               Show version.
    -v                      Enable verbose logging (-vv for very verbose)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultNameMangler

func DefaultNameMangler(redisChannelName string) (natsSubjectName string)

func SetDefaultLogger

func SetDefaultLogger(log Logger)

Types

type Bruya

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

func New

func New(options *Options) (*Bruya, error)

func (*Bruya) Run

func (b *Bruya) Run() (err error)

func (*Bruya) Stop

func (b *Bruya) Stop() error

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Panic(args ...interface{})
	Panicf(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
}

func GetDefaultLogger

func GetDefaultLogger() Logger

type NameManglerFunc

type NameManglerFunc func(redisChannelName string) (natsSubjectName string)

type Options

type Options struct {
	NatsURL           *url.URL
	Streaming         bool
	RedisURL          *url.URL
	ClusterID         string
	ClientID          string
	RedisChannelNames []string
	NameMangler       NameManglerFunc
}

type StandardLogger

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

func NewStandardLogger

func NewStandardLogger(slog *stdlog.Logger) *StandardLogger

func (*StandardLogger) Debug

func (s *StandardLogger) Debug(args ...interface{})

func (*StandardLogger) Debugf

func (s *StandardLogger) Debugf(format string, args ...interface{})

func (*StandardLogger) Error

func (s *StandardLogger) Error(args ...interface{})

func (*StandardLogger) Errorf

func (s *StandardLogger) Errorf(format string, args ...interface{})

func (*StandardLogger) Fatal

func (s *StandardLogger) Fatal(args ...interface{})

func (*StandardLogger) Fatalf

func (s *StandardLogger) Fatalf(format string, args ...interface{})

func (*StandardLogger) Info

func (s *StandardLogger) Info(args ...interface{})

func (*StandardLogger) Infof

func (s *StandardLogger) Infof(format string, args ...interface{})

func (*StandardLogger) Panic

func (s *StandardLogger) Panic(args ...interface{})

func (*StandardLogger) Panicf

func (s *StandardLogger) Panicf(format string, args ...interface{})

func (*StandardLogger) Warn

func (s *StandardLogger) Warn(args ...interface{})

func (*StandardLogger) Warnf

func (s *StandardLogger) Warnf(format string, args ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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