go-server-sdk: github.com/launchdarkly/go-server-sdk/ldhttp Index | Files

package ldhttp

import "github.com/launchdarkly/go-server-sdk/ldhttp"

Package ldhttp provides helper functions for custom HTTP configuration. You will not need to use this package unless you need to extend the default Go HTTP client behavior, for instance, to specify additional trusted CA certificates.

Index

Package Files

http_transport.go

func NewHTTPTransport Uses

func NewHTTPTransport(options ...TransportOption) (*http.Transport, *net.Dialer, error)

NewHTTPTransport creates a customized http.Transport struct using the specified options. It returns both the Transport and an associated net.Dialer.

To configure the LaunchDarkly SDK, rather than calling this function directly, it is simpler to use ld.NewHTTPClientFactory().

type TransportOption Uses

type TransportOption interface {
    // contains filtered or unexported methods
}

TransportOption is the interface for optional configuration parameters that can be passed to NewHTTPTransport.

func CACertFileOption Uses

func CACertFileOption(filePath string) TransportOption

CACertFileOption specifies a CA certificate to be added to the trusted root CA list for HTTPS requests, when used with NewHTTPTransport. It reads the certificate data from a file in PEM format.

func CACertOption Uses

func CACertOption(certData []byte) TransportOption

CACertOption specifies a CA certificate to be added to the trusted root CA list for HTTPS requests, when used with NewHTTPTransport.

func ConnectTimeoutOption Uses

func ConnectTimeoutOption(timeout time.Duration) TransportOption

ConnectTimeoutOption specifies the maximum time to wait for a TCP connection, when used with NewHTTPTransport.

func ProxyOption Uses

func ProxyOption(url url.URL) TransportOption

ProxyOption specifies a proxy URL to be used for all requests, when used with NewHTTPTransport. This overrides any setting of the HTTP_PROXY, HTTPS_PROXY, or NO_PROXY environment variables.

Package ldhttp imports 9 packages (graph). Updated 2020-05-29. Refresh now. Tools for package owners.