IDFromRequest returns the unique id associated to the request if any.
(r *http.Request)
| 185 | |
| 186 | // IDFromRequest returns the unique id associated to the request if any. |
| 187 | func IDFromRequest(r *http.Request) (id xid.ID, ok bool) { |
| 188 | if r == nil { |
| 189 | return |
| 190 | } |
| 191 | return IDFromCtx(r.Context()) |
| 192 | } |
| 193 | |
| 194 | // IDFromCtx returns the unique id associated to the context if any. |
| 195 | func IDFromCtx(ctx context.Context) (id xid.ID, ok bool) { |