Provide missing docs for Cache interface and transport constructors.

This commit is contained in:
Burcu Dogan
2014-05-26 16:47:46 +02:00
parent c376bb1dac
commit 4b558944a3
3 changed files with 10 additions and 3 deletions

3
jwt.go
View File

@@ -76,6 +76,9 @@ func (c *JWTConfig) NewTransportWithUser(user string) Transport {
return NewAuthorizedTransport(c, &Token{Subject: user})
}
// NewTransportWithCache initializes a transport by reading the initial
// token from the provided cache. If a token refreshing occurs, it
// writes the newly fetched token back to the cache.
func (c *JWTConfig) NewTransportWithCache(cache Cache) (Transport, error) {
token, err := cache.Read()
if err != nil {