Darien Raymond 8 년 전
부모
커밋
34ea53e5b7
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      proxy/context.go

+ 2 - 0
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