Documentation ¶
Index ¶
- Variables
- func Dial(addr string, timeout time.Duration, getTLSConfig func() *tls.Config) (conn net.Conn, err error)
- func SetConnectRecycleTimeout(recycleTimeout time.Duration)
- func SetDefaultRecycleTimeout(defaultTimeout time.Duration)
- func ShowProcStats()
- func StartRequestProcessor(server junoio.ServiceEndpoint, sourceName string, connDone chan<- bool, ...) (chProcessorDone <-chan bool)
- func TLSInitialized() bool
- type Connection
- type ErrResponseContext
- type Error
- type IOError
- type IResponseContext
- type IRetryable
- type PendingRequest
- type PendingResponseMap
- type PendingTracker
- func (p *PendingTracker) ClearOnError(err error)
- func (p *PendingTracker) GetTimeoutCh() <-chan time.Time
- func (p *PendingTracker) OnRequestSent(reqCtx *RequestContext, sequence uint32)
- func (p *PendingTracker) OnResonseReceived(readerResp *ReaderResponse)
- func (p *PendingTracker) OnResponseReaderClosed()
- func (p *PendingTracker) OnTimeout(now time.Time)
- type Processor
- type ReaderResponse
- type RecordInfo
- func (r *RecordInfo) GetCreationTime() uint32
- func (r *RecordInfo) GetTimeToLive() uint32
- func (r *RecordInfo) GetVersion() uint32
- func (r *RecordInfo) IsSameOriginator(ctx *RecordInfo) bool
- func (r *RecordInfo) PrettyPrint(w io.Writer)
- func (r *RecordInfo) SetFromOpMsg(m *proto.OperationalMessage)
- func (r *RecordInfo) SetRequestWithUpdateCond(request *proto.OperationalMessage)
- func (r *RecordInfo) String() string
- type RequestContext
- type ResponseContext
- type RetryableError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnect = &Error{"connection error"} ErrResponseTimeout = &Error{"response timeout"} )
Functions ¶
func ShowProcStats ¶
func ShowProcStats()
func StartRequestProcessor ¶
func TLSInitialized ¶
func TLSInitialized() bool
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) CloseWrite ¶
func (c *Connection) CloseWrite()
func (*Connection) GetReqTimeoutCh ¶
func (c *Connection) GetReqTimeoutCh() <-chan time.Time
func (*Connection) Shutdown ¶
func (c *Connection) Shutdown()
type ErrResponseContext ¶
type ErrResponseContext struct {
// contains filtered or unexported fields
}
func (*ErrResponseContext) GetError ¶
func (r *ErrResponseContext) GetError() error
func (*ErrResponseContext) GetOpaque ¶
func (r *ErrResponseContext) GetOpaque() uint32
func (*ErrResponseContext) GetResponse ¶
func (r *ErrResponseContext) GetResponse() *proto.OperationalMessage
func (*ErrResponseContext) SetOpaque ¶
func (r *ErrResponseContext) SetOpaque(opaque uint32)
type IResponseContext ¶
type IResponseContext interface { GetResponse() *proto.OperationalMessage GetError() error GetOpaque() uint32 SetOpaque(opaque uint32) }
GetResponse() != nil and GetError() != nil are mutually exclusive
type IRetryable ¶
type IRetryable interface {
Retryable() bool
}
type PendingRequest ¶
type PendingRequest struct {
// contains filtered or unexported fields
}
type PendingResponseMap ¶
type PendingResponseMap map[uint32]*PendingRequest
type PendingTracker ¶
type PendingTracker struct {
// contains filtered or unexported fields
}
func (*PendingTracker) ClearOnError ¶
func (p *PendingTracker) ClearOnError(err error)
func (*PendingTracker) GetTimeoutCh ¶
func (p *PendingTracker) GetTimeoutCh() <-chan time.Time
func (*PendingTracker) OnRequestSent ¶
func (p *PendingTracker) OnRequestSent(reqCtx *RequestContext, sequence uint32)
func (*PendingTracker) OnResonseReceived ¶
func (p *PendingTracker) OnResonseReceived(readerResp *ReaderResponse)
func (*PendingTracker) OnResponseReaderClosed ¶
func (p *PendingTracker) OnResponseReaderClosed()
func (*PendingTracker) OnTimeout ¶
func (p *PendingTracker) OnTimeout(now time.Time)
type Processor ¶
type Processor struct { PoolSize int // contains filtered or unexported fields }
func NewProcessor ¶
func (*Processor) ProcessBatchRequests ¶
func (c *Processor) ProcessBatchRequests(requests []*proto.OperationalMessage) (responses []*proto.OperationalMessage, err error)
func (*Processor) ProcessRequest ¶
func (c *Processor) ProcessRequest(request *proto.OperationalMessage) (resp *proto.OperationalMessage, err error)
type ReaderResponse ¶
type ReaderResponse struct {
// contains filtered or unexported fields
}
func NewErrorReaderResponse ¶
func NewErrorReaderResponse(err error) *ReaderResponse
func NewReaderResponse ¶
func NewReaderResponse(resp *proto.OperationalMessage) *ReaderResponse
type RecordInfo ¶
type RecordInfo struct {
// contains filtered or unexported fields
}
func (*RecordInfo) GetCreationTime ¶
func (r *RecordInfo) GetCreationTime() uint32
func (*RecordInfo) GetTimeToLive ¶
func (r *RecordInfo) GetTimeToLive() uint32
func (*RecordInfo) GetVersion ¶
func (r *RecordInfo) GetVersion() uint32
func (*RecordInfo) IsSameOriginator ¶
func (r *RecordInfo) IsSameOriginator(ctx *RecordInfo) bool
func (*RecordInfo) PrettyPrint ¶
func (r *RecordInfo) PrettyPrint(w io.Writer)
func (*RecordInfo) SetFromOpMsg ¶
func (r *RecordInfo) SetFromOpMsg(m *proto.OperationalMessage)
func (*RecordInfo) SetRequestWithUpdateCond ¶
func (r *RecordInfo) SetRequestWithUpdateCond(request *proto.OperationalMessage)
func (*RecordInfo) String ¶
func (r *RecordInfo) String() string
type RequestContext ¶
type RequestContext struct {
// contains filtered or unexported fields
}
func NewRequestContext ¶
func NewRequestContext(m *proto.OperationalMessage, chResponse chan IResponseContext) *RequestContext
func (*RequestContext) GetRequest ¶
func (r *RequestContext) GetRequest() *proto.OperationalMessage
func (*RequestContext) Reply ¶
func (r *RequestContext) Reply(response *proto.OperationalMessage)
func (*RequestContext) ReplyError ¶
func (r *RequestContext) ReplyError(err error)
type ResponseContext ¶
type ResponseContext struct {
// contains filtered or unexported fields
}
func (*ResponseContext) GetError ¶
func (r *ResponseContext) GetError() error
func (*ResponseContext) GetOpaque ¶
func (r *ResponseContext) GetOpaque() uint32
func (*ResponseContext) GetResponse ¶
func (r *ResponseContext) GetResponse() *proto.OperationalMessage
func (*ResponseContext) SetOpaque ¶
func (r *ResponseContext) SetOpaque(opaque uint32)
type RetryableError ¶
type RetryableError struct {
What string
}
func (*RetryableError) Error ¶
func (e *RetryableError) Error() string
func (*RetryableError) Retryable ¶
func (e *RetryableError) Retryable() bool
Click to show internal directories.
Click to hide internal directories.