-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
53 lines (40 loc) · 1.03 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
45
46
47
48
49
50
51
52
53
/*
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"
"runtime"
log "github.com/sirupsen/logrus"
lfilters "github.com/szuecs/skipper-example-proxy/filters"
"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, runtime: %s)\n",
version, commit, runtime.Version(),
)
return
}
log.SetLevel(cfg.ApplicationLogLevel)
opt := cfg.ToOptions()
opt.CustomFilters = append(opt.CustomFilters, lfilters.NewMyFilter())
log.Fatal(skipper.Run(opt))
}