-
Notifications
You must be signed in to change notification settings - Fork 2
/
mail.go
43 lines (32 loc) · 833 Bytes
/
mail.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
package main
import (
configs "MailConfigHandler/Configs"
"flag"
"fmt"
"github.com/gorilla/mux"
)
var dbContext *configs.ConfigDB
var router *mux.Router
type ApiConfig struct {
Domain *string
Info *configs.EmailProvider
}
func contains(s []ApiConfig, predict string) bool {
for _,domain:= range s {
if *domain.Domain == predict {return true}
}
return false
}
func main() {
countThreadsForUpdater := flag.Int("update-threads", 100, "an int")
portApi := flag.Int("port", 37896, "an int")
needUpdate := flag.Bool("update-cache", false, "a bool")
flag.Parse()
var config = configs.CreateConfigDB()
config, _ = config.Update(needUpdate, countThreadsForUpdater)
config.UpdateCache()
fmt.Println("Найдено: ", config.GetCount())
config, _ = config.PrepareDict()
dbContext = config
InitApi(*portApi)
}