rk-boot icon indicating copy to clipboard operation
rk-boot copied to clipboard

Support fiber and question

Open xushuhui opened this issue 3 years ago • 3 comments

I like fiber https://github.com/gofiber/fiber , It is fast and simple than gin or echo Will you support fiber in rk-boot ? If your not I want try do it I have two question

  1. I found few unuse dependencies in rk-boot . for example, I only use gin build a slight and simple micro-service , rk-boot add echo package . I dont need it , How do you solve it ? I want my application slight
  2. How do I contribute code if I develop such as rk-fiber ? What I should follow rules

xushuhui avatar Dec 08 '21 05:12 xushuhui

@xushuhui Thanks for interested in rk-boot.

Q1: Will you support fiber in rk-boot ? A: The answer is YES, in the roadmap of rk-boot, supporting more popular web framework is one of our important goal. Currently, it support gRPC, Gin, Echo and GoFrame. And GoFrame is the one that contributor of rk-boot suggested to support. It would be awesome if you can contribute rk-fiber as child dependency of rk-boot.

Q2: I found few unuse dependencies in rk-boot . for example, I only use gin build a slight and simple micro-service , rk-boot add echo package . I dont need it , How do you solve it ? I want my application slight. A: Honestly, we thought about the potential problem. In the current version of rk-boot, it needs external dependencies of gRPC, Gin, Echo and GoFrame because of functions listed bellow in boot.go. It did nothing logically, but provide an easy way to retrieve an Entry with supported web framework type.

  • func (boot *Boot) GetGrpcEntry(name string) *rkgrpc.GrpcEntry
  • func (boot *Boot) GetEchoEntry(name string) *rkecho.EchoEntry
  • func (boot *Boot) GetGfEntry(name string) *rkgf.GfEntry
  • func (boot *Boot) GetPromEntry(name string) *rkprom.PromEntry

rk-boot doesn't need external dependencies If we remove those functions from boot.go. As a result, if one user hope to use Gin as underlying web framework, she/he needs to [go get github.com/rookie-ninja/rk-gin] and convert Entry interface to GinEntry by themselves which sounds not a bad idea although. So my answer to this question is [YES, rk-boot can do it]. I will review the potential risk of it and try to make a change.

Q3: How do I contribute code if I develop such as rk-fiber ? What I should follow rules A: I will create an empty package of rk-fiber in rookie-ninja organizations. Then you can fork & pull to rk-fiber as soon as the code is ready. If you have any questions about implementing rk-fiber, please feel free to contact us via github or our slack channel for rk-boot.

  • Slack Channel for rk-boot: https://rk-syz1767.slack.com/archives/C028N7PBFT7

In the meantime, This documentation would be a nice start while implementing rk-fiber.

Thanks

dongxuny avatar Dec 08 '21 09:12 dongxuny

@xushuhui Here is the new package of rk-fiber, please feel free to fork and pull requests as needed.

https://github.com/rookie-ninja/rk-fiber

dongxuny avatar Dec 08 '21 09:12 dongxuny

It is great that rk-boot will support most popular web framework. gRPC, Gin, Echo and GoFrame and so on. If support 10 web framework , it means user only choose 1 of 10 and 9 is unuse . 10 include similar route/middleware/context . I dont think is good idea . as a Go web developer , I cant find benefit use 2 or more web framework in a application or micro-service .
I will be criticized boss in Code Review if I do this.

In my opinion, rk-boot should design / build rules or standard . Give users chance that choose any web framework and improve them application .The detailed Document Guild help new User. Trust users can do it Thanks

xushuhui avatar Dec 08 '21 14:12 xushuhui