Versions in this module Expand all Collapse all v1 v1.4.1 Feb 27, 2023 Changes in this version + const LinkClosed + const LinkInitialized + const LinkUninitialized + const MaxDataLinkRetrial + const MaxDataLinks + const MinDataLinks + const RetrialBackoffFactor + const WorkerClosed + const WorkerClosing + const WorkerRunning + var DialTimeout = 20 * time.Millisecond + var ErrHeartbeatFailed = errors.New("heartbeat failed") + var ErrInvalidShortcut = errors.New("invalid shortcut connection") + var ErrLinkClosed = errors.New("link closed") + var ErrNoProxySpecified = errors.New("no proxy specified") + var ErrShouldIgnore = errors.New("should ignore") + var ErrWorkerClosed = errors.New("worker closed") + var ResponseTimeout = 100 * time.Millisecond + var RetrialDelayStartFrom = 100 * time.Millisecond + var RetrialMaxDelay = 10 * time.Second + type BadResponse struct + type BaseResponse struct + Attempts int + Body []byte + BodyStream resp.AllReadCloser + Cmd string + func (r *BaseResponse) Command() string + func (r *BaseResponse) Context() context.Context + func (r *BaseResponse) Flush() error + func (r *BaseResponse) Prepare() + func (r *BaseResponse) SetContext(ctx context.Context) + func (r *BaseResponse) Size() int64 + func (r *BaseResponse) String() string + type Client struct + Conn net.Conn + Ctrl bool + Reader resp.ResponseReader + Writer *resp.RequestWriter + func NewClient(cn net.Conn, ctrl bool) *Client + type DefaultHeartbeater struct + func (hb *DefaultHeartbeater) SendToLink(link *Link, flags int64) error + type ErrorResponse struct + Error interface{} + func (e *ErrorResponse) Prepare() + func (e *ErrorResponse) String() string + type HandlerProxy struct + func (h *HandlerProxy) HandlerFunc(w resp.ResponseWriter, c *resp.Command) + func (h *HandlerProxy) StreamHandlerFunc(w resp.ResponseWriter, c *resp.CommandStream) + type HeartbeatError interface + Flags func() int64 + type Heartbeater interface + SendToLink func(*Link, int64) error + type Link struct + func LinkFromClient(client *redeo.Client) *Link + func NewLink(ctrl bool) *Link + func (ln *Link) AddResponses(rsp interface{}) error + func (ln *Link) Close() + func (ln *Link) GrantToken(token *struct{}) + func (ln *Link) ID() int + func (ln *Link) Initialize() bool + func (ln *Link) Invalidate(err error) + func (ln *Link) IsClosed() bool + func (ln *Link) IsControl() bool + func (ln *Link) Reset(conn net.Conn) + func (ln *Link) RevokeToken() *struct{} + func (ln *Link) String() string + type ObjectResponse struct + ChunkId string + Extension time.Duration + PiggyFlags int64 + PiggyPayload []byte + Recovered int64 + ReqId string + Val string + func (r *ObjectResponse) Prepare() + func (r *ObjectResponse) Size() int64 + func (r *ObjectResponse) String() string + type Preparer func(*SimpleResponse, resp.ResponseWriter) error + type Response interface + Command func() string + Flush func() error + Prepare func() + Size func() int64 + type SimpleResponse struct + type TestClient struct + Conn sysnet.Conn + Reader resp.ResponseReader + Writer *resp.RequestWriter + func NewTestClient(cn sysnet.Conn) *TestClient + type Worker struct + func NewWorker(lifeId int64) *Worker + func (wrk *Worker) AddResponses(rsp Response, links ...interface{}) (err error) + func (wrk *Worker) AddResponsesWithPreparer(cmd string, preparer Preparer, links ...interface{}) (Response, error) + func (wrk *Worker) Close() + func (wrk *Worker) CloseWithOptions(opts ...bool) + func (wrk *Worker) GetStats() types.ServerStats + func (wrk *Worker) Handler(fn redeo.HandlerFunc) redeo.HandlerFunc + func (wrk *Worker) Id() int32 + func (wrk *Worker) IsClosed() bool + func (wrk *Worker) Pause() + func (wrk *Worker) RTT() time.Duration + func (wrk *Worker) SetFailure(link interface{}, err error) + func (wrk *Worker) SetHeartbeater(heartbeater Heartbeater) + func (wrk *Worker) SetManualAck(enable bool) + func (wrk *Worker) StartOrResume(proxyAddr sysnet.Addr, args ...*WorkerOptions) (isStart bool, err error) + func (wrk *Worker) StreamHandler(fn redeo.StreamHandlerFunc) redeo.StreamHandlerFunc + func (wrk *Worker) VerifyDataLinks(availableLinks int, reportedAt time.Time) + func (wrk *Worker) WaitAck(cmd string, cb func(), links ...interface{}) + type WorkerOptions struct + DryRun bool + LogLevel int + MinDataLinks int