/
main.go
31 lines (25 loc) · 822 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
package main
import (
"flag"
"github.com/benlaplanche/metrics-consumer/config"
"github.com/benlaplanche/metrics-consumer/nozzle"
"github.com/cloudfoundry-incubator/datadog-firehose-nozzle/uaatokenfetcher"
"log"
"os"
)
func main() {
configFilePath := flag.String("config", "config/config.json", "Path to config params for the consumer")
flag.Parse()
config, err := config.Parse(*configFilePath)
if err != nil {
log.Fatalf("Error parsing config: %s", err.Error())
}
tokenFetcher := &uaatokenfetcher.UAATokenFetcher{
UaaUrl: config.UAAURL,
Username: config.Username,
Password: config.Password,
InsecureSSLSkipVerify: config.InsecureSSLSkipVerify,
}
metrics_nozzle := nozzle.NewNozzle(config, tokenFetcher, os.Stdout, os.Stderr)
metrics_nozzle.Start()
}