INNER CODE UNIT · Go

main

qpoint-io/qtap · apps/mysql/go/main.go:15

func main() {
	host := getEnv("MYSQL_HOST", "localhost")
	port := getEnv("MYSQL_PORT", "3306")
	user := getEnv("MYSQL_USER", "root")
	password := getEnv("MYSQL_PASSWORD", "")
	database := getEnv("MYSQL_DATABASE", "testdb")
	tlsEnabled := getEnv("MYSQL_TLS_ENABLED", "false") == "true"
	caCertPath := getEnv("MYSQL_CA_CERT", "")
	maxIterations := getEnvInt("MAX_ITERATIONS", 0)
	sleepDuration := getEnvFloat("SLEEP_DURATION", 1.0)

	// Build DSN
	dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?parseTime=true", user, password, host, port, database)

	if tlsEnabled {
		fmt.Println("[Go] TLS enabled")
		if err := registerTLSConfig(caCertPath); err != nil {
			fmt.Printf("[Go] Failed to configure TLS: %v\n", err)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…