-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
66 lines (55 loc) · 1.13 KB
/
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
package piper
import (
amqp "github.com/rabbitmq/amqp091-go"
)
type Message struct {
UID string `json:"uid"`
Payload any `json:"payload"`
}
type DoneReport struct {
Status int `json:"status"`
}
type RejectReport struct {
Status int `json:"status"`
Reason string `json:"reason"`
}
type FailReport struct {
Status int `json:"status"`
Reason string `json:"reason"`
}
type Report struct {
UID string
Done *DoneReport `json:"done,omitempty"`
Reject *RejectReport `json:"reject,omitempty"`
Fail *FailReport `json:"fail,omitempty"`
}
type QueueWorkerPool struct {
workersCount int
queue string
deliveries <-chan amqp.Delivery
results chan ResultDelivery
}
type ResultDelivery struct {
WorkerId int
Delivery *amqp.Delivery
}
type ChannelPoolItemKey struct {
Name string
Type string
Queue string
Consumer string
Exchange string
RoutingKey string
}
type ConsumerConfig struct {
Exchange string
ExchangeKind string
RoutingKey string
Routines int
Queue string
}
type PublisherConfig struct {
Exchange string
ExchangeKind string
RoutingKey string
}