goblin

A golang http router based on trie tree. (by bmf-san)

Goblin Alternatives

Similar projects and alternatives to goblin

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better goblin alternative or higher similarity.

goblin reviews and mentions

Posts with mentions or reviews of goblin. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-20.
  • Help wanted about my router allocs
    1 project | /r/golang2 | 12 Jun 2023
  • Implemented a bench marker to compare Go's HTTP Router
    16 projects | dev.to | 20 Dec 2022
    Regarding bmf-san/goblin, we found that it is a proprietary extension of the tri-tree, which is not very optimized and has poor performance compared to other HTTP Routers. (We will do our best to improve it...)
  • Improving the performance of your code starting with Go
    4 projects | dev.to | 9 Dec 2022
    When I decided to improve the performance of goblin, a homebrew HTTP Router, I tried to work on performance improvement in Go, so I write about my approach and the efforts I put into practice.
  • Scratch and mange the my blog
    19 projects | dev.to | 1 Sep 2022
    goblin
  • Release goblin fully compatible with net/http
    1 project | /r/golang | 2 Jul 2022
    goblin is an HTTP router made by golang based on the trie tree.
  • Summary of "Introduction to Golang HTTP router made with net/http"
    4 projects | dev.to | 14 Dec 2021
    From the above code, if you read the net / http code with the following points in mind, you can see what to implement. - Where and how the multiplexer registers handlers, and what are the specifications for matching URLs and patterns? - How to create a handler (whether there is a variation of handler creation, what interface should be satisfied) Details [bmf-tech.com-Chapter 3 HTTP Server Code Reading] (https://bmf-tech.com/posts/net%EF%BC%8Fhttp%E3%81%A7%E3%81%A4 % E3% 81% 8F% E3% 82% 8BHTTP% E3% 83% AB% E3% 83% BC% E3% 82% BF% E3% 83% BC% E8% 87% AA% E4% BD% 9C% E5 % 85% A5% E9% 96% 80 #% E7% AC% AC3% E7% AB% A0HTTP% E3% 82% B5% E3% 83% BC% E3% 83% 90% E3% 83% BC% E3% 81% AE% E3% 82% B3% E3% 83% BC% E3% 83% 89% E3% 83% AA% E3% 83% BC% E3% 83% 87% E3% 82% A3% E3% 83% B3% E3% 82% B0), so please refer to it if you have time. # Implementation As I introduced at the beginning, the HTTP router implemented this time is in the following repository. [bmf-san/introduction-to-golang-http-router-made-with-net-http] (https://github.com/bmf-san/introduction-to-golang-http-router-made-with- net-http /) This time we will implement a simple HTTP router that "supports method-based routing". * Since it is a summary version, detailed explanation of the code is omitted. Method-based routing means that you can register URLs by HTTP method. In the function of Go standard package only, if you want to route by method, you need to implement conditional branching in the handler. `` `go // ex. func indexHandler (w http.ResponseWriter, r * http.Request) { switch r.Method { case http.MethodGet: // do something ... case http.MethodPost: // do something ... ... default: default: `` ``` This time, we will implement it only with the goal of eliminating this trouble. In order to achieve method-based routing, we will adopt a tri-tree-based data structure. Since it is a simple function, a simpler data structure (such as making it possible to use the standard multiplexer function for each method) is fine, but we will adopt it in anticipation of various implementations later. (To be honest, I just simplified the implementation of [bmf-san / goblin] (https://github.com/bmf-san/goblin).) The general things to do in implementing an HTTP router are as follows. - Process to add URL and handler mapping to data structure - https://github.com/bmf-san/introduction-to-golang-http-router-made-with-net-http/blob/main/trie.go#L51 - Process to search for matching data from the mapped data structure (≈ tri-tree-based data structure) - https://github.com/bmf-san/introduction-to-golang-http-router-made-with-net-http/blob/main/trie.go#L93 --Implementation of DSL for registering mapping - Around here https://github.com/bmf-san/introduction-to-golang-http-router-made-with-net-http/blob/main/router.go#L47 - Implementation of function as a multiplexer (≈ implementation of ServeHTTP) - https://github.com/bmf-san/introduction-to-golang-http-router-made-with-net-http/blob/main/router.go#L54 The first thing you want to do to implement is to implement the data structure. ! [tree_for_implementation] (https://user-images.githubusercontent.com/13291041/138551924-ca2e28f5-a0c1-4ae4-ac9f-76d6ee1c46d9.png) It is easier to work if you use the debug function of the editor (using delve in vscode) or write test code to check if it is implemented well. For implementation details, see [bmf-tech.com-Chapter 4 HTTP Router Implementation] (https://bmf-tech.com/posts/net%EF%BC%8Fhttp%E3%81%A7%E3%81] % A4% E3% 81% 8F% E3% 82% 8BHTTP% E3% 83% AB% E3% 83% BC% E3% 82% BF% E3% 83% BC% E8% 87% AA% E4% BD% 9C % E5% 85% A5% E9% 96% 80 #% E7% AC% AC4% E7% AB% A0HTTP% E3% 83% AB% E3% 83% BC% E3% 82% BF% E3% 83% BC% See E3% 81% AE% E5% AE% 9F% E8% A3% 85). # Summary HTTP routers are almost indispensable for creating web applications, and aren't they very much taken care of? My motivation was that I wanted to make something that I used as a matter of course and use it myself. There are already a lot of great HTTP routers out there, so I think one of the real thrills is that it's worth researching. This time I implemented it in Go, but if I understand the mechanism, I think that it can be implemented in languages ​​other than Go. In Go, the interface is provided in a form that makes it easy to extend the function of the standard package, so I felt that it was relatively easy to make by myself. If you are interested in this article, I would be grateful if you could take a look at [bmf-san/goblin] (https://github.com/bmf-san/goblin). Feel free to send an Issue or Pull Request. :D
  • Introduction to Golang HTTP router made with net/http
    1 project | dev.to | 24 Oct 2021
    The author has released an HTTP router package called bmf-san/goblin.
  • A note from our sponsor - SaaSHub
    www.saashub.com | 18 Apr 2024
    SaaSHub helps you find the best software and product alternatives Learn more →

Stats

Basic goblin repo stats
7
75
6.6
7 months ago
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com