1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-05 10:20:53 +02:00
go-micro/examples/config/grpc
Qiu Yu b977a51253
Examples: fix grpc config (#2207)
This change fixes grpc config example code which is currently broken.

Several pieces in the change:
- use yaml encoder to read config files
- rename *.yml to *.yaml to fix format (file suffix) for encoder lookup
- replace util/log package with logger as the former one is deprecated
2021-08-12 06:27:04 +01:00
..
client Examples: fix grpc config (#2207) 2021-08-12 06:27:04 +01:00
srv Examples: fix grpc config (#2207) 2021-08-12 06:27:04 +01:00
README.md Add examples 2020-12-26 15:17:20 +00:00

gRPC Config Server

This is an example implementation of a grpc config server

Get Started

Run Server

go run srv/main.go

Run Client

go run client/main.go

Edit Config

Change values in srv/conf/micro.yml

micro:
  name: Micro
  version: 1.0.0
  message: hello

to

micro:
  name: Micro
  version: 1.0.0
  message: hello john

The output from watching config after an edit

2019/04/28 10:57:15 Watch changes: {"message":"hello john","name":"Micro","version":"1.0.0"}