Documentation
¶
Index ¶
- Constants
- type Handler
- func (h *Handler) GetNoticeChan() <-chan *Notice
- func (h *Handler) GetReceivedTransferChan() <-chan *models.ReceivedTransfer
- func (h *Handler) Notify(level Level, info *InfoStruct)
- func (h *Handler) NotifyChannelCallIDError(callID string, err error)
- func (h *Handler) NotifyChannelCallIDSuccess(callID string, channel *channeltype.ChannelDataDetail)
- func (h *Handler) NotifyChannelStatus(ch *channeltype.ChannelDataDetail)
- func (h *Handler) NotifyContractCallTXInfo(txInfo *models.TXInfo)
- func (h *Handler) NotifyReceiveMediatedTransfer(msg *encoding.MediatedTransfer, tokenAddress common.Address)
- func (h *Handler) NotifyReceiveTransfer(rt *models.ReceivedTransfer)
- func (h *Handler) NotifySentTransferDetail(sentTransferDetail *models.SentTransferDetail)
- func (h *Handler) NotifyString(level Level, info string)
- func (h *Handler) Stop()
- type InfoStruct
- type Level
- type Notice
Constants ¶
View Source
const ( // LevelInfo : LevelInfo = iota // LevelWarn : LevelWarn // LevelError : LevelError )
View Source
const ( //InfoTypeString 0 简单的string通知 InfoTypeString = iota //InfoTypeSentTransferDetail 1 发起的交易状态发生了变化, Message类型微models.SentTransferDetail InfoTypeSentTransferDetail //InfoTypeChannelCallID 2 关于通道的操作,有了结果 InfoTypeChannelCallID //InfoTypeChannelStatus 3 通道状态发生了变化,包括但不限于 //balance //patner_balance //locked_amount //partner_locked_amount //state InfoTypeChannelStatus // InfoTypeContractCallTXInfo 4 自己发起的tx执行完成,通知执行结果,Message类型为models.TXInfo InfoTypeContractCallTXInfo )
View Source
const ( //CallStatusFinishedSuccess 调用成功 CallStatusFinishedSuccess = iota + 1 //CallStatusError 失败 CallStatusError )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler : deal notice info for upper app
func (*Handler) GetNoticeChan ¶
GetNoticeChan : return read-only, keep chan private
func (*Handler) GetReceivedTransferChan ¶
func (h *Handler) GetReceivedTransferChan() <-chan *models.ReceivedTransfer
GetReceivedTransferChan : keep chan private
func (*Handler) Notify ¶
func (h *Handler) Notify(level Level, info *InfoStruct)
Notify : 通知上层,不让阻塞,以免影响正常业务
func (*Handler) NotifyChannelCallIDError ¶
NotifyChannelCallIDError 通知channel callid结果出错
func (*Handler) NotifyChannelCallIDSuccess ¶
func (h *Handler) NotifyChannelCallIDSuccess(callID string, channel *channeltype.ChannelDataDetail)
NotifyChannelCallIDSuccess 通知channel callid成功
func (*Handler) NotifyChannelStatus ¶
func (h *Handler) NotifyChannelStatus(ch *channeltype.ChannelDataDetail)
NotifyChannelStatus 通知channel发生了变化,包括balance,locked_amount,state等等
func (*Handler) NotifyContractCallTXInfo ¶
NotifyContractCallTXInfo 当自己发起的合约调用tx被成功打包时,通知上层
func (*Handler) NotifyReceiveMediatedTransfer ¶
func (h *Handler) NotifyReceiveMediatedTransfer(msg *encoding.MediatedTransfer, tokenAddress common.Address)
NotifyReceiveMediatedTransfer :通知收到了MediatedTransfer
func (*Handler) NotifyReceiveTransfer ¶
func (h *Handler) NotifyReceiveTransfer(rt *models.ReceivedTransfer)
NotifyReceiveTransfer : 通知成功收到一笔token
func (*Handler) NotifySentTransferDetail ¶
func (h *Handler) NotifySentTransferDetail(sentTransferDetail *models.SentTransferDetail)
NotifySentTransferDetail : 通知上层,不让阻塞,以免影响正常业务
func (*Handler) NotifyString ¶
NotifyString : 通知上层,不让阻塞,以免影响正常业务
type InfoStruct ¶
type InfoStruct struct { Type int `json:"type"` //InfoTypeString 表示Message是一个string,InfoTypeTransferStatus表示Message是TransferStatus Message interface{} `json:"message"` }
InfoStruct for notify to mobile
Click to show internal directories.
Click to hide internal directories.