Documentation
¶
Index ¶
- type Options
- type TCPOptions
- type Transport
- func (trans *Transport) DidReceivePing(version uint8, data []byte, from id.Signatory) (wire.Message, error)
- func (trans *Transport) DidReceivePingAck(version uint8, data []byte, from id.Signatory) error
- func (trans *Transport) DidReceivePull(version uint8, data []byte, from id.Signatory) (wire.Message, error)
- func (trans *Transport) DidReceivePullAck(version uint8, data []byte, from id.Signatory) error
- func (trans *Transport) DidReceivePush(version uint8, data []byte, from id.Signatory) (wire.Message, error)
- func (trans *Transport) DidReceivePushAck(version uint8, data []byte, from id.Signatory) error
- func (trans *Transport) Run(ctx context.Context)
- func (trans *Transport) Send(ctx context.Context, addr wire.Address, msg wire.Message) error
- func (trans *Transport) SetPingListener(listener wire.PingListener)
- func (trans *Transport) SetPullListener(listener wire.PullListener)
- func (trans *Transport) SetPushListener(listener wire.PushListener)
- type WSOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { Logger logrus.FieldLogger TCPClientOpts tcp.ClientOptions TCPServerOpts tcp.ServerOptions }
func DefaultOptions ¶
func DefaultOptions() Options
func (Options) WithLogger ¶
func (opts Options) WithLogger(logger logrus.FieldLogger) Options
func (Options) WithTCPClientOptions ¶
func (opts Options) WithTCPClientOptions(clientOpts tcp.ClientOptions) Options
func (Options) WithTCPServerOptions ¶
func (opts Options) WithTCPServerOptions(serverOpts tcp.ServerOptions) Options
type TCPOptions ¶
type TCPOptions struct { }
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) DidReceivePing ¶
func (*Transport) DidReceivePingAck ¶
func (*Transport) DidReceivePull ¶
func (*Transport) DidReceivePullAck ¶
func (*Transport) DidReceivePush ¶
func (*Transport) DidReceivePushAck ¶
func (*Transport) Run ¶
Run the Transport until the context is done. This method must only be called after the SetPingListener, SetPushListener, and SetPullListener methods have been called (if necessary). Otherwise, this method will panic.
func (*Transport) Send ¶
Send a message to an address. The Transport will select the appropriate client implementation based on the protocol in the target address. If the protocol is not supported, an error is returned. Otherwise, any error from the selected client is returned.
func (*Transport) SetPingListener ¶
func (trans *Transport) SetPingListener(listener wire.PingListener)
SetPingListener must be called before calling the Run method. Otherwise, this method will panic.
func (*Transport) SetPullListener ¶
func (trans *Transport) SetPullListener(listener wire.PullListener)
SetPullListener must be called before calling the Run method. Otherwise, this method will panic.
func (*Transport) SetPushListener ¶
func (trans *Transport) SetPushListener(listener wire.PushListener)
SetPushListener must be called before calling the Run method. Otherwise, this method will panic.
type WSOptions ¶
type WSOptions struct { tcp.ClientOptions tcp.ServerOptions }