This repository has been archived by the owner on May 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.go
42 lines (39 loc) · 1.58 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Package dispatcher is an asynchronous task queue/job queue based on distributed message passing.
package dispatcher
import "crypto/tls"
// ServerConfig is a configuration which needs for server creation.
//
// AMQPConnectionString example: amqp://guest:guest@localhost:5672/
//
// ReconnectionRetries - number of reconnection retries, when all retries exceed, server will be closed.
//
// ReconnectionIntervalSeconds - interval in seconds between every retry.
//
// SecureConnection - if true, uses TLSConfig with param InsecureSkipVerify.
//
// DebugMode - if true, enables debug level in logger (by default dispatcher uses logrus and this option enables debug level in it, if you use your own logger, omit this option).
//
// InitQueues - pass queues and binding keys to this field and server will create all of them if they don't exists.
//
// DefaultRoutingKey - default routing key for publishing messages.
//
// Logger - custom logger if you don't want to use dispatcher's default logrus.
type ServerConfig struct {
AMQPConnectionString string
ReconnectionRetriesForever bool
ReconnectionRetries int
ReconnectionIntervalSeconds int64
TLSConfig *tls.Config
SecureConnection bool
DebugMode bool // for default logger only
InitQueues []Queue
Exchange string // required
DefaultRoutingKey string // required
Logger Log
}
// Queue for creating during server creation.
// Has name and binding keys in it.
type Queue struct {
Name string
BindingKeys []string
}