From 34ea53e5b7efa747f852010135de1562d23b1fef Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 23 Oct 2017 18:42:38 +0200 Subject: [PATCH] comments --- proxy/context.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy/context.go b/proxy/context.go index f0400a65c..2f59dd77b 100644 --- a/proxy/context.go +++ b/proxy/context.go @@ -17,10 +17,12 @@ const ( resolvedIPsKey ) +// ContextWithSource creates a new context with given source. func ContextWithSource(ctx context.Context, src net.Destination) context.Context { return context.WithValue(ctx, sourceKey, src) } +// SourceFromContext retreives source from the given context. func SourceFromContext(ctx context.Context) (net.Destination, bool) { v, ok := ctx.Value(sourceKey).(net.Destination) return v, ok