-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.go
68 lines (53 loc) · 938 Bytes
/
types.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package rpc
import "github.com/streadway/amqp"
type RPC struct {
uri string
conn *amqp.Connection
name string
uuid string
token string
limit int
connect chan bool
reconnect chan bool
connected chan bool
done chan error
error chan error
handlers map[string]Handler
upstreams map[string]Upstream
channels channels
exchanges exchanges
queues queues
online bool
}
type channels struct {
common *amqp.Channel
direct *amqp.Channel
topic *amqp.Channel
}
type exchanges struct {
direct string
topic string
}
type queues struct {
common string
direct string
topic string
}
type Sender struct {
Name string
UUID string
}
type Destination struct {
Name string
UUID string
Handler string
All bool
}
type Receiver struct {
Name string
UUID string
Handler string
All bool
}
type Handler func(Sender, []byte) error
type Upstream func(Sender, Destination, []byte) error