github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/api/cloudcontroller/ccv3/connection_wrapper.go (about)

     1  package ccv3
     2  
     3  import "code.cloudfoundry.org/cli/api/cloudcontroller"
     4  
     5  //go:generate counterfeiter . ConnectionWrapper
     6  
     7  // ConnectionWrapper can wrap a given connection allowing the wrapper to modify
     8  // all requests going in and out of the given connection.
     9  type ConnectionWrapper interface {
    10  	cloudcontroller.Connection
    11  	Wrap(innerconnection cloudcontroller.Connection) cloudcontroller.Connection
    12  }
    13  
    14  // WrapConnection wraps the current Client connection in the wrapper.
    15  func (client *Client) WrapConnection(wrapper ConnectionWrapper) {
    16  	client.connection = wrapper.Wrap(client.connection)
    17  }