Documentation
¶
Index ¶
- Constants
- func NewTCPListener(ctx context.Context, config ProxyClientConfig) (net.Listener, error)
- type ClientHandler
- type ConnKeepalive
- type ConnTimeout
- type DialTimeout
- type ListenerHandler
- type PKCS11TokenHandler
- type PKCS11TokenMaxRetries
- type PKCS11TokenPollInterval
- type PKCS11TokenRetryInterval
- type ProxyClientConfig
- type ProxyHandler
- type ProxyServerConfig
Constants ¶
View Source
const ( DefaultConnKeepalive = 15 * time.Second MinConnKeepalive = 15 * time.Second MaxConnKeepalive = 2 * time.Hour )
View Source
const ( DefaultDialTimeout = 3 * time.Minute MinDialTimeout = 10 * time.Millisecond MaxDialTimeout = 5 * time.Minute )
View Source
const ( DefaultConnTimeout = 30 * time.Second MinConnTimeout = 0 * time.Second MaxConnTimeout = 2 * time.Hour )
View Source
const ( DefaultPKCS11TokenMaxRetries int = 3 MinPKCS11TokenMaxRetries int = 1 MaxPKCS11TokenMaxRetries int = 50 )
Variables ¶
This section is empty.
Functions ¶
func NewTCPListener ¶
Types ¶
type ClientHandler ¶
type ClientHandler struct {
// contains filtered or unexported fields
}
func NewClientHandler ¶
func NewClientHandler( clientConfig ProxyClientConfig, serverConfig ProxyServerConfig, clientConnCh <-chan net.Conn, tlsConfigCh <-chan *tls.Config, errCh chan<- error, ) *ClientHandler
func (*ClientHandler) Handle ¶
func (h *ClientHandler) Handle(ctx context.Context)
Handle handles the client side of the proxy.
type ConnKeepalive ¶
func (ConnKeepalive) Validate ¶
func (ka ConnKeepalive) Validate() error
type ConnTimeout ¶
func (ConnTimeout) Validate ¶
func (t ConnTimeout) Validate() error
type DialTimeout ¶
func (DialTimeout) Validate ¶
func (t DialTimeout) Validate() error
type ListenerHandler ¶
type ListenerHandler struct {
// contains filtered or unexported fields
}
func NewListenerHandler ¶
func (*ListenerHandler) Close ¶
func (h *ListenerHandler) Close()
func (*ListenerHandler) Handle ¶
func (h *ListenerHandler) Handle( ctx context.Context, )
Handle handles the client side listener of the proxy for accepting new connections.
func (*ListenerHandler) WatchClose ¶
func (h *ListenerHandler) WatchClose(ctx context.Context)
type PKCS11TokenHandler ¶
type PKCS11TokenHandler struct {
// contains filtered or unexported fields
}
func NewPKCS11TokenHandler ¶
func NewPKCS11TokenHandler( ctxLoader pkcs11.PKCS11CtxLoader, certId []byte, tlsConfigCh chan<- *tls.Config, maxRetries PKCS11TokenMaxRetries, retryInterval PKCS11TokenRetryInterval, pollInterval PKCS11TokenPollInterval, errCh chan<- error, ) *PKCS11TokenHandler
func (*PKCS11TokenHandler) Handle ¶
func (h *PKCS11TokenHandler) Handle( ctx context.Context, )
Handle interfaces with the PKCS#11 token to get the TLS certificate used by the proxy.
type PKCS11TokenMaxRetries ¶
type PKCS11TokenMaxRetries int
func (PKCS11TokenMaxRetries) Validate ¶
func (r PKCS11TokenMaxRetries) Validate() error
type PKCS11TokenPollInterval ¶
func (PKCS11TokenPollInterval) Validate ¶
func (i PKCS11TokenPollInterval) Validate() error
type PKCS11TokenRetryInterval ¶
func (PKCS11TokenRetryInterval) Validate ¶
func (i PKCS11TokenRetryInterval) Validate() error
type ProxyClientConfig ¶
type ProxyClientConfig struct {
Host string
Port int
ConnKeepalive ConnKeepalive
ConnTimeout ConnTimeout
}
type ProxyHandler ¶
type ProxyHandler struct {
// contains filtered or unexported fields
}
func NewProxyHandler ¶
func NewProxyHandler( errCh chan<- error, tokenHandler *PKCS11TokenHandler, tokenHandlerErrCh <-chan error, listenerHandler *ListenerHandler, listenerHandlerErrCh <-chan error, clientHandler *ClientHandler, clientHandlerErrCh <-chan error, ) *ProxyHandler
func (*ProxyHandler) Close ¶
func (h *ProxyHandler) Close()
func (*ProxyHandler) Handle ¶
func (h *ProxyHandler) Handle(ctx context.Context)
Handle handles the proxy logic.
type ProxyServerConfig ¶
type ProxyServerConfig struct {
Host string
Port int
DialTimeout DialTimeout
ConnKeepalive ConnKeepalive
ConnTimeout ConnTimeout
}
Click to show internal directories.
Click to hide internal directories.