Documentation ¶
Index ¶
- type Request
- func (r *Request) GetResponse(ctx context.Context, ioTimeout time.Duration) (bool, []byte, error)
- func (r *Request) Receive(ctx context.Context, ioTimeout time.Duration) ([]byte, error)
- func (r *Request) Respond(ctx context.Context, opTimeout time.Duration, ioTimeout time.Duration, ...) error
- func (r *Request) Send(ctx context.Context, opTimeout time.Duration, ioTimeout time.Duration, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { // Request fields CurrencyID byte FromAddr string ToAddr string // contains filtered or unexported fields }
Request represents a standard request in the payment network.
func NewRequestIn ¶
func NewRequestIn(ctx context.Context, opTimeout time.Duration, ioTimeout time.Duration, conn network.Stream, signer crypto.Signer) (Request, error)
NewRequestIn creates a request for receiving.
@input - context, operation timeout, io timeout, network stream, signer.
@output - request.
func NewRequestOut ¶
func NewRequestOut(ctx context.Context, opTimeout time.Duration, ioTimeout time.Duration, conn network.Stream, signer crypto.Signer, currencyID byte, toAddr string) (Request, error)
NewRequestOut creates a request for sending out.
@input - context, operation timeout, io timeout, network stream, signer, currency id, recipient address, data.
@output - request, error.
func (*Request) GetResponse ¶
GetResponse gets a response from a request.
@input - context, io timeout.
@output - response status, response data, error.
func (*Request) Receive ¶
Receive receives a request in.
@input - context, io timeout.
@output - data, error.
Click to show internal directories.
Click to hide internal directories.