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

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