github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/api/cloudcontroller/ccv3/target.go (about)

     1  package ccv3
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  // TargetSettings represents configuration for establishing a connection to the
     8  // Cloud Controller server.
     9  type TargetSettings struct {
    10  	// DialTimeout is the DNS timeout used to make all requests to the Cloud
    11  	// Controller.
    12  	DialTimeout time.Duration
    13  
    14  	// SkipSSLValidation controls whether a client verifies the server's
    15  	// certificate chain and host name. If SkipSSLValidation is true, TLS accepts
    16  	// any certificate presented by the server and any host name in that
    17  	// certificate for *all* client requests going forward.
    18  	//
    19  	// In this mode, TLS is susceptible to man-in-the-middle attacks. This should
    20  	// be used only for testing.
    21  	SkipSSLValidation bool
    22  
    23  	// URL is a fully qualified URL to the Cloud Controller API.
    24  	URL string
    25  }
    26  
    27  // TargetCF sets the client to use the Cloud Controller specified in the
    28  // configuration. Any other configuration is also applied to the client.
    29  func (client *Client) TargetCF(settings TargetSettings) {
    30  	client.CloudControllerURL = settings.URL
    31  	client.InitializeConnection(settings)
    32  	client.InitializeRouter(settings.URL)
    33  }