Viper Nacos Config Example
Convention over Configuration
An out-of-the-box example of using Nacos configuration management with Viper.
Quick Start
中文
Remote
example
Start Nacos
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
mysql:
host: 127.0.0.1
port: 3306
username: root
password: 114514
database: example-remote
Run
cd remote
go run .
Local
example
Start Nacos
docker-compose up
Run
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