Documentation ¶
Index ¶
- Constants
- func CreateBlockRecord(db *gorm.DB) error
- func CreateEventTable(db *gorm.DB, alias string) error
- func CreateNotifyRecord(db *gorm.DB) error
- func DeleteItem(db *gorm.DB, alias string, id uint) error
- func GetABIData(name string) []byte
- func GetBlockRecord(db *gorm.DB, alias string) (uint64, error)
- func GetNotifyRecord(db *gorm.DB, alias string) (uint, error)
- func HttpRouter(router *gin.RouterGroup, db *gorm.DB)
- func InsertItem(db *gorm.DB, alias string, item DBItem) (uint, error)
- func ItemsTotal(db *gorm.DB, alias string) (uint, error)
- func NewDB(conf DBConf) (*gorm.DB, error)
- func SetBlockRecord(db *gorm.DB, alias string, blockID uint64) error
- func SetNotifyRecord(db *gorm.DB, alias string, nid uint) error
- type BlockRecord
- type ChainConfig
- type Config
- type DBConf
- type DBItem
- type Event
- type EventCallback
- type Manager
- type NotifyRecord
- type NotifyTask
- type RespItems
- type ServerConfig
- type SubscriptionConf
Constants ¶
View Source
const ( ABIERC20 = "erc20" ABIERC721 = "erc721" ABIERC1155 = "erc1155" )
View Source
const ( KAlias = "alias" KBlock = "block" KBlockNumber = "block_number" KContract = "contract" KTX = "tx" KLogIndex = "log_index" KTopic = "topic" KEventName = "event_name" KRawData = "raw_data" )
Variables ¶
This section is empty.
Functions ¶
func CreateBlockRecord ¶
func CreateNotifyRecord ¶
func GetABIData ¶
func HttpRouter ¶
func HttpRouter(router *gin.RouterGroup, db *gorm.DB)
Types ¶
type BlockRecord ¶
type ChainConfig ¶
type Config ¶
type Config struct { Chain ChainConfig `yaml:"chain,omitempty"` DB DBConf `yaml:"db,omitempty"` Subs []SubscriptionConf `yaml:"subscriptions,omitempty"` Http ServerConfig `yaml:"http,omitempty"` }
type DBItem ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func NewEvent ¶
func NewEvent(conf SubscriptionConf, client *ethclient.Client, cb EventCallback) (*Event, error)
func NewEventWithDB ¶
type EventCallback ¶
type NotifyRecord ¶
type NotifyTask ¶
type NotifyTask struct {
// contains filtered or unexported fields
}
func NewNotifyTask ¶
func NewNotifyTask(db *gorm.DB, alias, webHook string) *NotifyTask
func (*NotifyTask) Run ¶
func (t *NotifyTask) Run(limit uint) error
type ServerConfig ¶
type SubscriptionConf ¶
type SubscriptionConf struct { Alias string `yaml:"alias"` Contract []string `yaml:"contract"` ABIFile string `yaml:"abi_file"` EventName string `yaml:"event_name"` Filter map[string]string `yaml:"filter"` StartBlock uint64 `yaml:"start_block"` BlocksPerReq uint64 `yaml:"blocks_per_req"` WaitPerReq int64 `yaml:"wait_per_req"` WebHook string `yaml:"web_hook"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.