Documentation
¶
Index ¶
Constants ¶
View Source
const DatabaseKey = "database"
DatabaseKey is the key used to set the DB connection in the request context.
Variables ¶
This section is empty.
Functions ¶
func ConnectToSQL ¶
ConnectToSQL is a function that will create a DB connection to your desired DB. Currently only the mysql driver is supported.
func GetConnection ¶
GetConnection is used to get the *sqlx.DB connection from the context of a http request object. This only works if the connection has been set in the request context.
func GetDatabaseName ¶
GetDatabaseName will retrieve the database name for the currently connected database
Types ¶
type Group ¶
func (*Group) Middleware ¶
type Server ¶
func (*Server) DBConnectionMiddleware ¶
func (s *Server) DBConnectionMiddleware(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*Server) Middleware ¶
func (*Server) RouteGroup ¶
Click to show internal directories.
Click to hide internal directories.