serverx

command module
v0.0.0-...-2800834 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 2 Imported by: 0

README

serverx

A server template combines multiple basic tools

Atchitecture

Architecture

Integration

How to use this project

  1. Clone the repository
  2. Change the module name to yours
  3. Run service(default use stdout logging)
go run . server

Convention

# Check conventions, can integrate into CICD
python3 scripts/convention/check.py
  • camelCase: file name, folder name
  • PascalCase: json attribute name, db table name, db column name
  • Lines must be less than 99 characters, but its soft limit
  • Never use init(), except for 3rd-party specify
  • Never use fmt.Prinxxx, use log.Debug() instead

Dev environment

  • Linux
  • Code first (not data first)
  • Docker

Directory structure

  • api: API route definition
  • cmd: Command entry point
  • tests: Benchmark and api test with k6
  • docs: Documentation
    • openapi: Document generated from swaggo
  • internal: Go function to not export the main logic
    • boot: Initialization processes
    • common: Shared utility functions
    • controller: The main handler to process business logic
    • gen: Code generated by gormx
    • global: Global variables and instances
      • domain: General domain-level entities like error codes
    • job: Periodic or cron job executables
    • model: GORM models
    • service: Service layer logic
      • exter: External services (e.g., Redis, Loki, database)
      • inter: Internal services (e.g., validators, schedulers)
  • manifest:
    • deploy: Deployment-related files
  • scripts:
    • convention: Convention-checking scripts

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
gen
docs
openapi
Package openapi Code generated by swaggo/swag.
Package openapi Code generated by swaggo/swag.
internal

Jump to

Keyboard shortcuts

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