Documentation ¶
Index ¶
- func ExecWithRollback(db *sql.DB, queries []QueryEntry) (res sql.Result, err error)
- func InitLog(file string, level string)
- func MustExec(db *sql.DB, query string, args ...interface{}) sql.Result
- func OpenDB(dsn string, maxIdeleConns int) (*sql.DB, error)
- func PushPrometheus(job, addr string, interval time.Duration)
- func RandString(b []byte, r *rand.Rand)
- func RunWithRetry(ctx context.Context, retryCnt int, interval time.Duration, f func() error) error
- type QueryEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecWithRollback ¶
ExecWithRollback exeutes or rollbak
func PushPrometheus ¶
PushPrometheus pushes metrics to Prometheus Pushgateway.
func RandString ¶
RandString reference: http://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-golang
Types ¶
type QueryEntry ¶
QueryEntry is a query
Click to show internal directories.
Click to hide internal directories.