/
main.go
47 lines (36 loc) · 871 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
/*
This command provides an executable version of skipper with the default
set of filters.
For the list of command line options, run:
skipper -help
For details about the usage and extensibility of skipper, please see the
documentation of the root skipper package.
To see which built-in filters are available, see the skipper/filters
package documentation.
*/
package main
import (
"fmt"
log "github.com/sirupsen/logrus"
"github.com/zalando/skipper"
"github.com/zalando/skipper/config"
)
var (
version string
commit string
)
func main() {
cfg := config.NewConfig()
if err := cfg.Parse(); err != nil {
log.Fatalf("Error processing config: %s", err)
}
if cfg.PrintVersion {
fmt.Printf(
"Skipper version %s (commit: %s)\n",
version, commit,
)
return
}
log.SetLevel(cfg.ApplicationLogLevel)
log.Fatal(skipper.Run(cfg.ToOptions()))
}