MCPcopy
hub / github.com/SpectoLabs/hoverfly / GetNewHoverfly

Function GetNewHoverfly

core/hoverfly.go:116–133  ·  view source on GitHub ↗

GetNewHoverfly returns a configured ProxyHttpServer and DBClient

(cfg *Configuration, requestCache cache.FastCache, authentication backends.Authentication)

Source from the content-addressed store, hash-verified

114
115// GetNewHoverfly returns a configured ProxyHttpServer and DBClient
116func GetNewHoverfly(cfg *Configuration, requestCache cache.FastCache, authentication backends.Authentication) *Hoverfly {
117 hoverfly := NewHoverfly()
118
119 if cfg.DisableCache {
120 requestCache = nil
121 }
122
123 hoverfly.CacheMatcher = matching.CacheMatcher{
124 RequestCache: requestCache,
125 Webserver: cfg.Webserver,
126 }
127
128 hoverfly.Authentication = authentication
129 hoverfly.HTTP = GetDefaultHoverflyHTTPClient(cfg.TLSVerification, cfg.UpstreamProxy)
130 hoverfly.Cfg = cfg
131
132 return hoverfly
133}
134
135// StartProxy - starts proxy with current configuration, this method is non blocking.
136func (hf *Hoverfly) StartProxy() error {

Callers 2

testToolsFunction · 0.85

Calls 2

NewHoverflyFunction · 0.70

Tested by 1