Commit Graph

15 Commits (main)

Author SHA1 Message Date
耗子 8e54c8f938
🐛 fix: Update binder in form_test (#3336)
* Fix: error binder in form_test

* fix: form tag

* Fix: error package name
2025-03-04 05:46:05 +01:00
M. Efe Çetin 3fc1b29748
chore: replace vendored gorilla/schema package (#3152) 2024-10-11 14:52:09 +03: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 ccf16117c0
ci: Update golangci-lint to v1.55.2 (#2817)
ci: bump golangci-lint to 1.55.2
2024-01-30 09:53:17 +01:00
nickajacks1 408fa20a91
🔥 v3: update Ctx.Format to match Express's res.format (#2766)
* 🔥 v3: update Ctx.Format to match Express's res.format

While the existing Ctx.Format provides a concise convenience method for
basic content negotiation on simple structures, res.format allows
developers to set their own custom handlers for each content type.

The existing Ctx.Format is renamed to Ctx.AutoFormat.

* doc: add docs for Ctx.Format

* refactor: update based on code review feedback

- Rename Fmt to ResFmt
- Add comments in several places
- Return errors instead of panicking in Format
- Add 'Accept' to the Vary header in Format to match res.format

* chore: improve docs and tests for AutoFormat and Format
2024-01-04 09:50:36 +01:00
Muhammed Efe Çetin 9428befb9c
Merge remote-tracking branch 'origin/master' into v3-beta 2022-10-28 17:26:17 +03:00
Amir Hossein 66d5b195c5
fix unhandled errors and update code comments to help the IDEs (#2128)
* fix unhandled errors

* fix unhandled error in cache package test

* omit variable type

* omit variable type

* rename variable because collide with the imported package name

* handle file error on closing

* fix unhandled in common_linux.go

* fix unhandled errors in helpers_test.go

* fix unhandled errors in listen_test.go

* remove unused parameter in emptyHandler method

* refactor path.go

* unhandled error in hooks test

* fix unhandled errors in app_test.go

* fix unhandled errors in ctx_test.go

*  fix unhandled errors in helpers_test.go

* revert app_test.go

* remove redundant parentheses and update comments

* update code comment for helping ide

* update code comment for helping ide

* fix unhandled error in app_test.go

* update code comments for helping IDEs

* fix unhandled errors in app_test.go

* update code comment for helping the IDEs
2022-09-28 14:26:20 +02:00
M. Efe Çetin 10d6f69a89
v3 (feature): new redirection methods (#2014)
*  v3 (feature): new redirection methods

* add flash messages

* withinput, parsing flash message

* add tests

* add benchmarks

* gosec issues

* fix tests

* fix tests

* fix performance issues

* fix performance issues

* optimization.

* better names

* fix tests

* Update router.go

* fix

* fix old messaages with flash messages behavior, add new test case with req

* complete some reviews

* add pool for redirection.

* use constant

* update

*  v3 (feature): new redirection methods

* fix tests, optimize cookie parsing (9 allocs -> 1 alloc)

* test case for message includes comma

* cleanup

* optimization.

* some improvements for the redirect feature

* fix Benchmark_Redirect_Route_WithFlashMessages

* some improvements for the redirect feature

* Update redirect.go

* improve message parsing & test case

Co-authored-by: René Werner <rene@gofiber.io>
2022-09-23 08:17:34 +02:00
M. Efe Çetin 281e2f0046
v3 (feature): merge Listen methods & ListenConfig (#1930)
*  v3: new Start method for app

*  v3: new Start method for app

*  v3: new Start method for app

*  v3: new Start method for app

*  v3: new Start method for app

*  v3: new Start method for app

* fix tests

* improve graceful shutdown

* update

* Start -> Listen

* rename test funcs.

* Add Test_Listen_Graceful_Shutdown test.

* add OnShutdownSuccess

* fix tests

* fix tests

* split listen & listener

* typo

* Add retry logic to tests

* Add retry logic to tests

* Add retry logic to tests

* Add retry logic to tests

Co-authored-by: René Werner <rene@gofiber.io>
2022-09-08 07:57:05 +02:00
Muhammed Efe Çetin cadd6014bb
v3: cleanup & update deps 2022-08-17 23:01:59 +03:00
M. Efe Çetin eacde70294
v3 (feature): initial support for binding (#1981)
*  v3 (feature): initial support for binding

*  v3 (feature): initial support for binding #1981
use pointer/references instead of copies

*  v3 (feature): initial support for binding
embed bind into the ctx

*  v3 (feature): initial support for binding
- add URI binder.

*  v3 (feature): initial support for binding
- add response header binder.

*  v3 (feature): initial support for binding
- add response header binder.

*  v3 (feature): initial support for binding
- add cookie binder.

*  v3 (feature): initial support for binding
- custom binder support for body binding.
- test case for custom binder.

*  v3 (feature): initial support for binding
- add map[string][]string & map[string]string support for binders.

*  v3 (feature): initial support for binding
- fix Test_Bind_Header_Map

*  v3 (feature): initial support for binding
- Functional Should/Must

*  v3 (feature): initial support for binding
- custom struct validator support.

*  v3 (feature): initial support for binding
- README for binding.
- Docs for binding methods.

*  v3 (feature): initial support for binding
- Bind() -> BindVars(), Binding() -> Bind()

*  v3 (feature): initial support for binding
- fix doc problems

*  v3 (feature): initial support for binding
- fix doc problems

Co-authored-by: wernerr <rene@gofiber.io>
2022-08-08 09:16:08 +02:00
Muhammed Efe Çetin 1188144d78
🎉 v3: init 2022-05-31 17:35:49 +03:00
M. Efe Çetin ee65ea5bab
🧹 Use encoding/json (#1851)
* remove goccy/go-json

* fix tests.
2022-04-13 10:45:33 +02:00
M. Efe Çetin ad1a925d38
add missing json errors. (#1755) 2022-02-06 21:28:02 +01:00
George Goranov 1852224001
Expose internal errors. (#1387) 2021-06-16 10:58:22 +02:00