Skip to content

flrdv/indigo

 
 

Repository files navigation

indigo

image

Elegance, conciseness, flexibility and extensibility — that’s what Indigo is about. The goal is to create a mini ecosystem in which you can focus on actual tasks rather than reimplementing the same things over and over again. Everything you need to get started is already included, and whatever isn’t is trivially pluggable.

  • FastHTTP-grade performance
  • Stream-based body processing
  • Fine-tuning of parameters like memory consumption and timeouts
  • A full-fledged built-in router
  • Method chaining at its finest

Documentation

Documentation is available here. It might be incomplete however, feel free to open issues.

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/.

About

Indigo is a blazingly fast web-framework

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%