mailgun / gubernator

High Performance Rate Limiting MicroService and Library
Apache License 2.0
964 stars 99 forks source link

Simplify SetupDaemonConfig API #217

Open miparnisari opened 9 months ago

miparnisari commented 9 months ago

This function really really shouldn't accept a concrete instance of a logrus.Logger. This should be an interface and, if consumers want, they can pass their own implementation (or a NoOpLogger)

Something else I noticed: it is really really easy for consumers of this project to simply do gubernator.SpawnDaemon(ctx, DaemonConfig{GRPCListenAddress: "localhost:8111"}) - this will set all other configs to their zero values! 😱

_Originally posted by @miparnisari in https://github.com/mailgun/gubernator/pull/214#discussion_r1461316114_