Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `mapstructure:"DB_NAME"` // The name of the database Host string `mapstructure:"DB_HOST"` // The hostname or IP address of the database server Port string `mapstructure:"DB_PORT"` // The port number on which the database server is listening User string `mapstructure:"DB_USER"` // The username for authenticating with the database server Pass string `mapstructure:"DB_PASS"` // The password for authenticating with the database server Args string `mapstructure:"DB_ARGS"` // Additional arguments for the database connection Driver string `mapstructure:"DB_DRIVER"` // The database driver to use: postgres, mysql Migrate string `mapstructure:"DB_MIGRATE"` // The path to the database migration files Url string // The URL for the database connection (derived from other fields) }
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database represents a database connection.
func NewDatabae ¶
NewConnection creates a new database connection based on the provided configuration. It returns a Database instance and any error encountered during the connection process.
Click to show internal directories.
Click to hide internal directories.