MCPcopy
hub / github.com/uselotus/lotus / Middleware

Function Middleware

go/event-ingestion/database/database.go:11–18  ·  view source on GitHub ↗
(db *sql.DB)

Source from the content-addressed store, hash-verified

9)
10
11func Middleware(db *sql.DB) echo.MiddlewareFunc {
12 return func(next echo.HandlerFunc) echo.HandlerFunc {
13 return func(c echo.Context) error {
14 c.Set("db", db)
15 return next(c)
16 }
17 }
18}
19
20func New() (*sql.DB, error) {
21 db, err := sql.Open("postgres", config.Conf.DatabaseURL)

Callers

nothing calls this directly

Calls 2

SetMethod · 0.65
nextFunction · 0.50

Tested by

no test coverage detected