database

package
v0.0.0-...-77b0776 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabasePool

func NewDatabasePool(configuration *Configuration) (pool *sqlx.DB, err error)

NewDatabasePool is a factory function for creating a database connection pool with sqlx from a given DatabaseConfiguration instance.

Types

type Configuration

type Configuration struct {
	Address  string
	Name     string
	Password string
	Port     int
	Username string
}

Configuration provide information relative to MySQL database connection.

func NewConfiguration

func NewConfiguration(v *viper.Viper) (configuration *Configuration, err error)

NewConfiguration is a factory function for creating a DatabaseConfiguration instance using a viper sub tree.

func (*Configuration) URI

func (configuration *Configuration) URI() string

URI is a factory method for generating a database URI.

Jump to

Keyboard shortcuts

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