github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/api/cloudcontroller/ccv2/connection_wrapper.go (about)

     1  package ccv2
     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  }