@@ -97,6 +97,9 @@ type ServiceReservation interface {
9797
9898 InitInstance (stateManagerServer string , reservationPath string , defaultTermMinutes int , logger * logrus.Logger , svcName string )
9999
100+ //Initialize with a custom http client (for example with OAuth2 transport)
101+ InitWithHTTPClient (stateManagerServer string , reservationPath string , defaultTermMinutes int , logger * logrus.Logger , svcName string , httpClient * retryablehttp.Client )
102+
100103 //Try to aquire locks for a list of xnames, renewing them within 30 seconds of expiration.
101104 Aquire (xnames []string ) error
102105
@@ -179,6 +182,12 @@ func (i *Production) InitInstance(stateManagerServer string, reservationPath str
179182 i .Init (stateManagerServer , reservationPath , defaultTermMinutes , logger )
180183}
181184
185+ // Initialize with a custom http client (for example with OAuth2 transport)
186+ func (i * Production ) InitWithHTTPClient (stateManagerServer string , reservationPath string , defaultTermMinutes int , logger * logrus.Logger , svcName string , httpClient * retryablehttp.Client ) {
187+ i .InitInstance (stateManagerServer , reservationPath , defaultTermMinutes , logger , svcName )
188+ i .httpClient = httpClient
189+ }
190+
182191// Lets make this really simple; Im going to wake up and see what expires in the next 30 seconds;
183192// then I will renew those things
184193func (i * Production ) doRenewal () {
0 commit comments