Skip to content

chore: pull changes from origin repo#2

Merged
liranp merged 23 commits intoupwindsecurity:v3from
jellydator:v3
Aug 12, 2025
Merged

chore: pull changes from origin repo#2
liranp merged 23 commits intoupwindsecurity:v3from
jellydator:v3

Conversation

@sabw8217
Copy link
Copy Markdown

Mostly irrelevant to us but jellydator#162 looks like it might be a nice free performance improvement.

dependabot Bot and others added 23 commits November 26, 2024 10:35
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…trategies

* new option to define the max memory the cache can use in bytes

* cache.set updated to cope with memory limitations

* options updated to implement the suggested new option

* cache impl updated + tests

* dependencies updated

* imports organized

* readme updated to document the new configuration option

* better explanation in the example

* readme line removed by accident restored

* function renamed (typo fixed)

* wording fixed

* useless sentence removed

* costs renamed to cost

* cost used in tests simplified

* CostCalcFunc renamed to CostFunc

* costsCalcFunc renamed to costFunc

* updateExpirations moved

* totalCost renamed to maxCost

* WithTotalCost option renamed to WithMaxCost

* example in README updated

* signature of the WithMaxCost option changed

* readme updated

* Item impl updated to hold the current cost and the corresponding cost calculation function; new constructor expecting options

* cache impl updated to make use of the new item properties

* new item options

* tests for the new options

* new Item related tests

* cache tests fixed to make them compile

* item option implementation updated to become a private interface

* cache set test updated

* made new item related functions private + eviction reason renamed

* moved initial item cost calsulation to the constructor function

* test functions renamed to reflect the private nature of functions under test

* version tracking fixed

* small readme update
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.9.0 to 0.10.0.
- [Commits](golang/sync@v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Changed applyOptions and the Option[K,V] to be non-allocating by avoiding pointers
Added the Test_Get_DoesNotAllocate to make sure that Get does not allocate (it fails before this commit)

---------

Co-authored-by: david <dovb@jellydator.dev>
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.10.0 to 0.11.0.
- [Commits](golang/sync@v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* GetOrSetFunc. For example, the method would be useful in an expression like this: namedLocks.GetOrSetFunc(name, func()*sync.Mutex{ return new(sync.Mutex) })

* save some memory

* applyOptions accpent struct, not pointer

* Fixed setOpts in SetOrGetFunc. Unit-test for GetOrSetFunc

* simplify our old GetOrSet for re-use logic
Added a new flag to support calling stopped cache cleanup procedures as well as a mutex to control it. Now:

- Start method will only run once even with the subsequent calls to it.
- Stop will never block, in case the Start was not called or Stop was called before, it will return as the cache cleanup process is not running.

Closes #175
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.11.0 to 0.14.0.
- [Commits](golang/sync@v0.11.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-version: 0.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@sabw8217 sabw8217 requested review from a team, emanela and thorsteinnth August 11, 2025 19:36
@sabw8217 sabw8217 closed this Aug 12, 2025
@sabw8217 sabw8217 reopened this Aug 12, 2025
@liranp liranp merged commit 2b5f76b into upwindsecurity:v3 Aug 12, 2025
@michaelprujan
Copy link
Copy Markdown

michaelprujan commented Aug 13, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.