GoTuna - Web framework for Go

Overview

PkgGoDev Tests Status Go Report Card Go Report Card

GoTuna - Web framework for Go

Please visit https://gotuna.org for the latest documentation, examples, and more.

Features

  • Router (gorilla)
  • Standard http.Handler interface
  • Middleware support
  • User session management (gorilla)
  • Session flash messages
  • Native view rendering (html/template) with helpers
  • Static file server included with the configurable prefix
  • Standard logger interface
  • Request logging and panic recovery
  • Full support for embedded templates and static files
  • User authentication (via user provider interface)
  • Sample InMemory user provider included
  • Multi-language support
  • Database agnostic

Requirements

  • Make sure you have Go >= 1.16 installed

Testing

go test -race -v ./...

Running examples

go run examples/fullapp/cmd/main.go

External dependencies

External modules are mostly used when the feature is too complex to build or maintain - Router, Secure cookies

TODO

  • Validation (input/forms)
  • Cache

Licence

This project is licensed under the MIT License.

Issues
  • [suggest] For go mod package management

    [suggest] For go mod package management

    When I see that your web framework is based on 'github.com/gorilla' encapsulation, and when users use it, they call the 'github.com/gorilla' package to create 'Router', I think we can let "gotuna" call "github.com/gorilla"," user call "gotuna" create of user need function or struct, and then manage the version of the package by the 'gotuna'; for the user, only need to confirm the version of the package.

    My English is not good, this is through translation.

    ---------中文---------- 我看到你这个web框架都是基于 "github.com/gorilla"的封装,在用户使用时,还会调用"github.com/gorilla" 的包来创建"Router",对此我认为可以让"gotuna" 来封装用户对 "github.com/gorilla" 调用,让用户调用 "gotuna"来满足需要的功能; 其中的至少有一个优点: 由"gotuna" 统一管理"github.com/gorilla" 包的版本;对用户而言只需要确认"gotuna" 的版本。 减少用户mod 依赖,减少用户管理负担。

    opened by ywanbing 4
  • app.Router.Vars undefined

    app.Router.Vars undefined

    package main
    
    import (
    	"fmt"
    	"net/http"
    	"os"
    
    	"github.com/gotuna/gotuna"
    )
    func handlerParams(app gotuna.App) http.Handler {
    	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		 fmt.Fprintf(w,   app.Router.Vars(r))
    
    	})
    }
    func main() {
    	app := gotuna.App{
    		ViewFiles: os.DirFS("."),
    		Router:    gotuna.NewMuxRouter(),
    	}
    	app.Router.Handle("/books/{title}", handlerParams(app))
    
    	http.ListenAndServe(":8888", app.Router)
    }
    
     
    
    

    as gorilla route

    package main
    
    import (
        "fmt"
        "net/http"
    
        "github.com/gorilla/mux"
    )
    
    func main() {
        r := mux.NewRouter()
    
        r.HandleFunc("/books/{title}/page/{page}", func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
            title := vars["title"]
            page := vars["page"]
    
            fmt.Fprintf(w, "You've requested the book: %s on page %s\n", title, page)
        })
    
        http.ListenAndServe(":80", r)
    }
    
    opened by tablecell 2
Releases(v0.6.0)
Owner
GoTuna
Web framework for Go
GoTuna
Golanger Web Framework is a lightweight framework for writing web applications in Go.

/* Copyright 2013 Golanger.com. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except

golanger 299 Mar 3, 2022
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 Dec 27, 2021
⚡ 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 77 Apr 16, 2022
henrylee2cn 1.6k Jun 26, 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 15 May 21, 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 21 May 25, 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 60.5k Jun 25, 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 414 Jun 15, 2022
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

appist 120 Jun 2, 2022
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

Nazarii Sheremet 19 Jan 24, 2022
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

astaxie 479 Jun 20, 2022
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

LabStack LLC 22.7k Jun 24, 2022
⚡️ 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

Fiber 20.7k Jun 27, 2022
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

Zack Patrick 57 Mar 26, 2022
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

Gearbox 645 Jun 21, 2022
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

null 46 May 17, 2022