Skip to content

kongsakchai/gotemplate

Repository files navigation

Go Template

Structure

├── app
├── cache
├── config
├── database
├── errs
├── logger
├── middleware
├── migrations
└── validator

app

Application Layer and business logic. It contains the application logic and is organized into subdirectories for business domains or features.

Example

└── app
    ├── user
    └── admin
        ├── admin.go
        └── handler.go

cache

Cache connector, e.g., Redis

config

Configuration files and environment variables

database

Database connector, e.g., MySQL, PostgreSQL

errs

Custom error types and error handling

logger

Logger setup and configuration

middleware

Middleware for request processing, e.g., authentication, logging

validator

Validation logic for request data, e.g., using go-playground/validator

migrations

Migration files .sql for database schema changes, e.g., using kongsakchai/simple-migrate


Usage

Install gonew

go install golang.org/x/tools/cmd/gonew@latest

Create a new project

gonew github.com/kongsakchai/gotemplate github.com/yourname/projectname

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published