MCPcopy Create free account
hub / github.com/zalando/skipper / parse

Method parse

cmd/webhook/main.go:31–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31func (c *config) parse() {
32 flag.BoolVar(&c.debug, "debug", false, "Enable debug logging")
33 flag.StringVar(&c.certFile, "tls-cert-file", os.Getenv("CERT_FILE"), "File containing the certificate for HTTPS")
34 flag.StringVar(&c.keyFile, "tls-key-file", os.Getenv("KEY_FILE"), "File containing the private key for HTTPS")
35 flag.StringVar(&c.address, "address", defaultHTTPSAddress, "The address to listen on")
36 flag.Parse()
37
38 if (c.certFile != "" || c.keyFile != "") && !(c.certFile != "" && c.keyFile != "") {
39 log.Fatal("Config parse error: both of TLS cert & key must be provided or neither (for testing )")
40 return
41 }
42
43 // support non-HTTPS for local testing
44 if (c.certFile == "" && c.keyFile == "") && c.address == defaultHTTPSAddress {
45 c.address = defaultHTTPAddress
46 }
47
48 if c.debug {
49 log.SetLevel(log.DebugLevel)
50 }
51}
52
53func main() {
54 var cfg = &config{}

Callers 1

mainFunction · 0.45

Calls 2

ParseMethod · 0.65
SetLevelMethod · 0.45

Tested by

no test coverage detected