* Expand Test_Utils_Parse_Address
* Update implementation based on Codex
* Remove duplicated func
* Update test fmt
* format
* Update helpers_test.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* more format
* more format
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: support for starting devtime dependencies in an abstract manner
* feat: support for starting devtime dependencies in an abstract manner
* fix: spell
* fix: lint
* fix: markdown lint
* fix: b.Helper
* fix: lint spell
* fix: field padding
* chore: protect the usage of dev dependencies with the "dev" build tag
* fix: error message
* docs: fix type name
* fix: mock context cancellation
* docs: simpler
* fix: lint unused receiver
* fix: handle error in benchmarks
* lint: remove build tag
* fix: wrap error
* fix: lint
* fix: explain why lint exclusion
* chore: best effort while terminating dependencies
* gix: lintern name
* fix: reduce flakiness in tests
* chore: get dependency state for logs
* chore: protect dev time tests and benchmarks under build tag
* chore: add build tag in more places
* fix: more conservative context cancellation timeout in tests
* chore: remove build tags
* chore: rename to Services
* fix: update tests
* fix: lint
* fix: lint
* fix: apply coderrabit suggestion
* chore: add more unit tests
* chore: add more unit tests
* chore: refactor tests
* fix: avoid control flags in tests
* chore: consistent error message in start
* chore: simplify error logic
* chore: remove flag coupling
* chore: simplify benchmarks
* chore: add corerabbit suggetion
* fix: wording
* chore: log error on service termination
* docs: wording
* fix: typo in error message
* fix: wording
* fix: panic on startup error
* chore: store started services separately, so that we can terminate them properly
* docs: update example
* fix: use context provider instead of storing the context
* chore: use require.Empty
* fix: no tabs in docs
* chore: move field for better alignment
* docs: do not use interface as method receiver
* docs: proper usage of JSON bind
* fix: use startup context for bootstrap log
* chore: move happy path to the left
* fix: use configured consistently
* chore: terminate started services in reverse order
* fix: consistent access to the config context
* chore: test names and benchmarks location
* chore: benchmark refinement
* chore: store the services into the global State
* chore: add functions to access the Services in the state
* chore: hex-encode the hashes
* chore: consistent var name for services
* chore: non racey service initialisation
* fix: wrong range iteration in service keys
* fix: use inline
* chore: more tests for the generics functions for services
* chore: add benchmarks for service functions
* fix: benchmarks refactor was wrong
* fix. refine error message
* fix: do not cause overhead in newState, instead pre-calculate the prefix hash at init
* chore: simplify hashing
* chore: use smaller, and testable function for initServices
* chore: initialize services in the app.init
* chore: init services before blocking the app init
* Revert "chore: init services before blocking the app init"
This reverts commit bb67cf6380cb71ad5ae4ab4807cdfbf0c7eafa1b.
* chore: move happy path to the left at initServices
* fix: register shutdown hooks for services after app's mutext is unlocked
---------
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
* feat: Add All method to Bind
This commit introduces a new `All` method to the `Bind` struct, enabling the binding of request data from multiple sources (URI parameters, body, query parameters, headers, and cookies) into a single struct.
The `All` method iterates through the available binding sources, applying them in a predefined precedence order. It merges the values from each source into the output struct, only updating fields that are currently unset.
Changes:
- Added `All` method to `Bind` struct.
- Added `mergeStruct` helper function to merge struct values.
- Added `isZero` helper function to check if a value is zero.
- Added a test case for the `All` method in `bind_test.go` to validate its functionality.
* feat: Enhance Bind.All with comprehensive testing and configuration
The changes include:
- Added `RequestConfig` struct to encapsulate request configuration (ContentType, Body, Headers, Cookies, Query).
- Implemented `ApplyTo` method on `RequestConfig` to apply the configuration to the context.
- Created multiple test cases for `Bind.All` covering successful binding, missing fields, overriding query parameters, and form binding.
- Added a test case `Test_Bind_All_Uri_Precedence` to validate the precedence of URI parameters.
- Added benchmark test `BenchmarkBind_All` to measure the performance of the `Bind.All` method.
- Refactored the `TestBind_All` to use the new `RequestConfig` and assertion libraries.
* fix: Correct form binding in Test_Bind_All
* refactor: Improve Bind.All test and struct field ordering
- Reordered fields in `RequestConfig` and `User` structs for field alignment
- Updated `Test_Bind_All` to use `require.NoError` for more robust error checking.
- Corrected header key casing in `Test_Bind_All` to `X-User-Role` to match the struct tag.
- Added `t.Parallel()` to the test function to enable parallel test execution.
* feat: Document Bind.All function in API documentation
This commit adds documentation for the `Bind.All` function to the API documentation.
The documentation includes:
- A description of the function's purpose and precedence order for binding data from different sources (URI, body, query, headers, cookies).
* docs: lint Bind.All documentation
* fix: Update parameter tags from 'param' to 'uri' in bind_test.go
* fix: Update parameter tags from 'param' to 'uri' in bind.md
* test: Replace assert with require in bind_test.go
* feat: Add support for unified binding with defined precedence order in whats_new.md
---------
Co-authored-by: RW <rene@gofiber.io>
* Set default redirect response status to 303 SeeOther
Closes#3405
In some browsers, redirect status 302 Found sometimes is used to change
the HTTP verb of the response from what the user set to what was used in
the request. Changing to 303 SeeOther in the default works more like
expected: it defaults to GET and can be overriden by the user.
* Add tests to Redirect default status change.
* Update docs.
* Fix remaining tests to reflect redirect 303 status as the new default. Reflect that in docs/whats_new.md
* Update redirect_test.go
* Fix code review hints
---------
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: René <rene@gofiber.io>
* Force the use of terminal colors via config option
* docs: add example for forcing terminal colors in logger middleware
* test: add benchmarks for logger middleware with forced colors
* Add ForceColors field to 'whats new'
* Show example in 'whats new'
Revert "🔥 feat: Add Context Support to RequestID Middleware (#3200)"
This reverts commit f725ded92bac13e773f92ff478e1a461c160abd3.
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Revert "🔥 feat: Add support for context.Context in keyauth middleware (#3287)"
This reverts commit 4177ab4086a97648553f34bcff2ff81a137d31f3.
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>