godispatch

package module
v0.0.0-...-6400f06 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2015 License: MIT Imports: 11 Imported by: 0

README

godispatch

AMQP/RabbitMQ message dispatch and processing

Documentation

Index

Constants

View Source
const (
	AbortIndex = math.MaxInt8 / 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

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

func (*Bus) Close

func (bus *Bus) Close()

func (*Bus) Connect

func (bus *Bus) Connect() error

func (*Bus) Defer

func (bus *Bus) Defer(msg *amqp.Delivery) error

func (*Bus) Handle

func (bus *Bus) Handle(msgType string, handlers []HandlerFunc)

func (*Bus) ProcessMessage

func (bus *Bus) ProcessMessage(msg *amqp.Delivery)

func (*Bus) Publish

func (bus *Bus) Publish(msg interface{}, msgType string) error

func (*Bus) Run

func (bus *Bus) Run()

func (*Bus) SendToError

func (bus *Bus) SendToError(msg *amqp.Delivery) error

func (*Bus) Use

func (bus *Bus) Use(middlewares ...HandlerFunc)

type BusConfig

type BusConfig struct {
	Url                       string
	InputQueue                string
	ErrorQueue                string
	RetryQueue                string
	RetryIntervalMilliseconds int32
	RetryLimit                int32
}

type Context

type Context struct {
	Delivery *amqp.Delivery
	Message  interface{}
	Log      Logger
	Keys     map[string]interface{}
	Errors   errorMsgs
	// contains filtered or unexported fields
}

func (*Context) Abort

func (c *Context) Abort()

func (*Context) Error

func (c *Context) Error(err error, meta interface{})

func (*Context) Fail

func (c *Context) Fail(err error)

func (*Context) Next

func (c *Context) Next()

type HandlerFunc

type HandlerFunc func(*Context)

func Recovery

func Recovery() HandlerFunc

Recovery returns a middleware that recovers from any panics and writes the error to context

type Logger

type Logger interface {
	Debugf(s string, args ...interface{})
	Debug(s string)
	Infof(s string, args ...interface{})
	Info(s string)
	Warnf(s string, args ...interface{})
	Warn(s string)
	Errorf(s string, args ...interface{})
	Error(s string)
	WithPrefix(s string) Logger
}

type StandardLogger

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

func NewStandardLogger

func NewStandardLogger(writer io.Writer) *StandardLogger

func (*StandardLogger) Debug

func (me *StandardLogger) Debug(s string)

func (*StandardLogger) Debugf

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

func (*StandardLogger) Error

func (me *StandardLogger) Error(s string)

func (*StandardLogger) Errorf

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

func (*StandardLogger) Info

func (me *StandardLogger) Info(s string)

func (*StandardLogger) Infof

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

func (*StandardLogger) Warn

func (me *StandardLogger) Warn(s string)

func (*StandardLogger) Warnf

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

func (*StandardLogger) WithPrefix

func (me *StandardLogger) WithPrefix(s string) Logger

Jump to

Keyboard shortcuts

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