gohan

package module
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 7 Imported by: 0

README ¶

Gohan Banner

LTS Npm Commit License Go Reference

About Gohan

Gohan is a flexible, high-performance web framework designed for Go developers who value speed, architectural consistency, and seamless end-to-end development. Built to support both API-only microservices and full-stack applications, Gohan bridges the gap between robust backend craftsmanship and modern user interfaces.

Currently, Gohan provides an out-of-the-box full-stack workflow powered by a lightweight Go core, RESTful API architecture, Vue 3, Tailwind CSS, and TanStack Query. By eliminating repetitive boilerplate, automated routing setups, and complex state synchronization, Gohan empowers developers to scaffold, build, and deploy production-ready applications in minutes.

🚀 Built for Today, Ready for Tomorrow

Gohan is designed with a modular, protocol-agnostic mindset. While currently optimized for REST APIs and Vue 3, the ecosystem is actively evolving to support a broader set of technologies, including:

  • Protocols & APIs: gRPC and GraphQL support for high-throughput and dynamic data fetching.
  • Frontend Ecosystem: Multi-frontend CLI templates, including React integration.

Getting Started

1. Install Go

Follow the official installation guide on the Go Website.

2. Install Node.js & NPM

Follow the official installation guide on the Node.

3. Install Gohan CLI

Install the latest LTS release:

go install github.com/farkhanisturkia/gohan/cmd/gohan@v1.9.2

A command-line tool gohan will be built into $GOPATH/bin/.

4. Basic CLI Usage

Check available commands and options:

gohan -h

Check installed Gohan CLI version:

gohan -v

Create a new Gohan project:

gohan init

Documentation ¶

Index ¶

Constants ¶

View Source
const Version = "v1.9.2"

Framework Meta

Variables ¶

View Source
var BindJSON = gohanHttp.BindJSON

HTTP Request & Response

View Source
var CORSMiddleware = gohanHttp.CORSMiddleware
View Source
var CheckPasswordHash = security.CheckPasswordHash
View Source
var FetchJSON = gohanHttp.FetchJSON
View Source
var GenerateJWT = security.GenerateJWT
View Source
var GenerateRandomToken = security.GenerateRandomToken
View Source
var GetClientIP = utils.GetClientIP

Utils

View Source
var GetConn = database.GetConn
View Source
var GetEnv = config.GetEnv
View Source
var HashPassword = security.HashPassword
View Source
var HashToken = security.HashToken
View Source
var InitEnv = config.InitEnv
View Source
var InitMailWorker = mail.InitMailWorker
View Source
var Marshal = gohanHttp.Marshal
View Source
var NewHTTPClient = gohanHttp.NewHTTPClient
View Source
var ParseTokenName = utils.ParseTokenName
View Source
var PostJSON = gohanHttp.PostJSON
View Source
var QueueEmail = mail.QueueEmail
View Source
var Redis *redis.Client

Redis

View Source
var SendEmail = mail.SendEmail

Mail Export

View Source
var SetRoute = gohanHttp.SetRoute
View Source
var TimeoutMiddleware = gohanHttp.TimeoutMiddleware
View Source
var Unmarshal = gohanHttp.Unmarshal
View Source
var ValidateJWT = security.ValidateJWT

Functions ¶

func InitRedis ¶ added in v1.5.7

func InitRedis(host, port, password string)

Types ¶

type DB ¶

type DB = database.DB

Database

type Env ¶

type Env = config.Env

Config

type HTTPClient ¶ added in v1.5.0

type HTTPClient = gohanHttp.HTTPClient

HTTP Client (External API Requests)

type JWTClaims ¶

type JWTClaims = security.JWTClaims

Security

type Pagination ¶ added in v1.5.9

type Pagination = database.Pagination

type RawQuery ¶ added in v1.4.5

type RawQuery = database.RawQuery

type Router ¶

type Router = gohanHttp.Router

HTTP Router & Server

type Tx ¶ added in v1.4.5

type Tx = database.Tx

Directories ¶

Path Synopsis
cmd
gohan command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL