github.com/blend/go-sdk@v1.20240719.1/reverseproxy/dial_option.go (about)

     1  /*
     2  
     3  Copyright (c) 2024 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package reverseproxy
     9  
    10  import (
    11  	"net"
    12  	"time"
    13  
    14  	"github.com/blend/go-sdk/webutil"
    15  )
    16  
    17  // DialOption is a mutator for a net.Dialer.
    18  type DialOption = webutil.DialOption
    19  
    20  // OptDialTimeout sets the dial timeout.
    21  func OptDialTimeout(d time.Duration) DialOption {
    22  	return func(dialer *net.Dialer) {
    23  		webutil.OptDialTimeout(d)(dialer)
    24  	}
    25  }
    26  
    27  // OptDialKeepAlive sets the dial keep alive duration.
    28  // Only use this if you know what you're doing, the defaults are typically sufficient.
    29  func OptDialKeepAlive(d time.Duration) DialOption {
    30  	return func(dialer *net.Dialer) {
    31  		webutil.OptDialKeepAlive(d)(dialer)
    32  	}
    33  }