Documentation
¶
Overview ¶
Package visionproxytest provides shared test doubles for the vision proxy plugin, reused both by internal/server/module/visionproxy's own tests and by internal/server tests that need a real Service wired through a visionproxy.VisionProxyProcessor (e.g. handler-ordering regression tests).
Index ¶
Constants ¶
const PNG = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="
PNG is a 1x1 transparent PNG used wherever tests need a real image block.
Variables ¶
This section is empty.
Functions ¶
func NewProcessor ¶
func NewProcessor() *visionproxy.VisionProxyProcessor
NewProcessor builds a visionproxy.VisionProxyProcessor wired to the stub client/resolver above, echoing "<desc> via <model>" for every described image.
func RuleWithService ¶
RuleWithService builds a *typ.Rule carrying a rule-level vision proxy service.
func ScenarioExt ¶
ScenarioExt builds the Extensions map a ScenarioConfig would carry for a scenario-level vision proxy service.
Types ¶
type StubResolver ¶
type StubResolver struct{}
StubResolver implements the processor's (unexported) providerResolver so the configured service is treated as usable.
func (StubResolver) GetProviderByUUID ¶
func (StubResolver) GetProviderByUUID(uuid string) (*typ.Provider, error)
GetProviderByUUID always returns a usable stub provider.
type StubVisionClient ¶
type StubVisionClient struct{ Desc string }
StubVisionClient returns a canned description; implements the processor's (unexported) visionClient interface structurally.
func (StubVisionClient) Describe ¶
func (s StubVisionClient) Describe(_ context.Context, svc *loadbalance.Service, _, _, _ string) (string, error)
Describe echoes the service model so tests can assert WHICH service was used.