MCPcopy Index your code
hub / github.com/dnote/dnote / User

Function User

pkg/server/context/user.go:43–51  ·  view source on GitHub ↗

User retrieves a user from the given context. It returns a pointer to a user. If the context does not contain a user, it returns nil.

(ctx context.Context)

Source from the content-addressed store, hash-verified

41// User retrieves a user from the given context. It returns a pointer to
42// a user. If the context does not contain a user, it returns nil.
43func User(ctx context.Context) *database.User {
44 if temp := ctx.Value(userKey); temp != nil {
45 if user, ok := temp.(*database.User); ok {
46 return user
47 }
48 }
49
50 return nil
51}
52
53// Token retrieves a token from the given context.
54func Token(ctx context.Context) *database.Token {

Callers 15

getBooksMethod · 0.92
V3ShowMethod · 0.92
createMethod · 0.92
updateMethod · 0.92
delMethod · 0.92
getNotesMethod · 0.92
getNoteMethod · 0.92
createMethod · 0.92
delMethod · 0.92
updateMethod · 0.92
PasswordUpdateMethod · 0.92
ProfileUpdateMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected