Documentation
¶
Index ¶
- Variables
- func NewConnectionToContext(ctx context.Context) context.Context
- func NewNilConn() net.Conn
- func NewWrappedListener(l net.Listener) net.Listener
- func SetConnectionToContextConnectionHolder(ctx context.Context, conn net.Conn) bool
- func WrapHTTPTransport(rt http.RoundTripper, dialer ConnectionDialer) http.RoundTripper
- func WrapTLSConfig(config *tls.Config) *tls.Config
- func WrappedConnectionToContext(ctx context.Context, conn net.Conn) context.Context
- type Certificate
- type ConnWithTLSConnectionState
- type Connection
- type ConnectionCloseWrapper
- type ConnectionDialer
- type ConnectionHolder
- type DialWrapper
- type DialerOption
- type Server
- type WrappedConnectionOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilRead = errors.New("cannot read from nilConn") ErrNilWrite = errors.New("cannot write to nilConn") )
View Source
var ConnectionTrackerLogger logr.Logger = logr.Discard()
View Source
var ErrInvalidCertificate = errors.New("invalid tls certificate")
Functions ¶
func NewNilConn ¶
func WrapHTTPTransport ¶
func WrapHTTPTransport(rt http.RoundTripper, dialer ConnectionDialer) http.RoundTripper
Types ¶
type Certificate ¶
type Certificate interface {
GetCertificate() *x509.Certificate
GetSHA256Digest() string
GetSubject() string
GetFirstURI() string
GetFirstDNSName() string
GetFirstIP() string
}
func NewCertificate ¶
func NewCertificate(cert *x509.Certificate) Certificate
func ParseTLSCertificate ¶
func ParseTLSCertificate(cert *tls.Certificate) (Certificate, error)
type ConnWithTLSConnectionState ¶
type ConnWithTLSConnectionState interface {
ConnectionState() tls.ConnectionState
}
type Connection ¶
type Connection interface {
net.Conn
NetConn() net.Conn
SetNetConn(net.Conn)
GetTimeToFirstByte() time.Time
GetLocalCertificate() Certificate
GetPeerCertificate() Certificate
SetLocalCertificate(cert *tls.Certificate)
GetConnectionState() *tls.ConnectionState
SetConnWithTLSConnectionState(ConnWithTLSConnectionState)
SetOptions(opts ...WrappedConnectionOption)
GetOriginalAddress() string
}
func NewWrappedConnection ¶
func NewWrappedConnection(conn net.Conn, opts ...WrappedConnectionOption) Connection
func WrappedConnectionFromContext ¶
func WrappedConnectionFromContext(ctx context.Context) (Connection, bool)
func WrappedConnectionFromNetConn ¶
func WrappedConnectionFromNetConn(conn net.Conn) (Connection, bool)
type ConnectionCloseWrapper ¶
type ConnectionDialer ¶
type ConnectionDialer interface {
DialTLSContext(ctx context.Context, network, address string) (net.Conn, error)
// contains filtered or unexported methods
}
func NewDialer ¶
func NewDialer(opts ...DialerOption) ConnectionDialer
func NewDialerWithTLS ¶
func NewDialerWithTLS(certFile, keyFile string, insecure bool, opts ...DialerOption) (ConnectionDialer, error)
func NewDialerWithTLSConfig ¶
func NewDialerWithTLSConfig(config *tls.Config, opts ...DialerOption) ConnectionDialer
type ConnectionHolder ¶
func ConnectionHolderFromContext ¶
func ConnectionHolderFromContext(ctx context.Context) (ConnectionHolder, bool)
type DialWrapper ¶
type DialerOption ¶
type DialerOption func(*dialer)
func DialerWithDialerWrapper ¶
func DialerWithDialerWrapper(w DialWrapper) DialerOption
func DialerWithWrappedConnectionOptions ¶
func DialerWithWrappedConnectionOptions(opts ...WrappedConnectionOption) DialerOption
type Server ¶
type Server interface {
GetUnifiedListener() ltls.UnifiedListener
Serve(l net.Listener) error
ServeTLS(l net.Listener, certFile, keyFile string) error
ServeWithTLSConfig(l net.Listener, config *tls.Config) error
GetHTTPServer() *http.Server
}
func WrapHTTPServer ¶
type WrappedConnectionOption ¶
type WrappedConnectionOption func(*wrappedConn)
func WrappedConnectionWithCloserWrapper ¶
func WrappedConnectionWithCloserWrapper(closeWrapper ConnectionCloseWrapper) WrappedConnectionOption
func WrappedConnectionWithOriginalAddress ¶
func WrappedConnectionWithOriginalAddress(address string) WrappedConnectionOption
Click to show internal directories.
Click to hide internal directories.