request

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRequestManager

func InitRequestManager() error

InitRequestManager 初始化请求

@return error

func InitRequestManagerMock

func InitRequestManagerMock() error

InitRequestManagerMock mock request

@return error

Types

type Request

type Request interface {
	CrossChainTry(
		txRequest *cross_chain.CrossChainTryRequest,
		timeout int64,
		destGatewayInfo *common.GatewayInfo) (*cross_chain.CrossChainTryResponse, error)
	CrossChainConfirm(
		txRequest *cross_chain.CrossChainConfirmRequest,
		timeout int64,
		destGatewayInfo *common.GatewayInfo) (*cross_chain.CrossChainConfirmResponse, error)
	CrossChainCancel(
		txRequest *cross_chain.CrossChainCancelRequest,
		timeout int64,
		destGatewayInfo *common.GatewayInfo) (*cross_chain.CrossChainCancelResponse, error)
	IsCrossChainSuccess(
		txRequest *cross_chain.IsCrossChainSuccessRequest,
		timeout int64,
		destGatewayInfo *common.GatewayInfo) (*cross_chain.IsCrossChainSuccessResponse, error)
	PingPong(timeout int64, destGatewayInfo *common.GatewayInfo) (*cross_chain.PingPongResponse, error)
	VerifyTx(txVerifyInterface *common.TxVerifyInterface, txProve string) ([]byte, error)
}

Request 请求接口

func NewRequest

func NewRequest(log *zap.SugaredLogger) Request

NewRequest mock request

@param log
@return Request

type RequestManager

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

RequestManager 请求结构体

var RequestV1 *RequestManager

RequestV1 请求全局变量

func (*RequestManager) CrossChainCancel

func (r *RequestManager) CrossChainCancel(
	txRequest *cross_chain.CrossChainCancelRequest,
	timeout int64,
	destGatewayInfo *common.GatewayInfo) (*cross_chain.CrossChainCancelResponse, error)

CrossChainCancel 跨链回滚

@receiver r
@param txRequest
@param timeout
@param destGatewayInfo
@return *cross_chain.CrossChainCancelResponse
@return error

func (*RequestManager) CrossChainConfirm

func (r *RequestManager) CrossChainConfirm(
	txRequest *cross_chain.CrossChainConfirmRequest,
	timeout int64,
	destGatewayInfo *common.GatewayInfo) (*cross_chain.CrossChainConfirmResponse, error)

CrossChainConfirm 跨链提交

@receiver r
@param txRequest
@param timeout
@param destGatewayInfo
@return *cross_chain.CrossChainConfirmResponse
@return error

func (*RequestManager) CrossChainTry

func (r *RequestManager) CrossChainTry(
	txRequest *cross_chain.CrossChainTryRequest,
	timeout int64,
	destGatewayInfo *common.GatewayInfo) (*cross_chain.CrossChainTryResponse, error)

CrossChainTry 跨链执行

@receiver r
@param txRequest
@param timeout
@param destGatewayInfo
@return *cross_chain.CrossChainTryResponse
@return error

func (*RequestManager) IsCrossChainSuccess

func (r *RequestManager) IsCrossChainSuccess(
	txRequest *cross_chain.IsCrossChainSuccessRequest,
	timeout int64,
	destGatewayInfo *common.GatewayInfo) (*cross_chain.IsCrossChainSuccessResponse, error)

IsCrossChainSuccess 询问跨链是否成功

@receiver r
@param txRequest
@param timeout
@param destGatewayInfo
@return *cross_chain.IsCrossChainSuccessResponse
@return error

func (*RequestManager) PingPong

func (r *RequestManager) PingPong(timeout int64,
	destGatewayInfo *common.GatewayInfo) (*cross_chain.PingPongResponse, error)

PingPong 心跳

@receiver r
@param timeout
@param destGatewayInfo
@return *cross_chain.PingPongResponse
@return error

func (*RequestManager) VerifyTx

func (r *RequestManager) VerifyTx(txVerifyInterface *common.TxVerifyInterface, txProve string) ([]byte, error)

VerifyTx 交易验证

@receiver r
@param txVerifyInterface
@param txProve
@return []byte
@return error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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