go-api-template

module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: GPL-3.0

README

Go Api Template

Template for building a REST API in Go with a clean architecture, configuration management, logging, and observability.

##So far

  • Create a simple HTTP server that listens for incoming requests and responds with a message.

##TODO - Next

  • Finish configuration management (authorization)

How to Manage Go Version on Linux

Install goenv

Step 1: Install dependencies

sudo apt update
sudo apt install -y git build-essential

Step 2: Clone goenv

git clone https://github.com/go-nv/goenv.git ~/.goenv

Step 3: Add it to your shell

Add the following to ~/.bashrc or ~/.zshrc:

export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$PATH"
eval "$(goenv init -)"

Reload the shell:

source ~/.bashrc
Using goenv

List available Go versions

goenv install -l

Example output:

1.20.14
1.21.11
1.22.6
1.23.3

Install a version

goenv install 1.22.6

Set global version

goenv global 1.22.6
goenv rehash

Check the version:

go version

Set version per project

Inside your project directory:

goenv local 1.22.6

This creates a .go-version file in your project.

Directories

Path Synopsis
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
http
Package repository contains data access layer
Package repository contains data access layer
Package services contains business logic and service layer
Package services contains business logic and service layer

Jump to

Keyboard shortcuts

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