s3-orchestrator

proxytest

import "github.com/afreidah/s3-orchestrator/internal/proxy/proxytest"

Package proxytest provides cross-package test helpers for the proxy package. Importing it from production code is not supported.

Index

func NewManager

func NewManager(t testing.TB, cfg *proxy.BackendManagerConfig) *proxy.BackendManager

NewManager builds a *proxy.BackendManager from cfg. Kept as a helper so cross-package call sites stay grouped under a single import even though the underlying constructor is a one-liner.

type Workers

Workers bundles every worker plus the drain manager that a test might need to poke after BuildWorkers has wired the manager. The drain manager is also installed on the supplied *proxy.BackendManager via WireDrain so eligibility filters and write-path drain checks see the live drain state, matching what di.WireManager does in production.

type Workers struct {
    Rebalancer             *worker.Rebalancer
    Replicator             *worker.Replicator
    OverReplicationCleaner *worker.OverReplicationCleaner
    CleanupWorker          *worker.CleanupWorker
    PendingReaper          *worker.PendingReaper
    Scrubber               *worker.Scrubber
    Drain                  *drain.Manager
}

func BuildWorkers

func BuildWorkers(mgr *proxy.BackendManager, m core.MetadataStore) *Workers

BuildWorkers constructs every worker (rebalancer, replicator, …) plus the drain manager backed by the supplied metadata store, and wires the drain manager onto mgr. Production code resolves workers through DI; this helper exists so mock-based cross-package tests can construct an equivalent fully-wired set without re-implementing each worker’s narrow ops surface. Callers that only need the wiring side effect (drain.Manager attached to mgr) may ignore the return value.

Generated by gomarkdoc