cli

package
v0.0.0-...-9750751 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnect         = &Error{"connection error"}
	ErrResponseTimeout = &Error{"response timeout"}
)

Functions

func Dial

func Dial(addr string, timeout time.Duration, getTLSConfig func() *tls.Config) (conn net.Conn, err error)

func SetConnectRecycleTimeout

func SetConnectRecycleTimeout(recycleTimeout time.Duration)

func SetDefaultRecycleTimeout

func SetDefaultRecycleTimeout(defaultTimeout time.Duration)

func ShowProcStats

func ShowProcStats()

func StartRequestProcessor

func StartRequestProcessor(
	server junoio.ServiceEndpoint,
	sourceName string,
	connDone chan<- bool,
	connIndex int,
	connectTimeout time.Duration,
	responseTimeout time.Duration,
	getTLSConfig func() *tls.Config,
	chDone <-chan bool,
	chRequest <-chan *RequestContext) (chProcessorDone <-chan bool)

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 Error

type Error struct {
	What string
}

func NewError

func NewError(err error) *Error

func NewErrorWithString

func NewErrorWithString(err string) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Retryable

func (e *Error) Retryable() bool

func (*Error) SetError

func (e *Error) SetError(v string)

type IOError

type IOError struct {
	Err error
}

func (*IOError) Error

func (e *IOError) Error() string

func (*IOError) Retryable

func (e *IOError) Retryable() bool

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 NewProcessor(
	server io.ServiceEndpoint,
	sourceName string,
	connPoolSize int,
	connectTimeout time.Duration,
	responseTimeout time.Duration,
	getTLSConfig func() *tls.Config) *Processor

func (*Processor) Close

func (c *Processor) Close()

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)

func (*Processor) Start

func (c *Processor) Start()

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL