natsx

package
v0.0.0-...-bc6c5c1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(bc string) nats_protobuf.Filter

Log provides the standardized logging service for nats queries

func Url

func Url(c Config) string

Url provides a string usable for nats.Connect

Types

type Config

type Config struct {
	Url      string
	Username string
	Password string
}

Config provides common NATs configuraiton

func (Config) String

func (c Config) String() string

String returns configuration as a string (sans username and password)

type Func

type Func func(ctx context.Context) error

Func defines a function for use by Singleton

func Singleton

func Singleton(nc *nats.Conn, subject string, interval time.Duration, fn Func) (<-chan struct{}, Func)

Singleton ensures that only one instance of a long running function will be running at a time

Jump to

Keyboard shortcuts

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