77[ ![ OpenSSF Scorecard] ( https://api.securityscorecards.dev/projects/github.com/fgm/container/badge )] ( https://securityscorecards.dev/viewer/?uri=github.com/fgm/container )
88[ ![ OpenSSF Best Practices] ( https://www.bestpractices.dev/projects/10245/badge )] ( https://www.bestpractices.dev/projects/10245 )
99
10- This module contains minimal type-safe Ordered Map, Queue, Set and Stack implementations
11- using Go generics.
10+ This module contains minimal type-safe Double-ended queue, Ordered Map, Queue, Set and Stack implementations
11+ using Go generics, as well as a concurrent-safe WaitableQueue .
1212
1313The Ordered Map supports both stable (in-place) updates and recency-based ordering,
1414making it suitable both for highest performance (in-place), and for LRU caches (recency).
1515
16+ The double-ended queue is currently a fork of the Go stdlib [ container/list] ( https://pkg.go.dev/container/list ) package,
17+ replacing the ` any ` value with a type parameter for type safety.
18+ This API is not stable, as it differs from the other packages,
19+ and will be deprecated when a simpler one is found, more in line with the other packages.
20+
1621## Contents
1722
1823See the available types by underlying storage
1924
20- | Type | Slice | Map | List | List+sync.Pool | List+int. pool | Recommended |
21- | ---------------| :-----:| :---:| :----:| :--------------:| :--------------:| ----------------------|
22- | OrderedMap | Y | | | | | Slice with size hint |
23- | Queue | Y | | Y | Y | Y | Slice with size hint |
24- | WaitableQueue | Y | | | | | Slice with size hint |
25- | Set | | Y | | | | Map with size hint |
26- | Stack | Y | | Y | Y | Y | Slice with size hint |
27-
25+ | Type | Slice | Map | List | List+sync.Pool | List+int. pool | Recommended |
26+ | -------------------- | :-----:| :---:| :----:| :--------------:| :--------------:| - ----------------------|
27+ | Double-ended queue | | | Y | | | Type-safe stdlib fork |
28+ | OrderedMap | Y | | | | | Slice with size hint |
29+ | Queue | Y | | Y | Y | Y | Slice with size hint |
30+ | WaitableQueue | Y | | | | | Slice with size hint |
31+ | Set | | Y | | | | Map with size hint |
32+ | Stack | Y | | Y | Y | Y | Slice with size hint |
2833
2934** CAVEAT** : In order to optimize performance, except for WaitableQueue,
3035all of these implementations are unsafe for concurrent execution,
@@ -43,9 +48,11 @@ See [BENCHARKS.md](BENCHMARKS.md) for details.
4348
4449See complete listings in:
4550
51+ - [ ` cmd/list ` ] ( cmd/list/real_main.go )
4652- [ ` cmd/orderedmap ` ] ( cmd/orderedmap/real_main.go )
4753- [ ` cmd/queuestack ` ] ( cmd/queuestack/real_main.go )
4854- [ ` cmd/set ` ] ( cmd/set/real_main.go )
55+ - [ ` cmd/waitablequeue ` ] ( cmd/waitablequeue/real_main.go )
4956
5057### Ordered Map
5158
@@ -137,7 +144,6 @@ the benchmarks, like:
137144
138145This will also run the fuzz tests in unit test mode, without triggering the fuzzing logic.
139146
140-
141147#### Fuzz tests
142148
143149Fuzz tests are not run by CI, but you can run them on-demand during development with:
@@ -150,3 +156,11 @@ Fuzz tests are not run by CI, but you can run them on-demand during development
150156
151157- Adjust ` -fuzztime ` duration as relevant: 20 seconds is just a smoke test.
152158- Be sure to escape the ` ^$ ` and ` \Q\E ` characters in the ` -fuzz ` argument in your shell.
159+
160+ ## Licensing
161+
162+ - In the directory [ container] ( container ) and below,
163+ this project includes code derived from the Go standard library's container/list package,
164+ which is licensed under the BSD 3-Clause License.
165+ The original copyright and license text are included in the source files.
166+ - The rest of this project is licensed under the Apache License 2.0.
0 commit comments