Skip to content

Commit

Permalink
docs: clarify supported go versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kernle32dll committed Oct 14, 2020
1 parent f6c50ec commit aab672f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ go get github.com/kernle32dll/jwtcache-go

Detailed documentation can be found on [GoDoc](https://godoc.org/github.com/kernle32dll/jwtcache-go).

### Usage
## Usage

First, you have to instantiate a `jwt.Cache`. This is done via `jwt.NewCache` (which takes option style parameters).

Expand Down Expand Up @@ -47,7 +47,7 @@ token, err := jwt.EnsureToken(context.Background())
**Implementation detail**: The validity check is done via the `exp` claim of the JWT. If it is not set, the token is never
cached. However, the token is still passed trough (and a warning is logged).

### Further usage
## Further usage

In addition to the `jwt.Cache`, this lib has an additional trick up its sleeve in the form of `jwt.CacheMap`.

Expand All @@ -68,4 +68,8 @@ tenantCache.EnsureToken(context.Background(), "d1851563-c529-42d9-994b-6b996ec4b
The use-case `jwt.CacheMap` was implemented for was multi-tenant applications, which need to independently cache
JWTs per tenant (a good cache key might be the UUID of a tenant, for example).

**Implementation detail**: The underlying map is concurrency-safe, and lazily initialized.
**Implementation detail**: The underlying map is concurrency-safe, and lazily initialized.

## Compatibility

jwt-cache-go is automatically tested against Go 1.13.X, 1.14.X and 1.15.X.

0 comments on commit aab672f

Please sign in to comment.