db_holder

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DBConnRetryThreshold = 8
View Source
const MOLoggerUser = "mo_logger"
View Source
const MaxConnectionNumber = 1
View Source
const MaxInsertLen = 200
View Source
const MiddleInsertLen = 10

Variables

View Source
var (
	DBConnErrCount atomic.Uint32
)

sqlWriterDBUser holds the db user for logger

Functions

func GetSQLWriterDBAddressFunc

func GetSQLWriterDBAddressFunc() func(context.Context, bool) (string, error)

func InitOrRefreshDBConn

func InitOrRefreshDBConn(forceNewConn bool, randomCN bool) (*sql.DB, error)

func SetDBConn

func SetDBConn(conn *sql.DB)

func SetSQLWriterDBAddressFunc

func SetSQLWriterDBAddressFunc(f func(context.Context, bool) (string, error))

func SetSQLWriterDBUser

func SetSQLWriterDBUser(userName string, password string)

func WriteRowRecords

func WriteRowRecords(records [][]string, tbl *table.Table, timeout time.Duration) (int, error)

Types

type DBUser

type DBUser struct {
	UserName string
	Password string
}

func GetSQLWriterDBUser

func GetSQLWriterDBUser() (*DBUser, error)

Jump to

Keyboard shortcuts

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