// Transport that should be used when a custom CA bundle is specified with the
// SDK.
429273
func getCABundleTransport() *http.Transport {
	return &http.Transport{
		Proxy: http.ProxyFromEnvironment,
		Dial: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
		}).Dial,
		TLSHandshakeTimeout: 10 * time.Second,
	}
}
1300433
func H2Transporter(config *tls.Config) Transporter {
	if config == nil {
		config = &tls.Config{InsecureSkipVerify: true}
	}
	return &h2Transporter{
		clients:   make(map[string]*http.Client),
		tlsConfig: config,
	}
}
1319981
func (s *Swarm) TransportForDialing(a ma.Multiaddr) transport.Transport {
	protocols := a.Protocols()
	if len(protocols) == 0 {
		return nil
	}

	s.transports.RLock()
	defer s.transports.RUnlock()
	if len(s.transports.m) == 0 {
		log.Error("you have no transports configured")
		return nil
	}

	for _, p := range protocols {
		transport, ok := s.transports.m[p.Code]
		if !ok {
			continue
		}
		if transport.Proxy() {
			return transport
		}
	}

	return s.transports.m[protocols[len(protocols)-1].Code]
}
419794
func NewTransport(opts ...TransportOption) *Transport {
	options := newTransportOptions()
	for _, opt := range opts {
		opt(&options)
	}
	return options.newTransport()
}
565360
func (s *server) Transporter() Transporter {
	s.mutex.RLock()
	defer s.mutex.RUnlock()
	return s.transporter
}
715320
func (c *Cilium) SetTransport(transport runtime.ClientTransport) {
	c.Transport = transport

	c.Daemon.SetTransport(transport)

	c.Endpoint.SetTransport(transport)

	c.IPAM.SetTransport(transport)

	c.Metrics.SetTransport(transport)

	c.Policy.SetTransport(transport)

	c.Prefilter.SetTransport(transport)

	c.Service.SetTransport(transport)

}
246739
func (t *CustomTransport) RoundTrip(request *http.Request) (*http.Response, error) {
	if len(t.Headers) != 0 {
		for header, value := range t.Headers {
			request.Header.Add(header, value)
		}
	}

	resp, err := t.Transport.RoundTrip(request)

	return resp, err
}
437551
func NewTransport(clientOptionFuncs ...OptionTransportFunc) (http.RoundTripper, error) {
	t := dcosTransport{}
	for _, opt := range clientOptionFuncs {
		if err := opt(&t); err != nil {
			return nil, err
		}
	}

	tr, err := configureTLS(t.CaCertificatePath)
	if err != nil {
		return nil, err
	}

	if len(t.IAMConfigPath) != 0 {
		withIAM, err := NewRoundTripper(
			tr,
			OptionReadIAMConfig(t.IAMConfigPath))
		if err != nil {
			return nil, err
		}
		return withIAM, nil
	}

	return tr, nil
}
800461
func (c *CiliumHealth) SetTransport(transport runtime.ClientTransport) {
	c.Transport = transport

	c.Connectivity.SetTransport(transport)

	c.Restapi.SetTransport(transport)

}
1002805
func WithTransport(transport *Transport) memberSetOption {
	return func(g *memberSet) error {
		g.transport = transport
		return nil
	}
}
163702
func (t Transport) Push(bytes []byte) int {
	return int(C.pn_transport_push(t.pn, (*C.char)(unsafe.Pointer(&bytes[0])), C.size_t(len(bytes))))
}
983178
func contextTransport(ctx context.Context) http.RoundTripper {
	if client, ok := ctx.Value(HTTPClient).(*http.Client); ok {
		return client.Transport
	}
	return nil
}
1252718
func (c *KubeletClientConfig) transportConfig() *transport.Config {
	cfg := &transport.Config{
		TLS: transport.TLSConfig{
			CAFile:   c.CAFile,
			CAData:   c.CAData,
			CertFile: c.CertFile,
			CertData: c.CertData,
			KeyFile:  c.KeyFile,
			KeyData:  c.KeyData,
		},
		BearerToken: c.BearerToken,
	}
	if c.EnableHttps && !cfg.HasCA() {
		cfg.TLS.Insecure = true
	}
	return cfg
}
82530
func NewTransport(next http.RoundTripper, cbs *Callbacks) http.RoundTripper {
	// If next RoundTripper is not defined we'll use http.DefaultTransport.
	if next == nil {
		next = http.DefaultTransport
	}

	// If cbs is not defined we'll initilialize it with defaults.
	if cbs == nil {
		cbs = &Callbacks{}
	}
	// By default, path and query will be ignored.
	if cbs.PathProcessor == nil {
		cbs.PathProcessor = EliminatingProcessor
	}
	if cbs.QueryProcessor == nil {
		cbs.QueryProcessor = EliminatingProcessor
	}
	// By default, status code is set as is.
	if cbs.CodeProcessor == nil {
		cbs.CodeProcessor = IntToStringProcessor
	}

	return &Transport{next: next, cbs: cbs}
}
262931
func (c *Configurator) MustRegisterTransport(t TransportSpec) {
	if err := c.RegisterTransport(t); err != nil {
		panic(err)
	}
}
912716
func ConfigureTransport(tr *http.Transport, proto, addr string) error {
	switch proto {
	case "unix":
		return configureUnixTransport(tr, proto, addr)
	case "npipe":
		return configureNpipeTransport(tr, proto, addr)
	default:
		tr.Proxy = http.ProxyFromEnvironment
		dialer, err := DialerFromEnvironment(&net.Dialer{
			Timeout: defaultTimeout,
		})
		if err != nil {
			return err
		}
		tr.DialContext = dialer.DialContext
	}
	return nil
}
809902
func NewTransport(opts ...Option) *Transport {
	t := &Transport{}
	for _, o := range opts {
		o(t)
	}
	return t
}