mysql

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TMysqlMessage = reflect.TypeOf(&mysqlMessage{})
	TMessage      = reflect.TypeOf(&types.Message{})
)
View Source
var (
	TSharedParams      = reflect.TypeOf(&types.SharedSpec{})
	TMysqlSharedParams = reflect.TypeOf(&mysqlSharedParams{})
)
View Source
var (
	TAddress      = reflect.TypeOf(&types.Address{})
	TMysqlAddress = reflect.TypeOf(&mysqlAddress{})
)
View Source
var (
	TNode      = reflect.TypeOf(&types.Node{})
	TMysqlNode = reflect.TypeOf(&mysqlNode{})
)

Functions

func OpenMysql

func OpenMysql(cfg *config.MySqlConfig) (repo.Repo, error)

Types

type FeeSpec

type FeeSpec struct {
	GasOverEstimation float64    `gorm:"column:gas_over_estimation;type:decimal(10,2);NOT NULL"`
	MaxFee            mtypes.Int `gorm:"column:max_fee;type:varchar(256);default:0"`
	GasFeeCap         mtypes.Int `gorm:"column:gas_fee_cap;type:varchar(256);default:0"`
	GasOverPremium    float64    `gorm:"column:gas_over_premium;type:decimal(10,2);NOT NULL"`
	BaseFee           mtypes.Int `gorm:"column:base_fee;type:varchar(256);default:0"`
}

FeeSpec just use in this package, do not use in others

type Repo

type Repo struct {
	*gorm.DB
}

func (Repo) ActorCfgRepo

func (d Repo) ActorCfgRepo() repo.ActorCfgRepo

func (Repo) AddressRepo

func (d Repo) AddressRepo() repo.AddressRepo

func (Repo) AutoMigrate

func (d Repo) AutoMigrate() error

func (Repo) DbClose

func (d Repo) DbClose() error

func (Repo) GetDb

func (d Repo) GetDb() *gorm.DB

func (Repo) MessageRepo

func (d Repo) MessageRepo() repo.MessageRepo

func (Repo) NodeRepo

func (d Repo) NodeRepo() repo.NodeRepo

func (Repo) SharedParamsRepo

func (d Repo) SharedParamsRepo() repo.SharedParamsRepo

func (Repo) Transaction

func (d Repo) Transaction(cb func(txRepo repo.TxRepo) error) error

type TxMysqlRepo

type TxMysqlRepo struct {
	*gorm.DB
}

func (*TxMysqlRepo) ActorCfgRepo

func (t *TxMysqlRepo) ActorCfgRepo() repo.ActorCfgRepo

func (*TxMysqlRepo) AddressRepo

func (t *TxMysqlRepo) AddressRepo() repo.AddressRepo

func (*TxMysqlRepo) MessageRepo

func (t *TxMysqlRepo) MessageRepo() repo.MessageRepo

func (*TxMysqlRepo) NodeRepo

func (t *TxMysqlRepo) NodeRepo() repo.NodeRepo

func (*TxMysqlRepo) SharedParamsRepo

func (t *TxMysqlRepo) SharedParamsRepo() repo.SharedParamsRepo

Jump to

Keyboard shortcuts

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