Enhance DNS and Dialer (#341)
This commit is contained in:
1 parent
ad1807dd99
commit
db32ce6fd9
22 files changed
+682
-290
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package internet
|
||||
|
||||
import "context"
|
||||
|
||||
type systemDialer int
|
||||
|
||||
const systemDialerKey systemDialer = 0
|
||||
|
||||
func ContextWithLookupDomain(ctx context.Context, domain string) context.Context {
|
||||
return context.WithValue(ctx, systemDialerKey, domain)
|
||||
}
|
||||
|
||||
func LookupDomainFromContext(ctx context.Context) string {
|
||||
if domain, ok := ctx.Value(systemDialerKey).(string); ok {
|
||||
return domain
|
||||
}
|
||||
return ""
|
||||
}
|
||||
Reference in new issue
Block a user