feat: implement token expiration watcher

This commit is contained in:
James Houlahan
2020-04-02 14:10:15 +02:00
parent ce29d4d74e
commit 941e09079c
15 changed files with 149 additions and 93 deletions

View File

@ -81,6 +81,7 @@ type ClientConfig struct {
// Transport specifies the mechanism by which individual HTTP requests are made.
// If nil, http.DefaultTransport is used.
// TODO: This could be removed entirely and set in the client manager via SetClientRoundTripper.
Transport http.RoundTripper
// Timeout specifies the timeout from request to getting response headers to our API.
@ -108,7 +109,6 @@ type Client struct {
requestLocker sync.Locker
keyLocker sync.Locker
expiresAt time.Time
user *User
addresses AddressList
kr *pmcrypto.KeyRing