database

package
v0.0.0-...-ee0a0c7 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBConnection

func NewDBConnection(ctx context.Context, cfg *DatabaseConfig) (*pgxpool.Pool, error)

NewDBConnection creates new connection to database

Types

type DatabaseConfig

type DatabaseConfig struct {
	Host            string `mapstructure:"DB_HOST"`
	Port            string `mapstructure:"DB_PORT"`
	UserName        string `mapstructure:"DB_USERNAME"`
	Password        string `mapstructure:"DB_PASSWORD"`
	Name            string `mapstructure:"DB_NAME"`
	ConnectAttempts int    `mapstructure:"DB_CONNECT_ATTEMPS"`
}

DatabaseConfig configurations of database connection

func (DatabaseConfig) ToConnectionURL

func (config DatabaseConfig) ToConnectionURL() string

Jump to

Keyboard shortcuts

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