GithubHelp home page GithubHelp logo

indigo-web / indigo Goto Github PK

View Code? Open in Web Editor NEW
43.0 1.0 2.0 2.25 MB

Indigo is a blazingly fast web-framework

License: MIT License

Go 99.94% HTML 0.06%
go golang http http-server webserver framework http1 web-framework https blazingly-fast high-performance router routing

indigo's Introduction

This is just a logo

Indigo is a web-framework, designed to be readable, handy, yet performant (blazingly fast I would even say)

Documentation

Documentation is available here. It may be incomplete or not represent the actual state, so make sure the version in documentation corresponds to the latest release.

Hello, world!

package main

import (
	"log"

	"github.com/indigo-web/indigo"
	"github.com/indigo-web/indigo/http"
	"github.com/indigo-web/indigo/router/inbuilt"
)

func HelloWorld(request *http.Request) *http.Response {
	return http.String(request, "Hello, world!")
}

func Log(request *http.Request) *http.Response {
	text, err := request.Body.String()
	if err != nil {
		return http.Error(request, err)
	}

	log.Printf("%s says: %s", request.Remote, text)
	return http.String(request, text)
}

func main() {
	r := inbuilt.New()
	r.Resource("/").
		Get(HelloWorld).
		Post(Log)

	err := indigo.New(":8080").Serve(r)
	if err != nil {
		log.Fatal(err)
	}
}

You can find more examples in examples/.

indigo's People

Contributors

cptidea avatar deepsource-autofix[bot] avatar deepsourcebot avatar flrdv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

flrdv cptidea

indigo's Issues

Memory leaks when opening a large number of connections

To Reproduce

  1. cd examples/helloworld
  2. go run .
  3. wrk -t12 -c900 -d1s http://<yourip>:9090/
  4. Repeat step 3 many times
  5. See the huge amount of occupied memory in the Task Manager

Expected behavior
The memory must be cleared after closing connections

My testing environment

  • Windows 22H2 (go)
  • WSL 2 (wrk)

Rewrite it in C#

First, C# has a more extensive library ecosystem. C# has been around for much longer than Go and as a result, has a much larger and more established library ecosystem. This means that there are more libraries available for C#, which can save developers time and effort when building their applications. The .NET framework, which C# is built on, also provides a wide range of libraries for things like web development, data access, and more.

Second, C# has a stronger type system than Go. C# is a strongly typed language, which means that variables have to be declared with a specific type. This can help prevent errors and make the code more readable. Go, on the other hand, is a loosely typed language, which can lead to more errors and make the code less readable.

Third, C# has better support for object-oriented programming. C# is an object-oriented programming language, which means that it supports concepts like classes, objects, inheritance, and polymorphism. Go, on the other hand, is a procedural language, which means that it does not have native support for these concepts. This can make it more difficult to write large, complex applications in Go.

Fourth, C# has better debugging and development tools. C# has a wide range of debugging and development tools available, such as Visual Studio, which can make it easier to find and fix errors in the code. Go also has some debugging and development tools available, but they are not as advanced or as widely used as those for C#.

Fifth, C# has better performance for certain types of applications. While Go is known for its performance, C# can actually perform better for certain types of applications. For example, C# can perform better for applications that involve a lot of computation or that need to work with large amounts of data.

In conclusion, C# is a better choice than Go for certain types of projects due to its more extensive library ecosystem, stronger type system, better support for object-oriented programming, better debugging and development tools and better performance for certain types of applications. While Go is also a great language and has its own strengths, C# is a more versatile language that can be used to build a wide range of applications.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.