configuration management using redis
Installation |
Usage |
Todo |
License
minerva is remote config library using redis as configuration management
- go get github.com/AdhityaRamadhanus/minerva
- See examples for more details
package main
import (
"log"
"os"
"time"
"github.com/AdhityaRamadhanus/minerva"
redis "github.com/AdhityaRamadhanus/minerva/redis"
)
func main() {
// Create your service provider, currently only redis is implemented
redisService := redis.NewRedisService(&redis.Options{
Addr: "localhost:6379",
DB: 0,
})
minerva := minerva.New(redisService)
// you can watch any change on the config by calling Watch function
minerva.Watch()
for {
if minerva.Get("is-maintenance") == "true" {
log.Println("Server is in maintenance")
minerva.Close()
os.Exit(0)
}
log.Println("Serving Request")
time.Sleep(1 * time.Second)
}
}
Dynamic prefix key- Bootstrap config value
- CLI to manage configuration
More robust and proper error handling- Add debouncing in getting key value on parsing key event
Add testAdd CI
MIT © [Adhitya Ramadhanus]