Documentation
¶
Overview ¶
Package dbrouter provides a middleware for the echo router that uses the hostname from an HTTP request to load the correct database driver for that doamin.
Configuration files can be anything that works with Viper (json is recommended). The configuration file should be a map of key/value pairs. The keys are the individual host names that you want to configure. The values should contain the TYPE of database connection you want to use, along with additional required connection information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(filename string) echo.MiddlewareFunc
New generates an Echo middleware that locates the appropriate datasource to use for the current request.
Types ¶
Click to show internal directories.
Click to hide internal directories.