core-starter

command module
v0.0.0-...-3b4d16e Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 4 Imported by: 0

README

CoreStarter

DoNewsCode/core is a service container that elegantly bootstrap and coordinate twelve-factor apps in Go. This is a starter template using the DoNewsCode/core framework.

Go Report Card Core Release

Usage

  • 0x01: Generate

You can use the fx command to quickly create a project.

fx create helloworld

Or

When you use Git to generate a project, you need to modify the package name of the project yourself.

git clone https://github.com/DoNewsCode/core-starter.git helloworld
  • 0x02: Config

When you use go run main.go to run the project, the starter uses config.yaml by default. You can use the --config parameter to specify the config file, or use the following command to generate:

cp config.example.yaml config.yaml

When you add other modules, you can use the go run main.go config init -o config.example.yaml re-build the sample config file.

  • 0x03: Happy to coding.

You will see the following directory structure.

├── app
│   ├── commands
│   │   └── example.go
│   └── module.go               # App module
├── docs
│   ├── docsify                 # Docsify: {hostname:port}/docs/docsify
│   ├── swagger                 # Swagger Api: {hostname:port}/docs/swagger
│   └── module.go               # Docs module
├── internal
│   └── bootstrap
│       ├── bootstrap.go
│       ├── bootstrap_test.go
│       ├── root.go
│       ├── option.go
│       └── register.go         # Register global module or dependency
├── .gitignore
├── config.example.yaml         # config example file
├── config.yaml                 # config file
├── go.mod
├── go.sum
├── main.go
└── readme.md

Examples of using other frameworks

Gin

Go Kit

Kratos

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app
internal

Jump to

Keyboard shortcuts

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