pkg

package
v0.0.0-...-31909b7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPSConnection is a connection error
	ErrPSConnection = errors.New("Failed to connect Pub/Sub service")
	// ErrPSPublish is a publish error
	ErrPSPublish = errors.New("Failed to publish message")
)
View Source
var (
	// AppLog is a globle instance of logrus.Logger
	AppLog *logrus.Logger
)
View Source
var (
	// Conf is config instance
	Conf config
)

Functions

func InitConf

func InitConf(file string)

InitConf initializes Conf

func InitLog

func InitLog() error

InitLog for initial log module

func P

func P(args ...interface{})

P prints debug info

func SetLogLevel

func SetLogLevel(log *logrus.Logger, levelString string) error

SetLogLevel is define log level what you want log level: panic, fatal, error, warn, info and debug

func SetLogOut

func SetLogOut(log *logrus.Logger, outString string) error

SetLogOut provide log stdout and stderr output

Types

type PSClient

type PSClient struct {
	Client emitter.Emitter
}

PSClient is a wrapper of Emitter client

func NewPSClient

func NewPSClient() *PSClient

NewPSClient returns an instance of PSClient

func (*PSClient) Connect

func (p *PSClient) Connect() error

Connect offers sync function

func (*PSClient) Disconnect

func (p *PSClient) Disconnect(waitTime uint)

Disconnect offers sync function

func (*PSClient) Publish

func (p *PSClient) Publish(key string, channel string, payload interface{}) error

Publish offers sync function

func (*PSClient) PublishWithTTL

func (p *PSClient) PublishWithTTL(key string, channel string, payload interface{}, ttl int) error

PublishWithTTL offers sync function

Jump to

Keyboard shortcuts

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