1 package acp 2 3 import ( 4 "context" 5 "time" 6 ) 7 8 // EnvoyFetcherResponse is a simple response struct for an envoyFetcher. 9 // 10 // XXX I'm a little torn about this -- should we just return a net/http Response? 11 // That looks like it's not necessarily easy to synthesize, though, so let's 12 // just keep it simple. 13 type EnvoyFetcherResponse struct { 14 StatusCode int 15 Text []byte 16 } 17 18 // timeFetcher is a function that returns the current time. We use time.Now 19 // unless overridden for testing. 20 type timeFetcher func() time.Time 21 22 // envoyFetcher is a function that returns Envoy's stats. We supply a default 23 // envoyFetcher, but it can be overridden (usually for testing). 24 type envoyFetcher func(ctx context.Context) (*EnvoyFetcherResponse, error) 25