func NewServer(flags *cliFlags) (*server.Server, func(), error) {
	handlerProxyTarget := proxyTarget(flags)
	handlerStaticTarget := staticTarget(flags)
	config := flags.Log
	logger, cleanup, err := log.New(config)
	if err != nil {
		return nil, nil, err
	}
	v := flags.KeyPairs
	v2, err := authKey(v)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	handlerConfig := handler.Config{
		ProxyTarget:  handlerProxyTarget,
		StaticTarget: handlerStaticTarget,
		Logger:       logger,
		AuthKey:      v2,
	}
	router := handler.NewHandler(handlerConfig)
	zapLogger := xserver.NewRequestLogger(logger)
	v3 := _wireValue
	v4 := defaultViews()
	exporter, err := xserver.NewPrometheusExporter(logger)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	options := flags.Census
	jaegerOptions := oc.JaegerOptions(options)
	traceExporter, cleanup2, err := xserver.NewJaegerExporter(logger, jaegerOptions)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	profilingEnabler := _wireProfilingEnablerValue
	sampler := oc.TraceSampler(options)
	handlerFunc := xserver.NewRecoveryHandler(logger)
	defaultDriver := _wireDefaultDriverValue
	serverOptions := &server.Options{
		RequestLogger:         zapLogger,
		HealthChecks:          v3,
		Views:                 v4,
		ViewExporter:          exporter,
		TraceExporter:         traceExporter,
		EnableProfiling:       profilingEnabler,
		DefaultSamplingPolicy: sampler,
		RecoveryHandler:       handlerFunc,
		Driver:                defaultDriver,
	}
	serverServer := server.New(router, serverOptions)
	return serverServer, func() {
		cleanup2()
		cleanup()
	}, nil
}
// Injectors from wire.go:
Injectors from wire.go.
// Injectors from wire . go :
func NewServer(flags *cliFlags) (*server.Server, func(), error) {
	handlerProxyTarget := proxyTarget(flags)
	handlerStaticTarget := staticTarget(flags)
	config := flags.Log
	logger, cleanup, err := log.New(config)
	if err != nil {
		return nil, nil, err
	}
	v := flags.KeyPairs
	v2, err := authKey(v)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	handlerConfig := handler.Config{
		ProxyTarget:  handlerProxyTarget,
		StaticTarget: handlerStaticTarget,
		Logger:       logger,
		AuthKey:      v2,
	}
	router := handler.NewHandler(handlerConfig)
	zapLogger := xserver.NewRequestLogger(logger)
	v3 := _wireValue
	v4 := defaultViews()
	exporter, err := xserver.NewPrometheusExporter(logger)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	options := flags.Census
	jaegerOptions := oc.JaegerOptions(options)
	traceExporter, cleanup2, err := xserver.NewJaegerExporter(logger, jaegerOptions)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	profilingEnabler := _wireProfilingEnablerValue
	sampler := oc.TraceSampler(options)
	handlerFunc := xserver.NewRecoveryHandler(logger)
	defaultDriver := _wireDefaultDriverValue
	serverOptions := &server.Options{
		RequestLogger:         zapLogger,
		HealthChecks:          v3,
		Views:                 v4,
		ViewExporter:          exporter,
		TraceExporter:         traceExporter,
		EnableProfiling:       profilingEnabler,
		DefaultSamplingPolicy: sampler,
		RecoveryHandler:       handlerFunc,
		Driver:                defaultDriver,
	}
	serverServer := server.New(router, serverOptions)
	return serverServer, func() {
		cleanup2()
		cleanup()
	}, nil
}
func NewServer ( flags * cliFlags ) ( * server . Server , func ( ) , error ) { handlerProxyTarget := proxyTarget ( flags ) handlerStaticTarget := staticTarget ( flags ) config := flags . Log logger , cleanup , err := log . New ( config ) if err != nil { return nil , nil , err } v := flags . KeyPairs v2 , err := authKey ( v ) if err != nil { cleanup ( ) return nil , nil , err } handlerConfig := handler . Config { ProxyTarget : handlerProxyTarget , StaticTarget : handlerStaticTarget , Logger : logger , AuthKey : v2 , } router := handler . NewHandler ( handlerConfig ) zapLogger := xserver . NewRequestLogger ( logger ) v3 := _wireValue v4 := defaultViews ( ) exporter , err := xserver . NewPrometheusExporter ( logger ) if err != nil { cleanup ( ) return nil , nil , err } options := flags . Census jaegerOptions := oc . JaegerOptions ( options ) traceExporter , cleanup2 , err := xserver . NewJaegerExporter ( logger , jaegerOptions ) if err != nil { cleanup ( ) return nil , nil , err } profilingEnabler := _wireProfilingEnablerValue sampler := oc . TraceSampler ( options ) handlerFunc := xserver . NewRecoveryHandler ( logger ) defaultDriver := _wireDefaultDriverValue serverOptions := & server . Options { RequestLogger : zapLogger , HealthChecks : v3 , Views : v4 , ViewExporter : exporter , TraceExporter : traceExporter , EnableProfiling : profilingEnabler , DefaultSamplingPolicy : sampler , RecoveryHandler : handlerFunc , Driver : defaultDriver , } serverServer := server . New ( router , serverOptions ) return serverServer , func ( ) { cleanup2 ( ) cleanup ( ) } , nil }
Injectors from wire.go.
Injectors from wire . go .