1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-11 23:01:22 +00:00

57 Commits

Author SHA1 Message Date
Muhammed Efe Cetin
6ea4d81331
Merge branch 'master' into v3-beta 2023-11-07 20:22:31 +03:00
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
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
SamanDev
ed95fa8c7e
🔥 Feature: add ability to print custom message on startup (#2491)
* feat: add a variadic parameter on OnListenHandler

* feat: accept a variadic ListenData in startupProcess parameters

* feat: add startupProcess variadic ListenData to function

* refactor: use runOnListenHooks instead of startupProcess for run onListenHooks

* refactor: remove variadic to make codes straightforward

* fix: add listen data to runOnListenHooks

* test: add listenData parameter to OnListen tests

* docs: update OnListen docs

* fix: remove unused codes

* docs: add tabs to onListen hook example

* docs: add if statement to docs example

* docs: replace fmt with log

* docs: fix return value of example

* docs: make 0.0.0.0 string a constant

* fix: change type of TLS from string to bool

* fix: return bool instead of a string

* docs: update example with new TLS type

* fix: change name tls to isTls to prevent shadowing tls variable

* style: make syntax of onListen example shorter

* refactor: remove unused no-lint comment

* refactor: change isTls to isTLS

* fix: add nolint for isTLS bool param

* Update listen.go

---------

Co-authored-by: M. Efe Çetin <efectn@protonmail.com>
2023-06-19 13:11:22 +02:00
M. Efe Çetin
d4938dad6c
🐛 bug: fix onListen hooks when they are used with prefork mode (#2504)
* 🐛 bug: fix onListen hooks when they are used with prefork mode

🐛 bug: fix onListen hooks when they are used with prefork mode

* 🐛 bug: fix onListen hooks when they are used with prefork mode
2023-06-09 22:42:50 +02: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 167a8b5e9421e0ab51fbf44c5621632f4a1a90c5.

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

This is a breaking change introduced in 167a8b5e9421e0ab51fbf44c5621632f4a1a90c5.

* middleware/monitor: fix error checking

Fix the errorenous error checking introduced in 167a8b5e9421e0ab51fbf44c5621632f4a1a90c5.

* 🐛 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
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
とーふとふ
43133bec43
🔥 Add OnPrefork Hooks so you can get the PID of the child process. (#1974) 2022-08-01 08:25:56 +02:00
M. Efe Çetin
68d3b773bc
Add route naming feature. (#1650)
* Add route naming feature.

* Update basicauth_test.go

* Fix gosec issues.

* Change RoutaName -> Name

* Fix race conditions.

* Update READMEs.
2021-12-28 14:04:04 +01:00
Gusted
7b7dcf29f7
♻️ Tidy up the codebase (#1613)
* run gofmt

* add t.Helper()

* Simplify assigns

* Simplify make operation

* Remove unused field in struct

* Fix typo

* Run gofumpt ./

* Consistent spacing

* len(...) can never be negative

* Use ReplaceAll

* Simplify operation

* Remove deadcode

* Fix typo

* Tidy up `} else { if ...`

* Fix AssertEqual

* Remove t.Helper() to fix go1.14.15
2021-11-05 08:00:03 +01:00
Kiyon
1b734c5a5a 👷 Fix docs typo 2021-05-07 09:26:05 +08:00
Kiyon
0ec0f50cfd 🔥 Add network option 2021-02-07 13:55:13 +08:00
Kiyon
ecb95fbffc 👷 start process before prefork server starting 2021-02-02 09:41:11 +08:00
kiyon
f6f2f769c1 🉑 revert GOMAXPROCS in master process 2020-09-22 22:48:51 +08:00
Cosmin Goea
abb701ac87 Bind the master process to 1 CPU thread. See #799 for more details. 2020-09-16 14:02:58 -04:00
Fenny
ec5d66e7a8 v2 2020-09-13 11:20:11 +02:00
Fenny
e4b345b35c 👪 Combine helper fn's in prefork.go
Co-Authored-By: RW <renewerner87@googlemail.com>
Co-Authored-By: kiyon <kiyonlin@users.noreply.github.com>
2020-07-22 02:07:37 +02:00
Fenny
b8ae52c835 🔍 detect tcp proto by addr 2020-07-18 01:19:45 +02:00
Fenny
a6b03415aa 🔍 Auto detect TCP protocol 2020-07-18 01:17:52 +02:00
Fenny
468404efe4 🔌 Support TCP6 in Prefork mode 2020-07-18 00:57:43 +02:00
kiyon
227c751abc 🌼 separate different logic on each OS for child process to watch if master process exits 2020-07-17 06:51:57 +08:00
kiyon
30a704b5f9 👷 improve test coverage 2020-07-16 16:42:36 +08:00
Fenny
9275592a51 🩹 Fix Prefork Test 2020-07-15 15:20:10 +02:00
Fenny
d66d6a9cd5 🩹 Fix prefork test case 2020-07-15 15:16:43 +02:00
Fenny
a08de07fd5 🩹 Fix prefork test case 2020-07-15 15:15:23 +02:00
Fenny
7fc4b37dfb 🩹 Fix prefork test 2020-07-15 15:10:59 +02:00
Fenny
fd1c01ddfa Merge remote-tracking branch 'upstream/master' 2020-07-15 14:28:04 +02:00
Fenny
9125080df2 Merge remote-tracking branch 'upstream/master' 2020-07-15 14:24:59 +02:00
kiyon
1499e2beb2 💯 cover prefork error statement 2020-07-15 15:13:02 +08:00
kiyon
efec24a7fc change dummy cmd to date 2020-07-15 10:56:17 +08:00
kiyon
b0e3979437 👍 improve prefork test coverage 2020-07-15 10:37:57 +08:00
Fenny
600e6dccdb 🏹 Use Fasthttp reuseport package 2020-07-15 01:21:38 +02:00
Fenny
883882fd0b 🔌 Use ppid to close child procs 2020-07-14 16:21:22 +02:00
Fenny
20cba2604b 🔌 Add IPv6 support
Co-Authored-By: kiyon <kiyonlin@163.com>
2020-07-14 03:53:58 +02:00
Fenny
b8fbaca1ea 🔌 Add IPv6 Support
Co-Authored-By: kiyon <kiyonlin@163.com>
2020-07-14 03:02:26 +02:00
Fenny
89c7d8dc56 👶 Kill child procs on pid kill
Co-Authored-By: kiyon <kiyonlin@163.com>
2020-07-14 02:36:22 +02:00
Fenny
fe826a782d 👶 Close child procs when PID gets killed 2020-07-14 02:35:35 +02:00
Fenny
80cd53d32f 🗃 Update for golint 2020-07-13 15:43:30 +02:00
songjiayang
4ef6f9b0e1 Update for golint 2020-07-13 10:47:14 +08:00
kiyon
7881df4b8c 👷 Change global variables into const 2020-07-12 07:22:55 +08:00
kiyon
ee4ffddb90 💌 replace prefork child flag with prefork child env 2020-07-11 08:30:03 +08:00
Fenny
0fd57d134d 📦 Detect Child process
Co-Authored-By: kiyon <kiyonlin@163.com>
Co-Authored-By: Nathaniel Peiffer <nathaniel@peiffer.com.au>
2020-07-10 11:43:08 +02:00
Fenny
5df26c4647 📦 Detect Child process
Co-Authored-By: kiyon <kiyonlin@163.com>
2020-07-10 11:16:53 +02:00
Fenny
9b630585c4 📃 Fix typo 2020-07-06 17:10:31 +02:00
doingodswork
081a44323d Fix build breaking with Go 1.11
strings.ReplaceAll is only supported in Go 1.12 and newer.
2020-07-04 18:42:52 +02:00
doingodswork
a092d0d40a Improve flag handling
1. Don't define the prefork flag
2. Don't expose the prefork-child flag in the flag usage message
2020-07-04 16:17:27 +02:00
Fenny
af474e28bb Localize reuseport logic 2020-07-03 15:16:11 +02:00