Documentation ¶
Index ¶
- type App
- type AsyncResult
- type Binder
- type Broker
- type Consumer
- type Context
- type Message
- type MockContext
- func (ctx *MockContext) App() *App
- func (ctx *MockContext) Bind(v interface{}) error
- func (ctx *MockContext) Consumer() Consumer
- func (*MockContext) Deadline() (deadline time.Time, ok bool)
- func (*MockContext) Done() <-chan struct{}
- func (*MockContext) Err() error
- func (ctx *MockContext) Logger() logrus.FieldLogger
- func (ctx *MockContext) Message() Message
- func (ctx *MockContext) Reject(requeue bool) error
- func (*MockContext) Value(key interface{}) interface{}
- type MockMessage
- type OptionFunc
- type Protocol
- type Publishing
- type Signature
- type TaskFunc
- type TaskNotFound
- type TaskRejected
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func New ¶
func New(options ...OptionFunc) (*App, error)
type AsyncResult ¶
type AsyncResult struct {
ID string
}
type MockContext ¶
type MockContext struct { MessageFactory func() Message // contains filtered or unexported fields }
func NewMockContext ¶
func NewMockContext() *MockContext
func (*MockContext) App ¶
func (ctx *MockContext) App() *App
func (*MockContext) Bind ¶
func (ctx *MockContext) Bind(v interface{}) error
func (*MockContext) Consumer ¶
func (ctx *MockContext) Consumer() Consumer
func (*MockContext) Logger ¶
func (ctx *MockContext) Logger() logrus.FieldLogger
func (*MockContext) Message ¶
func (ctx *MockContext) Message() Message
func (*MockContext) Reject ¶
func (ctx *MockContext) Reject(requeue bool) error
type MockMessage ¶
type MockMessage struct { MockQueue string MockID string MockTask string MockHeaders map[string]interface{} MockContentType string MockBody []byte }
func (*MockMessage) Body ¶
func (msg *MockMessage) Body() []byte
func (*MockMessage) ContentType ¶
func (msg *MockMessage) ContentType() string
func (*MockMessage) Headers ¶
func (msg *MockMessage) Headers() map[string]interface{}
func (*MockMessage) ID ¶
func (msg *MockMessage) ID() string
func (*MockMessage) Queue ¶
func (msg *MockMessage) Queue() string
func (*MockMessage) Task ¶
func (msg *MockMessage) Task() string
type OptionFunc ¶
OptionFunc is a function that configures the App.
func SetBinder ¶
func SetBinder(binder Binder) OptionFunc
func SetBroker ¶
func SetBroker(broker Broker) OptionFunc
func SetConcurrency ¶
func SetConcurrency(concurrency int) OptionFunc
func SetDefaultQueue ¶
func SetDefaultQueue(queue string) OptionFunc
func SetLogger ¶
func SetLogger(logger logrus.FieldLogger) OptionFunc
SetLogger sets the logger that the app will use.
func SetProtocol ¶
func SetProtocol(protocol Protocol) OptionFunc
type Publishing ¶
type TaskNotFound ¶
type TaskNotFound struct {
Name string
}
func (TaskNotFound) Error ¶
func (t TaskNotFound) Error() string
type TaskRejected ¶
type TaskRejected struct {
Requeue bool
}
func (TaskRejected) Error ¶
func (t TaskRejected) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.