Commit Graph

88 Commits (v2)

Author SHA1 Message Date
Tiago Peczenyj ab4e731607
Run gofumpt and goimports (#2662)
* run goimports -w -local github.com/gofiber/fiber .

* run gofumpt -w -extra .
2023-10-05 13:14:30 +02:00
Tiago Peczenyj d25dfa4ce7
apply go fix ./... with latest version of go in repository (#2661)
apply go fix ./...
2023-10-05 12:24:59 +02:00
M. Efe Çetin 9fbb961adb
filesystem: refactor: use `errors.Is` instead of `os.IsNotExist` (#2558) 2023-08-06 18:10:44 +02: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
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
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
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
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
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
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
vecpeng f98a9ba405
feature: print all routes message when server starts (#1677)
* feature: print all routes message when server starts

* feature: print all routes message when server starts

* feature:  print all routes message when server starts

* 🐛fix: errors unhandled

* 🐛fix: ignore child process and add some "-" to the table head

* 🐛fix: add printRoutesMessage for listener and listenTLS
2021-12-30 14:13:31 +01:00
M. Efe Çetin f04ddd41ff
Fix goccy/go-json for go1.18-beta1. (#1673) 2021-12-29 02:12:29 +01:00
M. Efe Çetin 10aa7f7f3b
Update goccy/go-json to 0.8.1 (#1644)
* Update goccy/go-json to 0.8.1

* Fix linter.

* Update error.go
2021-12-06 08:24:57 +01:00
RW 9d01ed1d7c
Update fasthttp from v1.29.0 to v1.31.0 (#1603)
* Update fasthttp from v1.29.0 to v1.31.0

* Update fasthttp from v1.29.0 to v1.31.0
2021-10-28 08:55:59 +02:00
M. Efe Çetin 9eaa8b0c73
Change default json lib. (#1563)
* Change default json lib.

* Remove gopsutil test.

* Fix tests.

* Ignore linter for UnmarshalFieldError.

* update
2021-10-11 08:28:06 +02:00
Ali Yusuf 0763ecdd13
fix: Add missing TargetConditionals.h include (#1572)
closes #1571
2021-10-10 17:06:17 +02:00
Jason McNeil 9f537f922d
Update load_darwin.go (#1564) 2021-10-06 22:49:23 +02:00
M. Efe Çetin c0c14671ba
Add one minute load avg for monitor. (#1530)
Fix CI/CD errors.

Fix Windows.

Fix Windows.

Fix golint error.
2021-09-22 08:29:44 +02:00
RW 3e8227d7eb
FIX: panic: unaligned 64-bit atomic operation [32 bit machines] #1487 (#1502)
* 🐛 panic: unaligned 64-bit atomic operation [32 bit machines] #1487
https://pkg.go.dev/sync/atomic#pkg-notes
https://go101.org/article/memory-layout.html
https://github.com/golang/go/issues/36606

* 🐛 panic: unaligned 64-bit atomic operation [32 bit machines] #1487
change from uin64 to uint32 for the timestamp -> max value is 4294967295 -> Sun Feb 07 2106 06:28:15 GMT+0000
2021-08-22 10:28:34 +02:00
Kazumasa Takenaka (Bamboo) f5338266e3
fix typo (#1442)
paramters -> parameters
avilable  -> available
seperated -> separated
2021-07-17 17:20:14 +02:00
tuhao1020 a109dc6c68
Schema parser: use full match instead of strings.HasPrefix (#1424)
* #1414 use full match instead of strings.HasPrefix

* update for  nested or recursive structs

* replace strings.Contains with strings.IndexByte
2021-07-11 11:45:15 +02:00
Javad Rajabzade 7609117cec
Improved some conditions (#1386)
* simplify `u <= (1<<7)-1` to `u < (1 << 7)`

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* Instead Bool comparison can using simplified bool check if !var = false checking

* Unnecessary use of fmt.Sprintf for value without format

* For check condition two value not required ! method

* nil check may not be enough for slice, better check with len

* function parameters combined

* When the form returns error information, the text content should not start with a capital letter or end with a punctuation mark

* error var invalidPath should have name of the form errFoo, It is recommended that the error variables that are part of an API should be named

* change to condition len(x), it's faster https://github.com/gofiber/fiber/pull/1386#discussion_r652369520

* Update write.go

* Update write_bytes.go

* Update store.go

Co-authored-by: RW <rene@gofiber.io>
2021-06-17 22:03:59 +02:00
Ilya Chukov 89fdbcf036
Improve errors handling (#1381)
* replace `fmt.Errorf` to `errors.New`

* changed once `Sprintf` to `Join`
2021-06-13 11:11:42 +02:00
RW b1b490645e
Fix session middleware (#1235)
encoding/gob for session middleware
2021-03-26 11:24:55 +01:00