Commit Graph

102 Commits (main)

Author SHA1 Message Date
Juan Calderon-Perez 395c8fafa9
🧹 chore: Fix linter workflow failures (#3354)
* Fix linter workflow failures

* Bump golang.org/x/net to v0.36.0

* Try skipping golangci-lint cache

* Update linter.yml

* fix: directives and spaces

* fix: better configuration

* fix: golangci-lint install

* Update golangci-lint version

* Enable SA4023

* Update golangci-lint config

* Remove duplicated rule

---------

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-03-17 08:29:51 +01:00
M. Efe Çetin 3fc1b29748
chore: replace vendored gorilla/schema package (#3152) 2024-10-11 14:52:09 +03:00
Juan Calderon-Perez 8c3f81e2b7
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-23 08:37:45 +02:00
Juan Calderon-Perez 0379cc59aa
fix: Inconsistent and flaky unit-tests (#2892)
* Fixes for some of the failing tests

* Add readiness check to serverStart()

* Use net/http client for tests listen test

* Use different key for this test

* Run Proxy Middleware tests in parallel. Add nil checks for potential issues pointed by nilaway

* Enable parallel client tests

* Do not run timing sensitive tests in parallel

* Remove TODO

* Revert Test_Proxy_DoTimeout_Timeout, and remove t.Parallel() for it

* Do not calculate favicon len on each handler call

* Revert logic change

* Increase timeout of SaveFile tests

* Do not run time sensitive tests in parallel

* The Agent can't be run in parallel

* Do not run time sensitive tests in parallel

* Fixes based on uber/nilaway

* Revert change to Client test

* Run parallel

* Update client_test.go

* Update client_test.go

* Update cache_test.go

* Update cookiejar_test.go

* Remove parallel for test using timeouts

* Remove t.Parallel() from logger middleware tests

* Do not use testify.require in a goroutine

* Fix import, and update golangci-lint

* Remove changes to template_chain.go

* Run more tests in parallel

* Add more parallel tests

* Add more parallel tests

* SetLogger can't run in parallel

* Run more tests in parallel, fix issue with goroutine in limiter middleware

* Update internal/storage/memory, add more benchmarks

* Increase sleep for csrf test by 100 milliseconds. Implement asserted and parallel benchmarks for Session middleware

* Add 100 milliseconds to sleep during test

* Revert name change

* fix: Inconsistent and flaky unit-tests

* fix: Inconsistent and flaky unit-tests

* fix: Inconsistent and flaky unit-tests

* fix: Inconsistent and flaky unit-tests

* fix: Inconsistent and flaky unit-tests

* fix: Inconsistent and flaky unit-tests

* fix: Inconsistent and flaky unit-tests

* fix: Inconsistent and flaky unit-tests

* fix: Inconsistent and flaky unit-tests

* fix: Inconsistent and flaky unit-tests

---------

Co-authored-by: M. Efe Çetin <efectn@protonmail.com>
Co-authored-by: René <rene@gofiber.io>
2024-03-08 20:03:13 +01:00
nickajacks1 3c4509f054
chore: Fix remaining testifylint errors (#2806) 2024-01-22 08:34:15 +01:00
Muhammed Efe Cetin 75bb02b87e
Merge remote-tracking branch 'origin/master' into v3-beta 2023-08-05 22:02:01 +03:00
Jiun Lee fefc533834
🚀 Add Logger interface and fiberlog (#2499)
* add log for fiber

* replace log in fiber

* add Log use to adapt for log libraries

* Update app.go

Co-authored-by: Tomás Warynyca <41587659+tomaswarynyca@users.noreply.github.com>

* wip: add log docs

* add WithLogger use to print key and value

* remove CtxLogger and add WithContext use to bind Context

* fix errcheck

* fix errcheck

* update log.md

---------

Co-authored-by: Tomás Warynyca <41587659+tomaswarynyca@users.noreply.github.com>
2023-06-26 08:16:57 +02:00
Lucas Lemos 5d53263572
🐛 fix: treat case for possible timer memory leak (#2488) 2023-05-31 08:01:13 +02:00
Kousik Mitra a59d9bac59
🚀 Consistent way of logging and fix middleware log format (#2432)
* 🚀 Replace fmt.Print* with log.Print* (#2402)

* 🚀 Fix middleware logging format (#2402)
2023-05-01 10:01:27 +02:00
UtopiaGitHub 678728de6d
🐛 [Bug-Fix]: add lock to avoid data race #2360 (#2368)
Update memory.go

The fix is to protect the access to s.db and save the result to a local variable.
2023-03-14 11:41:48 +01:00
Muhammed Efe Çetin 41866cd3dd
👷 v3 (ci): fix some linter warnings 2023-03-06 17:35:39 +03:00
Muhammed Efe Çetin 088cde594d
Merge remote-tracking branch 'origin/master' into v3-beta 2023-02-05 23:43:42 +03:00
leonklingele ac4ce21d9c
🐛 Bug: Fix issues introduced in linting PR (#2319)
* internal: revert linting changes

Changes to the internal package should not have been made in 167a8b5e94.

* middleware/monitor: revert changes to exported field "ChartJSURL"

This is a breaking change introduced in 167a8b5e94.

* middleware/monitor: fix error checking

Fix the errorenous error checking introduced in 167a8b5e94.

* 🐛 Bug: Fix issues introduced in linting PR #2319

* 🐛 Bug: Fix issues introduced in linting PR #2319

* Bug: Fix issues introduced in linting PR #2319

---------

Co-authored-by: René Werner <rene@gofiber.io>
2023-02-02 15:57:40 +01:00
leonklingele 167a8b5e94
🚀 Feature: Add and apply more stricter golangci-lint linting rules (#2286)
* golangci-lint: add and apply more stricter linting rules

* github: drop security workflow now that we use gosec linter inside golangci-lint

* github: use official golangci-lint CI linter

* Add editorconfig and gitattributes file
2023-01-27 09:01:37 +01:00
M. Efe Çetin 5406560033
🧹 chore: make most tests parallel (#2299)
* 🧹 chore: make most tests parallel

* revert some tests

* revert some tests

* revert some tests
2023-01-15 23:21:37 +08:00
M. Efe Çetin 1898c1f9a7
🐛 bug: fix gopsutil compilation (#2298)
* 🐛 bug: fix gopsutil compilation

* nolint
2023-01-15 15:39:04 +03:00
Serhat Şevki Dinçer 9dfdea45c1
🧹 🐛 fix some warnings, go-ole on mac os (#2280)
* 🧹 fix some warnings

* 🐛 fix go-ole on mac os
2023-01-01 15:16:38 +03:00
leonklingele 802defa5ff
v3 (chore): cleanup (#2255)
* middleware: switch to new Ctx interface in documentation

* all: use any instead of interface{}
2022-12-03 15:39:57 +03:00
Muhammed Efe Çetin c62dd16e8d
Merge remote-tracking branch 'origin/master' into v3-beta 2022-11-27 20:34:48 +03:00
RW e4b3b5c708
Improve interface for custom logger func (#2225)
* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal

* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal

* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal

* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal
2022-11-18 15:32:56 +01:00
skyenought e8f8cb647b
Add customTags in logger middleware Config (#2188)
*  Add customTags in logger middleware Config

* improve tags with parameter

* improve logger performance

* improve logger performance

* improve logger performance

* improve logger performance

Co-authored-by: René Werner <rene@gofiber.io>
2022-11-18 13:10:43 +01:00
leonklingele a0645af1ed
Fix and optimize memory storage (#2207)
* internal/memory: cache timestamp

* internal/memory: ensure to never delete non-expired items

This fixes a TOCTOU problem between a mutex rlock and a mutex lock.

* internal/memory: move costly operations outside of locked area

* internal/storage: cache timestamp

* internal/storage: ensure to never delete non-expired items

This fixes a TOCTOU problem between a mutex rlock and a mutex lock.

* internal/storage: move costly operations outside of locked area
2022-11-14 08:21:03 +01:00
Kris Carr f26d9b1d4e
v3 (deps): update to use gofiber/utils/v2 (#2184) 2022-10-31 16:44:53 +03:00
Muhammed Efe Çetin 9428befb9c
Merge remote-tracking branch 'origin/master' into v3-beta 2022-10-28 17:26:17 +03:00
M. Efe Çetin 691d2e6ad5
🗑️ deprecate: go 1.14 & go 1.15 support deprecation (#2172)
* 🗑️ deprecate: go 1.14 & go 1.15 support deprecation
https://github.com/valyala/fasthttp/pull/1379

* fix tests
2022-10-26 11:51:50 +02:00
M. Efe Çetin 156b81c768
🐛 bug: improve mounting behavior (#2120)
* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* add onMount hooks, mountPath like express.js, better behavior for onName, onRoute, onGroup, onGroupName hooks on mounted apps

* add comment

* use once

* fix views when both app and sub-app have view engine, better behavior for mount path

* fix tests

* fix tests

* make some tasks

* make some tasks
2022-10-25 07:51:44 +02:00
kinggo 5fb93fdff6
🐛 fix: multi-byte AppName displays confusion (#2148)
fix: solve wrong print width
2022-10-21 08:30:56 +02:00
RW ce2d087394
Improve memory storage (#2162)
* improve memory storage code and performance

* improve memory storage code and performance

* improve memory storage code and performance

* improve memory storage code and performance

* improve memory storage code and performance

* improve memory storage code and performance
2022-10-19 16:22:42 +02:00
kinggo 8e8ad95079
feat: support to set client in proxy mw (#2117)
optimize: add WithClient
2022-09-28 14:27:58 +02:00
Muhammed Efe Çetin 319b8ea3a8
Merge remote-tracking branch 'origin/master' into v3-beta 2022-09-03 23:56:45 +03:00
Amir Hossein 506f0b21c5
fix unhandled error in `common_linux.go` (#2056)
* 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
2022-08-28 18:45:56 +02:00
Amir Hossein b86f79eca4
handle file error on closing (#2050)
* 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
2022-08-26 15:46:45 +02:00
Amir Hossein ffb2d4cb1a
fix unhandled error in cache package tests (#2049)
* 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
2022-08-26 14:10:46 +02: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
M. Efe Çetin 6669ec4486
📝 docs: gofmt & add missing copyright texts (#2013) 2022-08-15 20:25:26 +02:00
M. Efe Çetin 9761f4e797
🐛 bug: fix gopsutil when compiling for bsd. (#1995) 2022-08-03 16:03:17 +02:00
Muhammed Efe Çetin 3b943d79c9
v3: remove internal/template/html, replace internal/memory by internal/storage/memory 2022-06-04 14:19:59 +03:00
Muhammed Efe Çetin 8a15f77fc4
v3: move most deps to go.mod 2022-06-02 17:37:53 +03:00
Muhammed Efe Çetin 1188144d78
🎉 v3: init 2022-05-31 17:35:49 +03:00
Philippe Bernardino Leite 19c3a3c2c9
z/OS Compatibility (#1904) 2022-05-09 08:40:02 +02:00
M. Efe Çetin ee65ea5bab
🧹 Use encoding/json (#1851)
* remove goccy/go-json

* fix tests.
2022-04-13 10:45:33 +02:00
Serhat Şevki Dinçer 2f0d745b5a
🆙 bump goccy/go-json to 0.9.6 (#1832) 2022-03-22 13:21:46 +03:00
M. Efe Çetin 10fa3ef6f5
🤖 deps: bump goccy/go-json to v0.9.5 (#1808)
* bump goccy/go-json to 0.9.4

* bump goccy/go-json to 0.9.5
2022-03-05 21:19:03 +01:00
Théotime Lévêque df85b62a78
🐛 Fix go-json generator. (#1806)
go generate ./... generates panic as import paths have
probably changed over time. This commit free this command
from panics.
2022-03-05 15:39:34 +03:00
M. Efe Çetin 937713e41e
feature: bind support for render (#1754)
* Bind support for Render.

* update

* fix tests

* split Pass-locals-to-views & Bind from Render

* update comments.

* add benchs.

* Update ctx.go

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>

* Update ctx.go

* optimize

* switch dictpool.

*  feature: bind support for render
- improve performance

*  feature: bind support for render
- improve performance

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
Co-authored-by: wernerr <rene.werner@verivox.com>
Co-authored-by: wernerr <rene@gofiber.io>
2022-02-12 22:52:24 +01:00
M. Efe Çetin aa56364445
bump goccy/go-json to 0.9.4 (#1771) 2022-02-12 19:36:48 +01:00
M. Efe Çetin 8bd1509311
Change default gc interval. (#1756) 2022-02-07 13:42:40 +01:00
M. Efe Çetin c450072f4a
🐛 fix: mounted app views (#1749)
* Fix mounted app views.

* Cleaner structure.

Co-authored-by: RW <rene@gofiber.io>

* remove unnecessary lines.

* Add test case for group-with-mount, remove unnecessary lines.

Co-authored-by: RW <rene@gofiber.io>
2022-02-06 14:58:45 +01:00
M. Efe Çetin 3663c70f6c
📦 Update goccy/go-json to 0.9.3. (#1719)
* Update goccy/go-json to 0.9.3.

* Remove test
2022-01-18 09:48:11 +01:00
M. Efe Çetin 6f34de511e
Update goccy/go-json to 0.9.1. (#1709)
* Update goccy/go-json to 0.9.1.

* fix lint error
2022-01-11 15:23:59 +01:00