Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseDB ¶
func CloseDB()
CloseDB closes the sqlx.DB instance. It is NOT threadsafe and should only be called via defer in main.
func CloseSQLDB ¶
func CloseSQLDB()
CloseSQLDB closes the sql.DB instance. It is NOT threadsafe and should only be called via defer in main.
Types ¶
type Configuration ¶
type Configuration struct { Database struct { User string `json:"user"` Name string `json:"name"` Password string `json:"password"` } HashCost int `json:"bcryptCost"` Address string `json:"address"` Secret string `json:"secret"` }
Configuration stores a copy of the JSON config file within a native struct. Changes made to the struct are not propagated to the file and vise-versa.
func GetConfig ¶
func GetConfig() *Configuration
GetConfig reads the 'config.json' file at the root of the project and returns a struct with its contents. Any fields not defined within the struct are ignored.
Click to show internal directories.
Click to hide internal directories.