Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ContextKeyStreamReader is populated in the context by stream reader. ContextKeyStreamReader contextKey = iota + 1 // ContextKeyStreamWriter is populated in the context by stream writer. ContextKeyStreamWriter // ContextKeySessionID is populated in the context by current session id. ContextKeySessionID )
View Source
const ( DefaultReTryCount = 10 DefaultHTTPTimeout = 120 * time.Second )
Variables ¶
View Source
var ( // ErrStreamReaderNotDefined returned when no stream reader is defined in context. ErrStreamReaderNotDefined = errors.New("httptunnel: stream reader not defined") // ErrStreamWriterNotDefined returned when no stream reader is defined in context. ErrStreamWriterNotDefined = errors.New("httptunnel: stream writer not defined") )
Functions ¶
Types ¶
type ClientOption ¶
type ClientOption func(c *Client)
ClientOption sets an optional parameter for client instance.
func SetReadResponse ¶
func SetReadResponse(r ReadResponse) ClientOption
type ErrorHandler ¶
ErrorHandler receives a transport error to be processed for diagnostic purposes. Usually this means logging the error.
type ErrorHandlerFunc ¶
The ErrorHandlerFunc type is an adapter to allow the use of ordinary function as ErrorHandler. If f is a function with the appropriate signature, ErrorHandlerFunc(f) is a ErrorHandler that calls f.
type LogErrorHandler ¶
type LogErrorHandler struct {
// contains filtered or unexported fields
}
func NewLogErrorHandler ¶
func NewLogErrorHandler() *LogErrorHandler
type Tunnel ¶
type Tunnel struct {
// contains filtered or unexported fields
}
func New ¶
func New( options ...TunnelOption, ) *Tunnel
type TunnelOption ¶
type TunnelOption func(tunnel *Tunnel)
TunnelOption sets an optional parameter for tunnel instance.
func SetClient ¶
func SetClient(client httpclient.Client) TunnelOption
func SetReadRequest ¶
func SetReadRequest(r ReadRequest) TunnelOption
func SetTunnelErrorHandler ¶
func SetTunnelErrorHandler(errorHandler ErrorHandler) TunnelOption
SetTunnelErrorHandler is used to handle non-terminal errors. By default, non-terminal errors are ignored. This is intended as a diagnostic measure.
Click to show internal directories.
Click to hide internal directories.