Commit Graph

7 Commits (0f046ccf9db795f2987876e4b24f45e2b5807f42)

Author SHA1 Message Date
Juan Calderon-Perez 0f046ccf9d v3: Use Named Fields Instead of Positional and Align Structures to Reduce Memory Usage (#3079)
* Use composites for internal structures. Fix alignment of structures across Fiber

* Update struct alignment in test files

* Enable alignment check with govet

* Fix ctx autoformat unit-test

* Revert app Config struct. Add betteralign to Makefile

* Disable comment on alert since it wont work for forks

* Update benchmark.yml

* Update benchmark.yml

* Remove warning from using positional fields

* Update router.go
2024-07-25 08:42:10 -04:00
Juan Calderon-Perez 95c181469d
chore: Enabling shuffling, cleanup and consistency across tests (#2931)
* Make Test/Benchmark names consistent. Add Makefile for GoFiber developers

* Cleanup README and Makefile

* Update statement
2024-03-24 20:54:56 +01:00
nickajacks1 4c68e0242d
ci: address multiple lint rules (#2869)
* ci: explicitly disable tagalign

Tagalign requires awkward manual formatting and doesn't provide much
value for readability.

* ci: enable mirror linter

mirror warns against certain cases of useless conversion between string
and []byte.

* ci: enable perfsprint linter

This linter encourages replacing several functions from the fmt package
with faster alternatives. While fixing issues, I also added a few
exported error types rather than returning a naked errors.New().
2024-02-19 14:33:10 +01:00
nickajacks1 a776d2933e
ci: re-enable tparallel linter (#2801)
In some cases, loop variables had to be reassigned to a local variable
to avoid concurrent access. This will no longer be needed when fiber's
minimum go version is bumped to 1.22, where each loop iteration gets its
own variable.
2024-01-17 09:47:26 +01:00
nickajacks1 f2e9c1f21d
🚨 Test: Speed up addon/retry tests (#2800)
There was a test that used the default exponential backoff
configuration, causing the test to run for over 3 minutes. This test
does not increase coverage in a way that warrants the slowdown of CI,
and the default backoff time values are already verified by a separate
test.
2024-01-15 11:18:39 +01:00
Trim21 c964fda009
v3(tests): use testify for assertion (#2036)
* replace

* write

* rewrite more

* rewrite

* rewrite

* fix

* rewrite
2022-08-22 07:57:10 +02:00
Gökhan Özeloğlu 4adda508b0
v3 (feature): add retry mechanism (#1972)
* v3-retry-mechanism: Add retry mechanism

* General logic is implemented.

* Unit tests are added.

Signed-off-by: Gökhan Özeloğlu <gokhan.ozeloglu@deliveryhero.com>

* Refactor test assertion

* Replaced testify/assert with fiber's assert.

Signed-off-by: Gökhan Özeloğlu <gokhan.ozeloglu@deliveryhero.com>

* Add test for next method

* currentInterval bug is fixed in Retry.

* If condition is fixed in next.

* struct definition refactored and if condtion is removed in TestExponentialBackoff_Retry.

Signed-off-by: Gökhan Özeloğlu <gokhan.ozeloglu@deliveryhero.com>

* Add config for retry.

* Constant variables are removed.

* Helper function is added for default.

* Helper function is used in New function.

Signed-off-by: Gökhan Özeloğlu <gokhan.ozeloglu@deliveryhero.com>

* Replace math/rand with crypto/rand

* Random number generation package has been replaced with more secure one,
crypto/rand.

Signed-off-by: Gökhan Özeloğlu <gokhan.ozeloglu@deliveryhero.com>

* Add a README for retry middleware

* Explanation and examples are added.

Signed-off-by: Gökhan Özeloğlu <gokhan.ozeloglu@deliveryhero.com>

* Add comment line for documentation

* Comment lines are added for ExponentialBackoff variables.

Signed-off-by: Gökhan Özeloğlu <gokhan.ozeloglu@deliveryhero.com>

* Run go mod tidy

* Unused package(s) removed.

Signed-off-by: Gökhan Özeloğlu <gokhan.ozeloglu@deliveryhero.com>

* move middleware -> addon

Signed-off-by: Gökhan Özeloğlu <gokhan.ozeloglu@deliveryhero.com>
Co-authored-by: Muhammed Efe Çetin <efectn@protonmail.com>
2022-08-19 08:20:14 +02:00