-
Notifications
You must be signed in to change notification settings - Fork 30
/
main.go
44 lines (35 loc) · 1.05 KB
/
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
package main
import (
"flag"
"os"
"os/signal"
"syscall"
"code.cloudfoundry.org/lager/lagerflags"
"github.com/cloudfoundry-community/splunk-firehose-nozzle/splunknozzle"
)
var (
version string
branch string
commit string
buildos string
)
func main() {
lagerflags.AddFlags(flag.CommandLine)
logger, _ := lagerflags.New("splunk-nozzle-logger")
logger.Info("Running splunk-firehose-nozzle")
shutdownChan := make(chan os.Signal, 2)
signal.Notify(shutdownChan, syscall.SIGINT, syscall.SIGTERM)
config := splunknozzle.NewConfigFromCmdFlags(version, branch, commit, buildos)
if config.MemoryBallastSize > 0 {
ballast := make([]byte, config.MemoryBallastSize<<20)
_ = ballast
}
if config.AppCacheTTL == 0 && config.OrgSpaceCacheTTL > 0 {
logger.Info("Apps are not being cached. When apps are not cached, the org and space caching TTL is ineffective")
}
splunkNozzle := splunknozzle.NewSplunkFirehoseNozzle(config, logger)
err := splunkNozzle.Run(shutdownChan)
if err != nil {
logger.Error("Failed to run splunk-firehose-nozzle", err)
}
}