Documentation ¶
Index ¶
- Variables
- func CheckPortIsReady(addr string) (bool, error)
- func CollectFieldNames(t reflect.Type, m map[string]struct{}, prefix string)
- func Exec(cmd string) (string, int)
- func GetFilesBySuffix(dir, suffix string) ([]string, error)
- func NewLogger(tag string) *logger
- func ParseWithPattern(pattern, str string) (map[string]string, error)
- func Recover()
- func Render(tpl string, data interface{}) (string, error)
- type DBUtil
- func (u *DBUtil) CamelCaseToUdnderscore(s string) string
- func (u *DBUtil) DoRecordQueryTableIds(db *sql.DB, recorder map[string]mapset.Set, sql string, args []interface{})
- func (u *DBUtil) Dump(db *sql.DB, tables []string, w io.Writer)
- func (u *DBUtil) DumpFromRecordInfo(db *sql.DB, recorder map[string][]string) map[string][]string
- func (u *DBUtil) ExecSQL(db *sql.DB, sqlStr string, args ...interface{}) (sql.Result, error)
- func (u *DBUtil) IntToPr(i int) *int
- func (m *DBUtil) ParseSQLText(sqlText string) []string
- func (u *DBUtil) QueryListBySQL(db *sql.DB, sqlStr string, args ...interface{}) ([]map[string]interface{}, error)
- func (u *DBUtil) QueryObjectBySQL(db *sql.DB, obj interface{}, sqlStr string, args ...interface{}) error
- func (u *DBUtil) QueryOneBySQL(db *sql.DB, sqlStr string, args ...interface{}) (map[string]interface{}, error)
- func (u *DBUtil) ReadFile(filePath string) string
- func (u *DBUtil) RunMySQLServer(dbName string, dbPort int, block bool)
- func (u *DBUtil) SaveRecordToFile(dir string, recorder map[string][]string, overwrite bool)
- func (u *DBUtil) SelectToInsertSQLV1(scope *gorm.Scope) (string, []string)
- func (u *DBUtil) SelectToInsertSQLV2(db *gormv2.DB) (string, []string)
- func (u *DBUtil) StrToPr(s string) *string
- func (u *DBUtil) UderscoreToLowerCamelCase(s string) string
- func (u *DBUtil) UderscoreToUpperCamelCase(s string) string
- type DSN
- func (d *DSN) DSN(withSchema bool) string
- func (d *DSN) DatabaseName() string
- func (d *DSN) Host() string
- func (d *DSN) HostWithPort() string
- func (d *DSN) Password() string
- func (d *DSN) Path() string
- func (d *DSN) Port() string
- func (d *DSN) Scheme() string
- func (d *DSN) SetDatabaseName(dbName string)
- func (d *DSN) User() *url.Userinfo
- func (d *DSN) Username() string
- type DSNValues
- func (d *DSNValues) GetBool(paramName string, defaultValue bool) bool
- func (d *DSNValues) GetInt(paramName string, defaultValue int) int
- func (d *DSNValues) GetSeconds(paramName string, defaultValue time.Duration) time.Duration
- func (d *DSNValues) GetString(paramName string, defaultValue string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger *logger = NewLogger("default")
View Source
var Util *goutil.Common = &goutil.Common{}
Functions ¶
func CheckPortIsReady ¶
func CollectFieldNames ¶ added in v1.2.9
func GetFilesBySuffix ¶ added in v1.3.1
get all files by suffix in a directory
func ParseWithPattern ¶ added in v1.3.1
parse string use regexp pattern with group and return map
Types ¶
type DBUtil ¶
type DBUtil struct { }
func (*DBUtil) CamelCaseToUdnderscore ¶
驼峰单词转下划线单词
func (*DBUtil) DoRecordQueryTableIds ¶
func (*DBUtil) DumpFromRecordInfo ¶
func (*DBUtil) ParseSQLText ¶
func (*DBUtil) QueryListBySQL ¶
func (*DBUtil) QueryObjectBySQL ¶
func (*DBUtil) QueryOneBySQL ¶
func (*DBUtil) RunMySQLServer ¶
func (*DBUtil) SaveRecordToFile ¶
func (*DBUtil) SelectToInsertSQLV1 ¶
func (*DBUtil) SelectToInsertSQLV2 ¶
func (*DBUtil) UderscoreToLowerCamelCase ¶
下划线单词转为小写驼峰单词
func (*DBUtil) UderscoreToUpperCamelCase ¶
下划线单词转为大写驼峰单词
Click to show internal directories.
Click to hide internal directories.