-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
40 lines (33 loc) · 835 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
package main
import (
"os"
"istio.io/istio/mixer/adapter/ibmcloudappid"
"istio.io/istio/pkg/log"
)
func main() {
log.Info(">> main() :: Starting ibmcloudappid adapter")
// Ensure we have correct configuration
cfg, err := ibmcloudappid.NewAppIDConfig()
if err != nil {
log.Infof("Failed to create ibmcloudappid.NewAppIDConfig: %s", err)
os.Exit(-1)
}
// Start communication with App ID
monitor, err := ibmcloudappid.NewMonitor(cfg)
if err != nil {
log.Errorf("Failed to create ibmcloudappid.NewMonitor: %s", err)
os.Exit(-1)
}
monitor.Start()
// Create App ID Adapter
s, err := ibmcloudappid.NewAppIDAdapter(cfg)
if err != nil {
log.Errorf("Failed to create ibmcloudappid.NewAppIDAdapter: %s", err)
os.Exit(-1)
}
shutdown := make(chan error, 1)
go func() {
s.Run(shutdown)
}()
_ = <-shutdown
}