Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zekroTJA committed May 4, 2024
1 parent f1d2649 commit d3aff47
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ This package allows to set values to a map which will expire and disappear after

[Here](https://pkg.go.dev/github.com/zekroTJA/timedmap/v2) you can read the docs of this package, generated by pkg.go.dev.

> [!IMPORTANT]
> The package has been updated to `v2` which will introduce breaking changes to `v1`.
> - The package now requires a minimum Go version of `v1.19`.
> - `TimedMap` and corresponding constructor function now take type parameters for key and value types for improved type safety.
> - Sections have been removed in favor of performance and simplicity of the package.
> - Previously deprecated functions have been removed.
>
> If you experience issues with `v1`, please create an issue with the specific version mentioned. `v1` will still receive updates for bugs and incosistencies alongside `v2`.
---

## Usage Example
Expand Down Expand Up @@ -74,7 +83,7 @@ func printKeyVal(tm *timedmap.TimedMap[string, int], key string) {
}
```

Further examples, you can find in the [example](examples) directory.
Further examples, you can find in the [examples](examples) directory.

If you want to see this package in a practcal use case scenario, please take a look at the rate limiter implementation of the REST API of [myrunes.com](https://myrunes.com), where I have used `timedmap` for storing client-based limiter instances:
https://github.com/myrunes/backend/blob/master/internal/ratelimit/ratelimit.go
Expand Down

0 comments on commit d3aff47

Please sign in to comment.