database

package
v0.0.0-...-b6c9256 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(cfg Config) (*sql.DB, error)

Connect returns a postgres database connection.

Types

type Config

type Config struct {
	DSN                   string        `envconfig:"DSN" required:"true"`
	MaxOpenConnections    int           `envconfig:"MAX_OPEN_CONNECTIONS" default:"10"`
	MaxIdleConnections    int           `envconfig:"MAX_IDLE_CONNECTIONS" default:"10"`
	ConnectionMaxLifetime time.Duration `envconfig:"CONNECTION_MAX_LIFETIME" default:"10m"`
}

Config holds the configuration settings for the database.

Jump to

Keyboard shortcuts

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