netstackhttp

package
v0.0.0-...-0721423 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient(s *stack.Stack, nicId tcpip.NICID, opts ...Option) *http.Client

GetClient returns an HTTP client that uses the provided netstack as its transport.

Types

type Config

type Config struct {
	TLSConfig *tls.Config
	Logger    *zap.Logger
}

type Option

type Option func(*Config)

func WithLogger

func WithLogger(logger *zap.Logger) Option

WithLogger sets the logger to use inside the HTTP client

func WithTLSConfig

func WithTLSConfig(cfg *tls.Config) Option

WithTLSConfig overrides the default TLS configuration for the HTTP transport.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL