MCPcopy Create free account
hub / github.com/cli/cli / main

Function main

script/api-host-gateway/gateway/main.go:59–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57}
58
59func main() {
60 listen := flag.String("listen", "127.0.0.2:443", "address to listen on, must be port 443 because api_host cannot carry a port")
61 gatewayHost := flag.String("gateway-host", "gh-gateway.internal", "hostname clients use to reach this gateway")
62 upstreamHost := flag.String("upstream-host", "api.github.com", "canonical GitHub API host to forward to")
63 upstreamAddr := flag.String("upstream-addr", "", "pinned host:port to dial for the upstream, bypassing DNS")
64 caOut := flag.String("ca-out", "", "path to write the generated CA certificate to")
65 logOut := flag.String("log", "", "path to append JSONL request records to")
66 readyOut := flag.String("ready", "", "path to create once the gateway is accepting connections")
67 flag.Parse()
68
69 if err := run(*listen, *gatewayHost, *upstreamHost, *upstreamAddr, *caOut, *logOut, *readyOut); err != nil {
70 log.Fatalf("gateway: %v", err)
71 }
72}
73
74func run(listen, gatewayHost, upstreamHost, upstreamAddr, caOut, logOut, readyOut string) error {
75 for name, value := range map[string]string{

Callers

nothing calls this directly

Calls 2

runFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected