Go Web Framework

Overview

Neo

Build Status GoDoc

Go Web Framework

Installation

# framework
go get github.com/ivpusic/neo

# CLI tool
go get github.com/ivpusic/neo/cmd/neo

Documentation

Project Site

API Documentation

Example

Create Neo application:

neo new myapp
cd myapp
package main

import (
    "github.com/ivpusic/neo"
)

func main() {
    app := neo.App()

    app.Get("/", func(ctx *neo.Ctx) (int, error) {
        return 200, ctx.Res.Text("I am Neo Programmer")
    })

    app.Start()
}

Run it:

neo run main.go

License

MIT

You might also like...
An opinionated productive web framework that helps scaling business easier.
An opinionated productive web framework that helps scaling business easier.

appy An opinionated productive web framework that helps scaling business easier, i.e. focus on monolith first, only move to microservices with GRPC la

BANjO is a simple web framework written in Go (golang)

BANjO banjo it's a simple web framework for building simple web applications Install $ go get github.com/nsheremet/banjo Example Usage Simple Web App

beego is an open-source, high-performance web framework for the Go programming language.
beego is an open-source, high-performance web framework for the Go programming language.

Beego Beego is used for rapid development of enterprise application in Go, including RESTful APIs, web apps and backend services. It is inspired by To

High performance, minimalist Go web framework
High performance, minimalist Go web framework

Supported Go versions As of version 4.0.0, Echo is available as a Go module. Therefore a Go version capable of understanding /vN suffixed imports is r

⚡️ Express inspired web framework written in Go
⚡️ Express inspired web framework written in Go

Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development w

Go web framework with a natural feel

Fireball Overview Fireball is a package for Go web applications. The primary goal of this package is to make routing, response writing, and error hand

Gearbox :gear: is a web framework written in Go with a focus on high performance
Gearbox :gear: is a web framework written in Go with a focus on high performance

gearbox ⚙️ is a web framework for building micro services written in Go with a focus on high performance. It's built on fasthttp which is up to 10x fa

Goa is a web framework based on middleware, like koa.js.

Goa Goa is under construction, if you are familiar with koa or go and interested in this project, please join us. What is goa? goa = go + koa Just lik

:golf: The Golf web framework
:golf: The Golf web framework

A fast, simple and lightweight micro-web framework for Go, comes with powerful features and has no dependencies other than the Go Standard Library. Ho

Comments
  • How to wildcard

    How to wildcard "" and "/" for route?

    Now need two func for route "/login" and "/login/"? such as for "/" app.Get("/", func(ctx *neo.Ctx) (int, error) { ... }) i need another func for "": app.Get("", func(ctx *neo.Ctx) (int, error) { ... })

    opened by winds2016 0
  • can you add sub region?

    can you add sub region?

    such as: father := app.Region().Prefix("/login") father.Use(fn Widdleware) son := father.Region().Prefix("/son") (or son := father.Prefix("/son")) //whole is /login/son son.Get("", func(ctx *neo.Ctx) (int, error) { ... })

    opened by winds2016 0
  • git/ivp/neo 11:43:37 ✖[ERRO] ▶ exit status 1

    git/ivp/neo 11:43:37 ✖[ERRO] ▶ exit status 1

    The program does not work properly go version:1.8.3

    package main
    import (
    	"github.com/ivpusic/neo"
    )
    
    func main() {
    	app := neo.App()
    
    	app.Get("/", func(ctx *neo.Ctx) (int, error) {
    		return 200, ctx.Res.Text("I am Neo Programmer")
    	})
    
    	app.Start()
    }
    

    run command:

     [email protected]: neo run sync_token_api.go
     git/ivp/neo 11:43:37 ✖[ERRO] ▶ exit status 1
    
    opened by springeye 0
  • Would a single ctx.Error be better than ctx.Errors?

    Would a single ctx.Error be better than ctx.Errors?

    Hi, I see you add Errors to ctx, but I'm thinking what gin does may not a good idea.

    Basically, when we get an error, we just want to return from route handler. Collecting errors like gin seems doesn't make sense

    Golang's team offered a best practice on their blog about handling errors: Errors are values

    Their solution is: define a single error object in a top level struct ( which should be in ctx in our cases )

    So we can do something like this:

    ctx.Error := SomeFunc()
    // we don't need to deal with error here, a middleware will handle it automatically
    if ctx.Error != nil { return 0, nil}
    

    But with ctx.Errors, I have to write more code:

    err := SomeFunc()
    if err != nil {
        ctx.Error(err)
        return 0, nil
    }
    

    If we handle it with ctx.Errors[0]:

    ctx.Errors := make([]error, 1)
    ctx.Errors[0] := SomeFunc()
    

    In this way, ctx.HasErrors() will always be true even if ctx.Errors[0] is nil

    Following golang team's strategy, with a single ctx.Error, we can even do something like this:

    func SomeFunc(param1, param2, err) error {
        //check error first
        if err != nil {return}
        //do something
    }
    
    func SomeFunc2(param1, param2, err) error {
        if err != nil {return}
        //do something else
    }
    
    
    ctx.Error := SomeFunc(param1, param2, ctx.Error)
    ctx.Error := SomeFunc2(param1, param2, ctx.Error)
    ctx.Error := SomeFunc3(param1, param2, ctx.Error)
    return 200, ctx.Text("done")
    //then, middleware will handle ctx.Error, if there is one.
    

    In this way, we don't need to check ctx.Error at all, since every function has checked that error at beginning, if there is an error, all those functions will just return.

    I think golang team's solution is much better than gin's, a single ctx.Error may truely better than collecting all errors.

    opened by diankong 2
The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework.

jin About The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework. If thi

null 8 Jul 14, 2022
⚡ Rux is an simple and fast web framework. support middleware, compatible http.Handler interface. 简单且快速的 Go web 框架,支持中间件,兼容 http.Handler 接口

Rux Simple and fast web framework for build golang HTTP applications. NOTICE: v1.3.x is not fully compatible with v1.2.x version Fast route match, sup

Gookit 84 Dec 8, 2022
henrylee2cn 1.6k Nov 18, 2022
Roche is a Code Generator and Web Framework, makes web development super concise with Go, CleanArch

It is still under development, so please do not use it. We plan to release v.1.0.0 in the summer. roche is a web framework optimized for microservice

Riita 14 Sep 19, 2022
A powerful go web framework for highly scalable and resource efficient web application

webfr A powerful go web framework for highly scalable and resource efficient web application Installation: go get -u github.com/krishpranav/webfr Exa

Krisna Pranav 13 Nov 28, 2021
A powerful go web framework for highly scalable and resource efficient web application

A powerful go web framework for highly scalable and resource efficient web application

null 22 Oct 3, 2022
A web app built using Go Buffalo web framework

Welcome to Buffalo Thank you for choosing Buffalo for your web development needs. Database Setup It looks like you chose to set up your application us

Mike Okoth 0 Feb 7, 2022
laravel for golang,goal,fullstack framework,api framework

laravel for golang,goal,fullstack framework,api framework

桥边红药 17 Feb 24, 2022
Gin is a HTTP web framework written in Go (Golang).

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Gin-Gonic 64.8k Dec 3, 2022
An ideally refined web framework for Go.

Air An ideally refined web framework for Go. High-performance? Fastest? Almost all web frameworks are using these words to tell people that they are t

Aofei Sheng 420 Nov 23, 2022