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 BuildManager

func BuildManager(cfg *proxy.BackendManagerConfig) *proxy.BackendManager

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

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

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.

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 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