Can consul be used to trigger an endpoint URL change and propogate new endpoint to servcies?

Say I am using RDS and my main master goes down and the failover is now master, can consul be used to propagate this change to my microservices?

Is there golang example of how to use consul in this manner somewhere that I can look into?