request

package
v2.15.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientRequest

type ClientRequest struct {
	// contains filtered or unexported fields
}

func NewClientRequest

func NewClientRequest(ctx context.Context, lggr logger.Logger, req commoncap.CapabilityRequest, messageID string,
	remoteCapabilityInfo commoncap.CapabilityInfo, localDonInfo capabilities.DON, dispatcher types.Dispatcher,
	requestTimeout time.Duration) (*ClientRequest, error)

func (*ClientRequest) Cancel

func (c *ClientRequest) Cancel(err error)

func (*ClientRequest) Expired

func (c *ClientRequest) Expired() bool

func (*ClientRequest) OnMessage

func (c *ClientRequest) OnMessage(_ context.Context, msg *types.MessageBody) error

TODO OnMessage assumes that only one response is received from each peer, if streaming responses need to be supported this will need to be updated

func (*ClientRequest) ResponseChan

func (c *ClientRequest) ResponseChan() <-chan commoncap.CapabilityResponse

type ServerRequest

type ServerRequest struct {
	// contains filtered or unexported fields
}

func NewServerRequest

func NewServerRequest(capability capabilities.TargetCapability, capabilityID string, capabilityDonID uint32, capabilityPeerId p2ptypes.PeerID,
	callingDon commoncap.DON, requestMessageID string,
	dispatcher types.Dispatcher, requestTimeout time.Duration, lggr logger.Logger) *ServerRequest

func (*ServerRequest) Cancel

func (e *ServerRequest) Cancel(err types.Error, msg string) error

func (*ServerRequest) Expired

func (e *ServerRequest) Expired() bool

func (*ServerRequest) OnMessage

func (e *ServerRequest) OnMessage(ctx context.Context, msg *types.MessageBody) error

Jump to

Keyboard shortcuts

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