Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeEvent(event Event) ([]byte, error)
- func ShouldRetry(err error) bool
- type ERC20LogEvent
- type EthBalanceChangeEvent
- type Event
- type Msg
- type Notifier
- func (notifier *Notifier) EventChan() chan<- Event
- func (notifier *Notifier) InstallReceiver(name string, receiver *Receiver)
- func (notifier *Notifier) ListReceivers() map[string]*Receiver
- func (notifier *Notifier) Start(ctx context.Context)
- func (notifier *Notifier) Stop()
- func (notifier *Notifier) UninstallReceiver(name string)
- type Receiver
- type ReceiverConfig
Constants ¶
View Source
const EventBufSize = 2 << 4
event generation buffer
View Source
const (
EventNameERC20 = "erc20_log_event"
)
View Source
const (
EventNameEthBalanceChange = "eth_balance_change_event"
)
View Source
const HTTP_USER_AGENT = "858Chain/Token-Shout-Agent"
Variables ¶
View Source
var ErrShouldRetry = errors.New("should retry")
View Source
var EventTypeRegistry = []string{}
Functions ¶
func EncodeEvent ¶
func ShouldRetry ¶
Types ¶
type ERC20LogEvent ¶
type ERC20LogEvent struct {
// contains filtered or unexported fields
}
func NewERC20LogEvent ¶
func NewERC20LogEvent(meta map[string]interface{}) *ERC20LogEvent
func (*ERC20LogEvent) From ¶
func (ethEvent *ERC20LogEvent) From() string
func (*ERC20LogEvent) GetEvent ¶
func (ethEvent *ERC20LogEvent) GetEvent() map[string]interface{}
func (*ERC20LogEvent) To ¶
func (ethEvent *ERC20LogEvent) To() string
func (*ERC20LogEvent) Type ¶
func (ethEvent *ERC20LogEvent) Type() string
type EthBalanceChangeEvent ¶
type EthBalanceChangeEvent struct {
// contains filtered or unexported fields
}
func NewEthBalanceChangeEvent ¶
func NewEthBalanceChangeEvent(meta map[string]interface{}) *EthBalanceChangeEvent
func (*EthBalanceChangeEvent) From ¶
func (ethEvent *EthBalanceChangeEvent) From() string
func (*EthBalanceChangeEvent) GetEvent ¶
func (ethEvent *EthBalanceChangeEvent) GetEvent() map[string]interface{}
func (*EthBalanceChangeEvent) To ¶
func (ethEvent *EthBalanceChangeEvent) To() string
func (*EthBalanceChangeEvent) Type ¶
func (ethEvent *EthBalanceChangeEvent) Type() string
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Engine of notification
func (*Notifier) InstallReceiver ¶
func (*Notifier) ListReceivers ¶
func (*Notifier) UninstallReceiver ¶
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver receive event notfication
func NewReceiver ¶
func NewReceiver(cfg ReceiverConfig) *Receiver
type ReceiverConfig ¶
type ReceiverConfig struct { RetryCount uint `json:"retrycount"` Endpoint string `json:"endpoint"` NewBalanceRemaining float64 `json:"newBalanceRemaining"` EventTypes []string `json:"eventTypes"` // address support the following format // // * - all valid address // all-in-wallet - all address in local wallet // 0x9d8ec6a2cfe2a6abdf5a6041e752ba851abb4dbb,0x9d8ec6a2cfe2a6abdf5a6041e752ba851abb4dbb FromAddresses []string `json:"from"` ToAddresses []string `json:"to"` }
Config of receivers
func (ReceiverConfig) ValidCheck ¶
func (rc ReceiverConfig) ValidCheck() error
Click to show internal directories.
Click to hide internal directories.