database

package
v0.0.0-...-03cd4a3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Connect() (*sql.DB, error)
}

func NewDatabase

func NewDatabase(cfg *config.Config) Database

func NewMySQL

func NewMySQL(cfg *config.Config) Database

func NewPostgreSQL

func NewPostgreSQL(cfg *config.Config) Database

type MySQL

type MySQL struct {
	*Options
}

type Options

type Options struct {
	Driver           string
	ConnectionString string
	MaxOpen          int
	MaxIdle          int
}

func (*Options) Connect

func (o *Options) Connect() (*sql.DB, error)

type PostgreSQL

type PostgreSQL struct {
	*Options
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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