-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
43 lines (39 loc) · 807 Bytes
/
main.go
File metadata and controls
43 lines (39 loc) · 807 Bytes
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
package main
// import (
// "encoding/json"
// "errors"
// "flag"
// "fmt"
// "io/ioutil"
// "log"
// "net/http"
// "net/url"
// "regexp"
// "strings"
// "time"
// )
import (
"github.com/psprings/switch/internal/config"
"github.com/psprings/switch/internal/queues/aws/sqs"
"github.com/psprings/switch/internal/server"
)
func main() {
c := config.Retrieve()
// For testing
queues := []sqs.PollConfig{
sqs.PollConfig{
QueueURL: c.QueueURL,
MaxNumberOfMessages: 10,
VisibilityTimeout: 20,
WaitTimeSeconds: 0,
PollInterval: c.PollInterval,
BackingURL: c.BackingURL,
},
}
c.SqsQueues = queues
if c.Mode == "send" || c.Mode == "both" {
server.Start(c)
} else {
sqs.Receive(queues)
}
}