testhelpers

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithConfigValue

func WithConfigValue(ctx context.Context, key string, value any) context.Context

func WithConfigValues

func WithConfigValues(ctx context.Context, setValues ...map[string]any) context.Context

Types

type AutoContextClient

type AutoContextClient struct {
	*http.Client
	// contains filtered or unexported fields
}

func (*AutoContextClient) RoundTrip

func (c *AutoContextClient) RoundTrip(r *http.Request) (*http.Response, error)

type ConfigurableTestHandler

type ConfigurableTestHandler struct {
	// contains filtered or unexported fields
}

func NewConfigurableTestHandler

func NewConfigurableTestHandler(h http.Handler) *ConfigurableTestHandler

func (*ConfigurableTestHandler) RegisterConfig

func (t *ConfigurableTestHandler) RegisterConfig(config ...map[string]any) uuid.UUID

func (*ConfigurableTestHandler) ServeHTTP

func (*ConfigurableTestHandler) UseConfig

func (t *ConfigurableTestHandler) UseConfig(r *http.Request, id uuid.UUID) *http.Request

func (*ConfigurableTestHandler) UseConfigValues

func (t *ConfigurableTestHandler) UseConfigValues(r *http.Request, values ...map[string]any) *http.Request

type ConfigurableTestServer

type ConfigurableTestServer struct {
	*httptest.Server
	// contains filtered or unexported fields
}

func NewConfigurableTestServer

func NewConfigurableTestServer(h http.Handler) *ConfigurableTestServer

func (*ConfigurableTestServer) Client

func (*ConfigurableTestServer) RoundTrip

func (t *ConfigurableTestServer) RoundTrip(r *http.Request) (*http.Response, error)

type TestConfigProvider

type TestConfigProvider struct {
	contextx.Contextualizer
	Options []configx.OptionModifier
}

func (*TestConfigProvider) Config

func (*TestConfigProvider) NewProvider

func (t *TestConfigProvider) NewProvider(ctx context.Context, opts ...configx.OptionModifier) (*configx.Provider, error)

Jump to

Keyboard shortcuts

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