forked from caraml-dev/xp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
26 lines (21 loc) · 961 Bytes
/
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
package messagequeue
// MessageQueueKind describes the message queue for transmitting event updates to and fro Treatment Service
type MessageQueueKind = string
const (
// NoopMQ is a No-Op Message Queue
NoopMQ MessageQueueKind = ""
// PubSubMQ is a PubSub Message Queue
PubSubMQ MessageQueueKind = "pubsub"
)
type MessageQueueConfig struct {
// The type of Message Queue for event updates
Kind MessageQueueKind `json:"kind" default:""`
// PubSubConfig captures the config related to publishing and subscribing to a PubSub Message Queue
PubSubConfig *PubSubConfig `json:"pub_sub_config"`
}
type PubSubConfig struct {
Project string `json:"project" default:"dev" validate:"required"`
TopicName string `json:"topic_name" default:"xp-update" validate:"required"`
// PubSubTimeoutSeconds is the duration beyond which subscribing to a topic will time out
PubSubTimeoutSeconds int `json:"pub_sub_timeout_seconds" default:"30" validate:"required"`
}