MCPcopy Index your code
hub / github.com/keploy/keploy / SetMocksWithWindow

Method SetMocksWithWindow

pkg/agent/proxy/proxy.go:2733–2739  ·  view source on GitHub ↗

SetMocksWithWindow atomically updates mocks AND the test window in a single call so concurrent readers cannot observe a torn (newMocks, oldWindow) view. Used to satisfy the WindowedProxy extension interface.

(_ context.Context, filtered, unFiltered []*models.Mock, start, end time.Time)

Source from the content-addressed store, hash-verified

2731// single call so concurrent readers cannot observe a torn (newMocks,
2732// oldWindow) view. Used to satisfy the WindowedProxy extension interface.
2733func (p *Proxy) SetMocksWithWindow(_ context.Context, filtered, unFiltered []*models.Mock, start, end time.Time) error {
2734 if m := p.getMockManager(); m != nil {
2735 m.SetMocksWithWindow(filtered, unFiltered, start, end)
2736 p.dnsCache.Purge()
2737 }
2738 return nil
2739}
2740
2741// FirstTestWindowStart returns the earliest test window start observed
2742// by the underlying MockManager, or zero before any non-BaseTime

Callers

nothing calls this directly

Implementers 1

Proxypkg/agent/proxy/proxy.go

Calls 2

getMockManagerMethod · 0.95
SetMocksWithWindowMethod · 0.65

Tested by

no test coverage detected