New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/bygui86/go-config-hot-reload

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/bygui86/go-config-hot-reload

v0.0.0-20210418090804-40ea80c28fe0
Source
Go
Version published
Created
Source

go-config-hot-reload

Explore configuration hot reloading options in Golang

run

file hot reload

# run application
go run ./file-hot-reload/main.go

# wait some seconds to have the application up and running

# edit config.yaml and change values

# pay attention to logs and notice that configurations are different now! 

consul

# start consul
docker run -d --rm --name=consul -e CONSUL_BIND_INTERFACE=eth0 -p 8500:8500 consul

# insert configs in consul
curl --request PUT \
    --data @./consul-reload/config-1.json \
    http://localhost:8500/v1/kv/samples/app

# run application
go run ./consul-reload/main.go

# wait some seconds to have the application up and running

# change a config
curl --request PUT \
    --data @./consul-reload/config-2.json \
    http://localhost:8500/v1/kv/samples/app

# pay attention to logs and notice that configurations are different now!
  • https://openmymind.net/Golang-Hot-Configuration-Reload/
  • https://medium.com/golangspec/sync-rwmutex-ca6c6c3208a0

consul

harvester

FAQs

Package last updated on 18 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts