Ejemplo n.º 1
0
func main() {
	var eus []string
	if len(etcdUrls) > 0 {
		eus = strings.Split(etcdUrls, ",")
	}

	options := skipper.Options{
		Address:                   address,
		EtcdUrls:                  eus,
		EtcdPrefix:                etcdPrefix,
		InnkeeperUrl:              innkeeperUrl,
		SourcePollTimeout:         time.Duration(sourcePollTimeout) * time.Millisecond,
		RoutesFile:                routesFile,
		IgnoreTrailingSlash:       false,
		OAuthUrl:                  oauthUrl,
		OAuthScope:                oauthScope,
		OAuthCredentialsDir:       oauthCredentialsDir,
		InnkeeperAuthToken:        innkeeperAuthToken,
		InnkeeperPreRouteFilters:  innkeeperPreRouteFilters,
		InnkeeperPostRouteFilters: innkeeperPostRouteFilters,
		DevMode:                   devMode}
	if insecure {
		options.ProxyOptions |= proxy.OptionsInsecure
	}

	log.Fatal(skipper.Run(options))
}
Ejemplo n.º 2
0
func main() {
	var eus []string
	if len(etcdUrls) > 0 {
		eus = strings.Split(etcdUrls, ",")
	}

	options := skipper.Options{
		Address:                   address,
		EtcdUrls:                  eus,
		EtcdPrefix:                etcdPrefix,
		InnkeeperUrl:              innkeeperUrl,
		SourcePollTimeout:         time.Duration(sourcePollTimeout) * time.Millisecond,
		RoutesFile:                routesFile,
		IgnoreTrailingSlash:       false,
		OAuthUrl:                  oauthUrl,
		OAuthScope:                oauthScope,
		OAuthCredentialsDir:       oauthCredentialsDir,
		InnkeeperAuthToken:        innkeeperAuthToken,
		InnkeeperPreRouteFilters:  innkeeperPreRouteFilters,
		InnkeeperPostRouteFilters: innkeeperPostRouteFilters,
		DevMode:                   devMode,
		MetricsListener:           metricsListener,
		MetricsPrefix:             metricsPrefix,
		EnableDebugGcMetrics:      debugGcMetrics,
		EnableRuntimeMetrics:      runtimeMetrics,
		ApplicationLogOutput:      applicationLog,
		ApplicationLogPrefix:      applicationLogPrefix,
		AccessLogOutput:           accessLog,
		AccessLogDisabled:         accessLogDisabled}

	if insecure {
		options.ProxyOptions |= proxy.OptionsInsecure
	}

	if proxyPreserveHost {
		options.ProxyOptions |= proxy.OptionsProxyPreserveHost
	}

	log.Fatal(skipper.Run(options))
}
Ejemplo n.º 3
0
func main() {
	if logLevel, err := log.ParseLevel(applicationLogLevel); err != nil {
		log.Fatal(err)
	} else {
		log.SetLevel(logLevel)
	}

	var eus []string
	if len(etcdUrls) > 0 {
		eus = strings.Split(etcdUrls, ",")
	}

	clsic, err := parseDurationFlag(closeIdleConnsPeriod)
	if err != nil {
		flag.PrintDefaults()
		os.Exit(2)
	}

	options := skipper.Options{
		Address:                   address,
		EtcdUrls:                  eus,
		EtcdPrefix:                etcdPrefix,
		KubernetesURL:             kubernetesURL,
		KubernetesHealthcheck:     kubernetesHealthcheck,
		InnkeeperUrl:              innkeeperUrl,
		SourcePollTimeout:         time.Duration(sourcePollTimeout) * time.Millisecond,
		RoutesFile:                routesFile,
		IdleConnectionsPerHost:    idleConnsPerHost,
		CloseIdleConnsPeriod:      time.Duration(clsic) * time.Second,
		IgnoreTrailingSlash:       false,
		OAuthUrl:                  oauthUrl,
		OAuthScope:                oauthScope,
		OAuthCredentialsDir:       oauthCredentialsDir,
		InnkeeperAuthToken:        innkeeperAuthToken,
		InnkeeperPreRouteFilters:  innkeeperPreRouteFilters,
		InnkeeperPostRouteFilters: innkeeperPostRouteFilters,
		DevMode:                   devMode,
		MetricsListener:           metricsListener,
		MetricsPrefix:             metricsPrefix,
		EnableDebugGcMetrics:      debugGcMetrics,
		EnableRuntimeMetrics:      runtimeMetrics,
		EnableServeRouteMetrics:   serveRouteMetrics,
		EnableServeHostMetrics:    serveHostMetrics,
		ApplicationLogOutput:      applicationLog,
		ApplicationLogPrefix:      applicationLogPrefix,
		AccessLogOutput:           accessLog,
		AccessLogDisabled:         accessLogDisabled,
		DebugListener:             debugListener,
		CertPathTLS:               certPathTLS,
		KeyPathTLS:                keyPathTLS,
		BackendFlushInterval:      backendFlushInterval,
		ExperimentalUpgrade:       experimentalUpgrade,
	}

	if insecure {
		options.ProxyFlags |= proxy.Insecure
	}

	if proxyPreserveHost {
		options.ProxyFlags |= proxy.PreserveHost
	}

	log.Fatal(skipper.Run(options))
}