mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-01-21 22:06:21 +01:00
17 lines
302 B
Go
17 lines
302 B
Go
package middlewares
|
|
|
|
import (
|
|
"github.com/jinzhu/gorm"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
// ContextDB : pass db
|
|
func ContextDB(db *gorm.DB) echo.MiddlewareFunc {
|
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
|
return func(c echo.Context) error {
|
|
c.Set("db", db)
|
|
return next(c)
|
|
}
|
|
}
|
|
}
|