github.com/LukasHeimann/cloudfoundrycli@v7.1.0+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 (requester *RealRequester) WrapConnection(wrapper ConnectionWrapper) {
    16  	requester.connection = wrapper.Wrap(requester.connection)
    17  }