ha

module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT

README

ha

Usage

Database

import "github.com/woxingliu/ha/database"
go mod tidy

postgresql

pg, err := database.NewPostgresDB(
	"postgres://postgres:123456@localhost:5432/user?sslmode=disable",
	database.ConnAttempts_Postgres(10),
	database.MaxPoolSize_Postgres(4),
)
if err != nil {
	return err
}
defer pg.Close()

mariadb

mariaDB := database.NewMariaDB(
	"root:root@tcp(localhost:3306)/user?parseTime=True&loc=Local&charset=utf8mb4&collation=utf8mb4_unicode_ci",
	database.MaxIdleConns_MYSQL(4),
	database.MaxOpenConns_MYSQL(4),
)
defer mariaDB.Close()

Directories

Path Synopsis
Package database implements postgres connection.
Package database implements postgres connection.
Package httpserver implements HTTP server.
Package httpserver implements HTTP server.

Jump to

Keyboard shortcuts

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