Git Product home page Git Product logo
GoFury photo

gofury Goto Github PK

repos: 3.0 gists: 0.0

Name: GoFury

Type: Organization

Bio: Furiously fast and simple Go middleware and chaining for fasthttp - archived now, see https://gofiber.io/ instead

GoFury

Build Status composable, open minded and light weight mvc library. Inspired dropwizard and utron. Usese fasthttp by default but can also switch to standard net/http in the future.

Features

  • Offer a set of reusable libraries similar to excellent gorilla libraries.
  • Designed to be 12factor compliant from the ground up
  • Both server and router are zero memory allocation and byte slice optimised
  • No lock in and non intrusive. Freely compatible with any fasthttp.RequestHandler based code or Middleware
  • Not opinionated about how you structure your business logic

Motivation

For a while I looked for a light weight go mvc library that was intuitive to use like Rails and dropwizard. The closest match I found was utron, which was impressive. But still suffers the same lock-in symptoms as more heavy weight web frameworks such as iris, gin or echo. Having an wrapper layer of utron.Ctx, iris.Context, gin.Context or echo.Context adds an extra layer of custom vendor complexity and straight away throws out any standard net/http or fasthttp compatible middlewares.

I wrote gofury to be a "library and not a "framework". It offers some opinions but does not enforce them. All libraries and interfaces can be replaced with alternatives to suit developer needs. Helpful but with zero lock-in.

func main() {
	app := gofury.BaseApplication{}

	// load configuration
	cfg := &gofury.HTTPConfig{}
	app.LoadConfig(cfg)

	// register services
	app.RegisterServices(createFastHTTPService(cfg, &log.Logger{}), createQueueService())

	// start up application
	app.StartUp()

	// shudown cleanly when application exits
	defer app.ShutDown()
}

Friends

GoFury out of the box forms a composition glue between the following libraries:

  • fasthttp zero mem alloc http server, sensible RequestCtx that is easy to use and test
  • fasthttprouter zero mem alloc router
  • fusion middleware chaining inspired by alice
  • envconfig environment variable based config
  • apex/log simple, handler based structured logging
  • glide for depedency management that makes sense

Testing is made easier with:

Other options libraries:

Build

make test

Sample Project

See examples/example_test.go

Todo

  • db migration
  • metrics and healthcheck
  • standard net/http module

GoFury's Projects

fastjsonapi icon fastjsonapi

fasthttp based jsonapi.org payload serializer and deserializer

fusion icon fusion

RequestHandler and Middleware chaining for fasthttp

gofury icon gofury

fasthttp based api library inspired by dropwizard and utron

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.