Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRoundTrip = errors.New("round trip error") ErrInterfacesRetrievalFailed = errors.New("retrieving interfaces failed") )
Functions ¶
func GetTLSConfig ¶
Types ¶
type Config ¶
type Config struct { // Common CertPath string `json:"certPath,omitempty"` KeyPath string `json:"keyPath,omitempty"` TLSMin uint16 `json:"tlsMin,omitempty"` TLSHandshakeTimeout time.Duration `json:"tlsHandshakeTimeout,omitempty"` // Client only DialerTimeout time.Duration `json:"dialerTimeout,omitempty"` DialerKeepAlive time.Duration `json:"dialerKeepAlive,omitempty"` RootCAs []string `json:"rootCa,omitempty"` DisallowSystemRoot bool `json:"disallowSystemRoot,omitempty"` // Server only ClientCA string `json:"clientCa,omitempty"` ClientCertRequire bool `json:"clientCertRequire,omitempty"` Port uint16 `json:"port,omitempty"` Resolve func(pth ...string) string `json:"-"` }
Config defines configuration to be applied to network communication, allowing to globally specify TLS certificates and minimum TLS version, timeouts, and other network properties. This should typically be marshalled from a local config file, and fed to network.Init.
type Interfaces ¶
type Interfaces struct{}
func (*Interfaces) GetAddresses ¶
func (obj *Interfaces) GetAddresses(onlyIPv4 bool, onlyName string) ([]Address, error)
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network holds network configuration for both client and server operations and provides helpers methods to retrieve TLSConfig and Transport objects.
type Transport ¶
Transport implements http.Transport with a RoundTrip that has baked-in defaults, notably for GitHub It is not meant to be instantiated directly, but rather obtained through Get().Transport().
func GetTransport ¶
func GetTransport() *Transport
Click to show internal directories.
Click to hide internal directories.