github.com/cloudfoundry-attic/cli-with-i18n@v6.32.1-0.20171002233121-7401370d3b85+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 }