Documentation
¶
Index ¶
- Variables
- func ABIDecodeString(data []byte) (bps []*big.Int, address []string, err error)
- func ChecksumAddress(address string) string
- func ClosePgSqlTxConn(conn *sqlx.DB, tx *sql.Tx, inoutErr *error)
- func CloseSqlTxConn(conn *sqlx.DB, tx *sql.Tx, inoutErr *error)
- func ExpandSqlResult(res sql.Result) (affected uint64, lastid uint64, err error)
- func GetSvrmark(svrname string, serverid ...string) string
- func If(condition bool, trueVal, falseVal interface{}) interface{}
- func InArray(needle interface{}, hystack interface{}) bool
- func InitArweave(key_file string, ar_node string) (*goar.Wallet, error)
- func InitLog(logdir string, svrname string, warnstr string, fn func(s string), ...)
- func IsSqlErr(err error) bool
- func KeepLogFiles(fdir string, pattern string, nfile int)
- func LogBool(cond bool, args ...interface{})
- func LogD(format string, v ...interface{})
- func LogError(err error, args ...interface{})
- func LogPrefixDay(t time.Time) (prefix string, patternstr string)
- func LogPrefixHour(t time.Time) (prefix string, patternstr string)
- func LogUid(uid uint64, format string, v ...interface{})
- func LogW(format string, v ...interface{})
- func LogWrite(w io.Writer, level string, format string, v ...interface{})
- func LowerCaseWithUnderscores(name string) string
- func NewError(format string, v ...interface{}) error
- func NewPgSqlTxConn() (conn *sqlx.DB, tx *sql.Tx, err error)
- func NewSqlTxConn() (conn *sqlx.DB, tx *sql.Tx, err error)
- func PgGet(sqlstr string, dest interface{}) (err error)
- func PgSelect(sqlstr string, dest interface{}) (err error)
- func SqlGet(sqlstr string, dest interface{}) (err error)
- func SqlTxExec(sqltx *sql.Tx, sqlstr string) (err error)
- func SqlTxProc(sqltx *sql.Tx, inoutErr *error)
- func ToSlice(arr interface{}) ([]interface{}, bool)
- func ValidateStruct(val interface{}) (err error)
- type Batch
- type CmdArgs
- type Config
- func (c *Config) Bool(sesskey string, defs ...bool) bool
- func (c *Config) BoolArray(sesskey string, defs ...[]bool) []bool
- func (c *Config) Int64(sesskey string, defs ...int64) int64
- func (c *Config) Int64Array(sesskey string, defs ...[]int64) []int64
- func (c *Config) SaveToml(fname string) error
- func (c *Config) SessDecode(sess string, pdata interface{}) error
- func (c *Config) SessDecodeMap(cfgmap map[string]interface{}) error
- func (c *Config) SetSess(sess string, v interface{})
- func (c *Config) SetValue(sesskey string, v interface{})
- func (c *Config) String(sesskey string, defs ...string) string
- func (c *Config) StringArray(sesskey string, defs ...[]string) []string
- type MysqlCfg
- type MysqlPool
- func (p *MysqlPool) BatchExec(sqls []string) (err error)
- func (p *MysqlPool) BeginTx() (tx *sqlx.Tx, err error)
- func (p *MysqlPool) EndTx(tx *sqlx.Tx, perr *error) error
- func (p *MysqlPool) GetConn() *sqlx.DB
- func (p *MysqlPool) Query(sqlstr string) ([]map[string]sql.RawBytes, error)
- func (p *MysqlPool) SingleExec(sqlstr string) (affected uint64, lastid uint64, err error)
- func (p *MysqlPool) SingleGetInt64(sqlstr string) (v int64, err error)
- func (p *MysqlPool) SingleGetRow(p_struct_row interface{}, sqlstr string) error
- func (p *MysqlPool) SingleGetVal(p_val interface{}, sqlstr string) error
- func (p *MysqlPool) SingleSelect(p_struct_rows interface{}, sqlstr string) error
- func (p *MysqlPool) TxExec(tx *sqlx.Tx, sqlstr string, perr *error) (affected uint64, lastid uint64, err error)
- func (p *MysqlPool) UnGetConn(db interface{})
- type PostgresCfg
- type PostgresConnConfig
- type PostgresPool
- type SignalHandler
- type Sqler
- func (dba *Sqler) Avg(avg string) string
- func (dba *Sqler) BuildExecut() (string, error)
- func (dba *Sqler) BuildQuery() (string, error)
- func (dba *Sqler) Count(args ...interface{}) string
- func (dba *Sqler) Delete() string
- func (dba *Sqler) Distinct() *Sqler
- func (dba *Sqler) Group(group string) *Sqler
- func (dba *Sqler) Having(having string) *Sqler
- func (dba *Sqler) Ignore() *Sqler
- func (dba *Sqler) Insert(data interface{}) string
- func (dba *Sqler) InsertBatch(data interface{}) string
- func (dba *Sqler) InsertDuplicate(data interface{}, key_fields []string, args ...interface{}) string
- func (dba *Sqler) Join(args ...interface{}) *Sqler
- func (dba *Sqler) LeftJoin(args ...interface{}) *Sqler
- func (dba *Sqler) Limit(limit int) *Sqler
- func (dba *Sqler) Max(max string) string
- func (dba *Sqler) Min(min string) string
- func (dba *Sqler) Offset(offset int) *Sqler
- func (dba *Sqler) OrWhere(args ...interface{}) *Sqler
- func (dba *Sqler) Order(order string) *Sqler
- func (dba *Sqler) Page(page int) *Sqler
- func (dba *Sqler) PgBuildQuery() (string, error)
- func (dba *Sqler) PgSelect(args ...interface{}) string
- func (dba *Sqler) PgTable(table string) *Sqler
- func (dba *Sqler) Reset()
- func (dba *Sqler) RightJoin(args ...interface{}) *Sqler
- func (dba *Sqler) Select(args ...interface{}) string
- func (dba *Sqler) Sum(sum string) string
- func (dba *Sqler) Table(table string) *Sqler
- func (dba *Sqler) Update(data interface{}, args ...interface{}) string
- func (dba *Sqler) UpdateBatch(data []map[string]interface{}, keyarr interface{}, args ...interface{}) string
- func (dba *Sqler) Where(args ...interface{}) *Sqler
- type SysConfig
- func (sc *SysConfig) Bool(sesskey string, defs ...bool) (defval bool)
- func (sc *SysConfig) BoolArray(sesskey string, defs ...[]bool) (defval []bool)
- func (sc *SysConfig) Int64(sesskey string, defs ...int64) (defval int64)
- func (sc *SysConfig) Int64Array(sesskey string, defs ...[]int64) (defval []int64)
- func (sc *SysConfig) Read(key string, pval interface{}) (err error)
- func (sc *SysConfig) Store(key string, val interface{}) (err error)
- func (sc *SysConfig) String(sesskey string, defs ...string) (defval string)
- func (sc *SysConfig) StringArray(sesskey string, defs ...[]string) (defval []string)
- type TagOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Topic_ERC20Created = crypto.Keccak256Hash([]byte("ERC20Created(address,address)")) Topic_ERC721Created = crypto.Keccak256Hash([]byte("ERC721Created(address,address)")) Topic_ERC1155Created = crypto.Keccak256Hash([]byte("ERC1155Created(address,address)")) Topic_LogDeploy = crypto.Keccak256Hash([]byte("LogDeploy(address,bytes,address)")) )
View Source
var ( LogPrefixFn = LogPrefixDay LogKeepFiles = 3 )
View Source
var ErrNoRows error = sql.ErrNoRows
View Source
var ErrPtrNil = errors.New("nil pointer passed to StructScan destination")
View Source
var (
SigHup = syscall.SIGHUP
)
Functions ¶
func ABIDecodeString ¶
func ChecksumAddress ¶
func ExpandSqlResult ¶
func GetSvrmark ¶
func KeepLogFiles ¶
func ValidateStruct ¶
func ValidateStruct(val interface{}) (err error)
Types ¶
type CmdArgs ¶
type CmdArgs = struct { CfgFiles []string LogPath string Name string Debug int64 Daemon bool Version bool Help bool Parsed bool }
var GCmdArgs CmdArgs
func ParseCmdArgs ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
var GConfig *Config
func InitConfig ¶
func (*Config) SessDecode ¶
func (*Config) SessDecodeMap ¶
type MysqlPool ¶
type MysqlPool struct {
// contains filtered or unexported fields
}
var GMysqlPool *MysqlPool
func InitMysqlPool ¶
func (*MysqlPool) SingleExec ¶
func (*MysqlPool) SingleGetInt64 ¶
func (*MysqlPool) SingleGetRow ¶
func (*MysqlPool) SingleGetVal ¶
func (*MysqlPool) SingleSelect ¶
type PostgresCfg ¶
type PostgresConnConfig ¶
type PostgresConnConfig struct { DBName string `json:"dbname"` User string `json:"user"` Password string `json:"password"` Host string `json:"host"` Port int64 `json:"port"` ConnectTimeout int64 `json:"connect_timeout"` EnableSsl bool `json:"ssl"` }
func (*PostgresConnConfig) FormatDSN ¶
func (c *PostgresConnConfig) FormatDSN() string
type PostgresPool ¶
type PostgresPool struct {
// contains filtered or unexported fields
}
var (
GPostgresPool *PostgresPool
)
func InitPostgresPool ¶
func InitPostgresPoolViaUrl ¶
func InitPostgresPoolViaUrl(url string) (pool *PostgresPool, err error)
func (*PostgresPool) GetConn ¶
func (p *PostgresPool) GetConn() *sqlx.DB
func (*PostgresPool) UnGetConn ¶
func (p *PostgresPool) UnGetConn(db interface{})
type SignalHandler ¶
type SignalHandler struct {
// contains filtered or unexported fields
}
func NewSignalHandler ¶
func NewSignalHandler(sig syscall.Signal) *SignalHandler
func (*SignalHandler) GetChan ¶
func (h *SignalHandler) GetChan() <-chan os.Signal
type Sqler ¶
type Sqler struct {
// contains filtered or unexported fields
}
Sqler is data mapper struct
func (*Sqler) BuildExecut ¶
BuildExecut : build execute query string
func (*Sqler) BuildQuery ¶
BuildQuery : build query string
func (*Sqler) InsertBatch ¶
func (*Sqler) InsertDuplicate ¶
func (*Sqler) PgBuildQuery ¶
func (*Sqler) UpdateBatch ¶
type SysConfig ¶
type SysConfig struct {
// contains filtered or unexported fields
}
var GSysConfig *SysConfig
func InitSysConfig ¶
func (*SysConfig) Int64Array ¶
type TagOptions ¶
func GetTagOptions ¶
func GetTagOptions(tag reflect.StructTag, tagname string) TagOptions
Click to show internal directories.
Click to hide internal directories.