Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justlorain/viper-nacos-config-example
Convention over Configuration
https://github.com/justlorain/viper-nacos-config-example
configuration example golang nacos viper
Last synced: 27 days ago
JSON representation
Convention over Configuration
- Host: GitHub
- URL: https://github.com/justlorain/viper-nacos-config-example
- Owner: justlorain
- License: apache-2.0
- Created: 2023-01-29T13:53:18.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-01T17:20:31.000Z (over 1 year ago)
- Last Synced: 2024-11-11T17:47:51.531Z (3 months ago)
- Topics: configuration, example, golang, nacos, viper
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Viper Nacos Config Example
> Convention over Configuration
An out-of-the-box example of using [Nacos](https://github.com/alibaba/nacos) configuration management with [Viper](https://github.com/spf13/viper).
## Quick Start
[中文](https://juejin.cn/post/7194335882232397882)
### Remote
[example](./remote)
#### Start Nacos
```shell
docker-compose up
```#### Config Nacos
Visit `127.0.0.1:8848/nacos` on Browser.
The default username and password is `nacos`.
Add MySQL configuration
- Data ID: `example-remote`
- Group: `example-remote````yaml
mysql:
host: 127.0.0.1
port: 3306
username: root
password: 114514
database: example-remote
```#### Run
```shell
cd remote
go run .
```### Local
[example](./local)
#### Start Nacos
```shell
docker-compose up
```#### Run
```shell
cd local
go run .
```#### Visit Nacos
Visit `127.0.0.1:8848/nacos` on Browser.
The default username and password is `nacos`.
## End
Just an Example