FromContext returns the peer information in ctx if it exists.
(ctx context.Context)
| 78 | |
| 79 | // FromContext returns the peer information in ctx if it exists. |
| 80 | func FromContext(ctx context.Context) (p *Peer, ok bool) { |
| 81 | p, ok = ctx.Value(peerKey{}).(*Peer) |
| 82 | return |
| 83 | } |