MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / WithDB

Function WithDB

server-source-code/internal/context/context.go:20–22  ·  view source on GitHub ↗

WithDB injects the request's database into the context.

(ctx stdctx.Context, db *database.DB)

Source from the content-addressed store, hash-verified

18
19// WithDB injects the request's database into the context.
20func WithDB(ctx stdctx.Context, db *database.DB) stdctx.Context {
21 return stdctx.WithValue(ctx, dbContextKey, db)
22}
23
24// DBFromContext returns the request's database from the context, or nil if not set.
25func DBFromContext(ctx stdctx.Context) *database.DB {

Callers 1

MiddlewareFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected