-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Session to store values with a specified type V
* `Session` state is now a `map[string]V` instead of a `map[string]any` and uses a generics type parameter * Update `Set`, `Get`, and `GetOk` methods to use generic type `V` * Change `Session` to `Session[V any]` to specify the type of value stored in the Session * See updated usage docs for examples * Change `Store` to `Store[V any]` to specify the type of value stored in sessions * Change `NewCookieStore` to `NewCookieStore[V any]` to specify the type of value stored in sessions If you prefer to continue storing a map with `any` values, ``` // Store[any] store := NewCookieStore[any](cookieConfig, keyPairs...) ```
- Loading branch information
Showing
4 changed files
with
45 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters