|
2 年之前 | |
---|---|---|
cmd | 2 年之前 | |
config | 2 年之前 | |
deploy | 2 年之前 | |
internal | 2 年之前 | |
pkg | 2 年之前 | |
script | 2 年之前 | |
test | 2 年之前 | |
web | 2 年之前 | |
.gitignore | 2 年之前 | |
LICENSE | 2 年之前 | |
README.md | 2 年之前 | |
README_zh.md | 2 年之前 | |
go.mod | 2 年之前 | |
go.sum | 2 年之前 |
Nunu is an application scaffold based on Golang. Its name comes from the character Nunu in League of Legends, who is a little boy riding on the shoulder of a snowman. Like Nunu, This Project also stands on the shoulders of giants, and it is composed of various third-party libraries, including gin, gorm, wire, viper, zap, golang-jwt, go-redis, testify, sonyflake, go-survey, cobra, etc. These libraries are very popular in the Golang ecosystem, and their combination can help you quickly build an efficient and reliable application.
More...
Low learning cost and customization: Nunu encapsulates some popular libraries that Gopher is most familiar with. You can easily customize your application to meet specific needs.
High performance and scalability: Nunu aims to have high performance and scalability. It uses the latest technology and best practices to ensure that your application can handle high traffic and large amounts of data.
Secure and reliable: Nunu uses stable and reliable third-party libraries to ensure the security and reliability of your application.
Modular and extensible: Nunu is designed to be modular and extensible. You can easily add new features and functionality by using third-party libraries or writing your own modules.
Complete documentation and testing: Nunu has complete documentation and testing. It provides comprehensive documentation and examples to help you get started quickly. It also includes a set of test suites to ensure that your application works as expected.
.
├── cmd
│ └── server
│ ├── wire
│ │ ├── wire.go
│ │ └── wire_gen.go
│ └── main.go
├── config
│ ├── local.yml
│ └── prod.yml
├── internal
│ ├── dao
│ │ ├── dao.go
│ │ └── user.go
│ ├── handler
│ │ ├── handler.go
│ │ └── user.go
│ ├── middleware
│ │ └── cors.go
│ ├── model
│ │ └── user.go
│ ├── provider
│ │ └── provider.go
│ ├── server
│ │ └── http.go
│ └── service
│ ├── service.go
│ └── user.go
├── pkg
│ ├── config
│ │ └── config.go
│ ├── helper
│ │ ├── md5
│ │ │ └── md5.go
│ │ ├── resp
│ │ │ └── resp.go
│ │ ├── sonyflake
│ │ │ └── sonyflake.go
│ │ └── uuid
│ │ └── uuid.go
│ ├── http
│ │ └── http.go
│ └── log
│ └── log.go
├── LICENSE
├── README.md
├── README_zh.md
├── go.mod
└── go.sum
This is the directory structure of a classic Golang project, which includes the following directories:
cmd
: Contains the code for command-line applications, such as main.go
.config
: Contains configuration files, such as config.yaml
.internal
: Contains internal code that is not exposed externally.
dao
: Contains the code for Data Access Objects (DAOs).handler
: Contains the code for HTTP request handlers.middleware
: Contains the code for HTTP middleware.model
: Contains the code for data models.provider
: Contains the code for dependency injection.server
: Contains the code for HTTP servers.service
: Contains the code for business logic.pkg
: Contains reusable code that is exposed externally.
config
: Contains the code for reading configuration files.helper
: Contains the code for helper functions.http
: Contains HTTP-related code.log
: Contains code related to logging.To use Nunu, you need to install the following software on your system:
You can install Nunu using the following command:
go install github.com/go-nunu/nunu@latest
You can create a new Golang project using the following command:
nunu new projectName
This command will create a directory named projectName
and generate an elegant Golang project structure within it.
You can create handlers, services, and daos for your project using the following commands:
nunu create handler user
nunu create service user
nunu create dao user
or
nunu create hsd user
These commands will create components named UserHandler
, UserService
, and UserDao
, respectively, and place them in the correct directories.
You can quickly start your project using the following command:
nunu run
This command will start your Golang project and support file update hot reload.
You can quickly compile your wire.go
file using the following command:
nunu wire
This command will compile your wire.go
file and generate the required dependencies.
If you find any issues or have any improvement suggestions, please feel free to raise an issue or submit a pull request. We welcome your contributions!
Nunu is released under the MIT license. See LICENSE for more information.