-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
52 lines (47 loc) · 983 Bytes
/
main.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
package main
/*
* Copyright © 2022 Allan Nava <EVO TEAM>
* Created 04/02/2022
* Updated 04/02/2022
*
*/
import (
"fmt"
"keycloak-api-gateway/apps/keycloak"
"keycloak-api-gateway/apps/settings"
"github.com/getevo/evo"
)
var config = struct {
DSN map[string]string `yaml:"dsn"`
Include map[string]bool `yaml:"include"`
}{}
func main() {
//
evo.Setup()
var cfg = evo.GetConfig()
//
if cfg != nil && cfg.Log.WriteFile {
fmt.Print("\n cfg != nil \n ")
//log.SetFile(cfg.Log.Path)
//log.Verbosity = log.ParseLevel(cfg.Log.Level)
}
//
evo.Get("/health", health)
//
settings.Register()
keycloak.Register(settings.Settings.Keycloak.Server, settings.Settings.Keycloak.Realm, settings.Settings.Keycloak.Client)
//
// run the evo stuff
evo.Run()
//
}
func health(request *evo.Request) {
request.Status(200)
//request.WriteResponse(true, redis.MyAddress)
}
func app(app string) bool {
if v, ok := config.Include[app]; ok {
return v
}
return false
}