serverFromContext gets the Server from the context.
(ctx context.Context)
| 2045 | |
| 2046 | // serverFromContext gets the Server from the context. |
| 2047 | func serverFromContext(ctx context.Context) *Server { |
| 2048 | s, _ := ctx.Value(serverKey{}).(*Server) |
| 2049 | return s |
| 2050 | } |
| 2051 | |
| 2052 | // contextWithServer sets the Server in the context. |
| 2053 | func contextWithServer(ctx context.Context, server *Server) context.Context { |