visionproxytest

package
v0.260723.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MPL-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

func RuleWithService(provider, model string) *typ.Rule

RuleWithService builds a *typ.Rule carrying a rule-level vision proxy service.

func ScenarioExt

func ScenarioExt(provider, model string) map[string]interface{}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL