agollo is a golang client for apollo 🚀
Simple chinese
Feature
- Multiple namespace support
- Fail tolerant
- Zero dependency
Dependency
required go 1.9 or later
Installation
go get -u github.com/philchia/agollo
Usage
Start use default app.properties config file
agollo.Start()
Start use given config file path
agollo.StartWithConfFile(name)
Subscribe to updates
events := agollo.WatchUpdate()
changeEvent := <-event
bytes, _ := json.Marshal(changeEvent)
fmt.Println("event:", string(bytes))
Get apollo values
agollo.GetStringValue(Key, defaultValue)
agollo.GetStringValueWithNameSapce(namespace, key, defaultValue)
License
agollo is released under MIT lecense