Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
interface changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshkshah1992 committed Jan 21, 2021
1 parent a6fd13d commit f4c94c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions network/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ func WithNoDial(ctx context.Context, reason string) context.Context {
return context.WithValue(ctx, noDial, reason)
}

// EXPERIMENTAL: We might go ahead with introducing a new API in the Network to accomplish this later on.
// EXPERIMENTAL
// WithForceDirectDial constructs a new context with an option that instructs the network
// to attempt to force a direct connection to a peer via a dial even if a proxied connection to it already exists.
func WithForceDirectDial(ctx context.Context, reason string) context.Context {
return context.WithValue(ctx, forceDirectDial, reason)
}

// EXPERIMENTAL: We might go ahead with introducing a new API in the Network to accomplish this later on.
// EXPERIMENTAL
// GetForceDirectDial returns true if the force direct dial option is set in the context.
func GetForceDirectDial(ctx context.Context) (forceDirect bool, reason string) {
v := ctx.Value(forceDirectDial)
Expand Down

0 comments on commit f4c94c2

Please sign in to comment.