getSession reads the session from the context.
(ctx context.Context)
| 108 | |
| 109 | // getSession reads the session from the context. |
| 110 | func getSession(ctx context.Context) *models.Session { |
| 111 | if ctx == nil { |
| 112 | return nil |
| 113 | } |
| 114 | obj := ctx.Value(sessionKey) |
| 115 | if obj == nil { |
| 116 | return nil |
| 117 | } |
| 118 | return obj.(*models.Session) |
| 119 | } |
| 120 | |
| 121 | // withSignature adds the provided request ID to the context. |
| 122 | func withSignature(ctx context.Context, id string) context.Context { |
searching dependent graphs…