Versions in this module Expand all Collapse all v1 v1.0.0 Dec 28, 2024 Changes in this version + func AddPendingResponse(pr *PendingResponse) + func RegistryCodec(protocol string, codecTmp Codec) + func SequenceID() int64 + type AsyncCallbackResponse struct + Cause error + Opts Options + ReadStart time.Time + Reply interface{} + Start time.Time + type Client interface + Close func() + Connect func(url *common.URL) error + IsAvailable func() bool + Request func(request *Request, timeout time.Duration, response *PendingResponse) error + SetExchangeClient func(client *ExchangeClient) + type Codec interface + Decode func(data []byte) (*DecodeResult, int, error) + EncodeRequest func(request *Request) (*bytes.Buffer, error) + EncodeResponse func(response *Response) (*bytes.Buffer, error) + func GetCodec(protocol string) Codec + type DataListener interface + DataChange func(event Event) bool + type DecodeResult struct + IsRequest bool + Result interface{} + type Event struct + Action EventType + Content string + Path string + func (e Event) String() string + type EventType int + const EventTypeAdd + const EventTypeDel + const EventTypeUpdate + func (t EventType) String() string + type ExchangeClient struct + ConnectTimeout time.Duration + func NewExchangeClient(url *common.URL, client Client, connectTimeout time.Duration, lazyInit bool) *ExchangeClient + func (client *ExchangeClient) AsyncRequest(invocation *protocol.Invocation, url *common.URL, timeout time.Duration, ...) error + func (client *ExchangeClient) Close() + func (client *ExchangeClient) DecreaseActiveNumber() uint32 + func (client *ExchangeClient) GetActiveNumber() uint32 + func (client *ExchangeClient) IncreaseActiveNumber() uint32 + func (client *ExchangeClient) IsAvailable() bool + func (client *ExchangeClient) Request(invocation *protocol.Invocation, url *common.URL, timeout time.Duration, ...) error + func (client *ExchangeClient) Send(invocation *protocol.Invocation, url *common.URL, timeout time.Duration) error + type ExchangeServer struct + Server Server + URL *common.URL + func NewExchangeServer(url *common.URL, server Server) *ExchangeServer + func (server *ExchangeServer) Start() + func (server *ExchangeServer) Stop() + type Options struct + ConnectTimeout time.Duration + type PendingResponse struct + Callback common.AsyncCallback + Done chan struct{} + Err error + ReadStart time.Time + Reply interface{} + func GetPendingResponse(seq SequenceType) *PendingResponse + func NewPendingResponse(id int64) *PendingResponse + func (r *PendingResponse) SetResponse(response *Response) + func (r PendingResponse) GetCallResponse() common.CallbackResponse + type Request struct + Data interface{} + Event bool + ID int64 + SerialID byte + TwoWay bool + Version string + func NewRequest(version string) *Request + type Response struct + Error error + Event bool + ID int64 + Result interface{} + SerialID byte + Status uint8 + Version string + func NewResponse(id int64, version string) *Response + func (response *Response) Handle() + func (response *Response) IsHeartbeat() bool + func (response *Response) String() string + type SequenceType int64 + type Server interface + Start func() + Stop func()