Documentation
¶
Index ¶
- func NewDBInstance(dbConf config.DatabaseConfig) (*gorm.DB, error)
- func NewDBInstanceCopy(dbInst *gorm.DB) (*gorm.DB, error)
- func SqlCreateTableEventOrphan(tableName string) string
- func SqlCreateTableRevision(tableName string) string
- func SqlCreateTableSnapshotData(tableName string) string
- func SqlCreateTableSnapshotSync(tableName string) string
- func SqlCreateTableState(tableName string) string
- func SqlInsertOrphanEvent(tableName string, orphanEvent ...TableEventOrphan) string
- func SqlInsertRevision(tableName string, revision ...TableRevision) string
- func SqlInsertSnapshotData(tableName string, snapshotData ...TableSnapshotData) string
- func SqlInsertSnapshotSync(tableName string, snapshotSync ...TableSnapshotSync) string
- func SqlInsertState(tableName string, state ...TableState) string
- func TryExecPipelineSql(dbInst *gorm.DB, sqlList []string, dbConf config.DatabaseConfig) (*gorm.DB, error)
- func TryExecSql(dbInst *gorm.DB, sql string, dbConf config.DatabaseConfig) (*gorm.DB, error)
- type TableEventOrphan
- type TableRevision
- type TableSnapshotData
- type TableSnapshotSync
- type TableState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDBInstance ¶
func NewDBInstance(dbConf config.DatabaseConfig) (*gorm.DB, error)
func SqlCreateTableEventOrphan ¶ added in v0.0.2
func SqlCreateTableRevision ¶
func SqlCreateTableState ¶
func SqlInsertOrphanEvent ¶ added in v0.0.2
func SqlInsertOrphanEvent(tableName string, orphanEvent ...TableEventOrphan) string
func SqlInsertRevision ¶
func SqlInsertRevision(tableName string, revision ...TableRevision) string
func SqlInsertSnapshotData ¶
func SqlInsertSnapshotData(tableName string, snapshotData ...TableSnapshotData) string
func SqlInsertSnapshotSync ¶
func SqlInsertSnapshotSync(tableName string, snapshotSync ...TableSnapshotSync) string
func SqlInsertState ¶
func SqlInsertState(tableName string, state ...TableState) string
func TryExecPipelineSql ¶
func TryExecSql ¶
Types ¶
type TableEventOrphan ¶ added in v0.0.2
type TableEventOrphan struct {
SnapshotID string `json:"snapshot_id"`
EventTypeOrphan int `json:"event_type_orphan"`
OrphanParentBlockHash string `json:"orphan_parent_block_hash"`
OrphanBlockHash string `json:"orphan_block_hash"`
ConnectMainChain int `json:"connect_main_chain"`
EventOrphanTimestamp string `json:"event_orphan_timestamp"`
}
type TableRevision ¶
type TableSnapshotData ¶
type TableSnapshotData struct {
SnapshotID string `json:"snapshot_id"`
TargetChainID string `json:"target_chain_id"`
TargetChainHeight int32 `json:"target_chain_height"`
BlockHash string `json:"block_hash"`
IsOrphan int `json:"is_orphan"`
InitTimestamp string `json:"init_timestamp"`
FinalTimestamp string `json:"final_timestamp"`
}
type TableSnapshotSync ¶
type TableState ¶
type TableState struct {
SnapshotID string `json:"snapshot_id"`
SnapshotType int `json:"snapshot_type"`
BestBlockHash string `json:"best_block_hash"`
Height int32 `json:"height"`
Bits uint32 `json:"bits"`
BlockSize uint64 `json:"block_size"`
BlockWeight uint64 `json:"block_weight"`
NumTxns uint64 `json:"num_txns"`
TotalTxns uint64 `json:"total_txns"`
MedianTimestamp string `json:"median_timestamp"`
}
Click to show internal directories.
Click to hide internal directories.