Documentation ¶
Index ¶
Constants ¶
const EnvPrefix = "GSD" //Go Stats D
EnvPrefix is the prefix of the inspected environment variables.
Variables ¶
This section is empty.
Functions ¶
func InitViper ¶
InitViper sets up env var handling for a viper. This must be run on every created sub viper as these settings are not persisted to nested viper instances.
func NopWriteCloser ¶
func NopWriteCloser(w io.Writer) io.WriteCloser
Types ¶
type AlignedTicker ¶
AlignedTicker is a wrapper around time.Ticker will align the time on a specific interval. The first tick will always occur within interval, the caller should explicitly discard this on creation, or not. Instead of firing at: [T+1*interval, T+2*interval, T+3*interval, ...]
It will fire at: r = roundup(T, interval)+offset [r+1*interval, r+interval*2, r+3*interval, ...]
The time.Time sent to the channel is guaranteed to be r+offset+n*interval, rather than the actual time of firing.
func NewAlignedTicker ¶
func NewAlignedTicker(interval, offset time.Duration) *AlignedTicker
func NewAlignedTickerWithContext ¶
func NewAlignedTickerWithContext(ctx context.Context, interval, offset time.Duration) *AlignedTicker
func (*AlignedTicker) Stop ¶
func (at *AlignedTicker) Stop()