MCPcopy
hub / github.com/dnote/dnote / WithUser

Function WithUser

pkg/server/context/user.go:32–34  ·  view source on GitHub ↗

WithUser creates a new context with the given user

(ctx context.Context, user *database.User)

Source from the content-addressed store, hash-verified

30
31// WithUser creates a new context with the given user
32func WithUser(ctx context.Context, user *database.User) context.Context {
33 return context.WithValue(ctx, userKey, user)
34}
35
36// WithToken creates a new context with the given user
37func WithToken(ctx context.Context, tok *database.Token) context.Context {

Callers 2

AuthFunction · 0.92
TokenAuthFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected