
proxytest
Package proxytest provides cross-package test helpers for the proxy package. Importing it from production code is not supported.
Index
- func BuildManager(cfg *proxy.BackendManagerConfig) *proxy.BackendManager
- func NewManager(t testing.TB, cfg *proxy.BackendManagerConfig) *proxy.BackendManager
- type Workers
func BuildManager
BuildManager is NewManager without a testing.TB, for callers that lack one such as an integration TestMain. When cfg omits a prebuilt Runtime, it assembles one from the flat fields, mirroring di.ProvideBackendRuntime.
func NewManager
NewManager builds a *proxy.BackendManager from cfg with the write coordinator, multipart manager, and drain manager built and injected so cross-package tests get a fully-wired manager (including a live drain manager reachable via mgr.Drain()) from a single call.
type Workers
Workers bundles every worker plus the drain manager a test might need to poke. Drain is the manager’s own drain.Manager (built by NewManager), so eligibility filters and write-path drain checks see the same live state the workers do.
func BuildWorkers
BuildWorkers constructs every worker backed by the supplied metadata store. Production code resolves workers through DI; this helper exists so mock-based cross-package tests can construct an equivalent set without re-implementing each worker’s narrow ops surface. Drain is the manager’s own drain.Manager.
Generated by gomarkdoc