contexttest

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package contexttest provides utilities for testing context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockedHandler

type MockedHandler struct {
	MockedHandle func(ctx *context.Context) string
}

MockedHandler is a mocked handler for mocking in testing.

func (*MockedHandler) Handle

func (mh *MockedHandler) Handle(ctx *context.Context) string

Handle implements context.Handler.

type MockedMuxMapper

type MockedMuxMapper struct {
	MockedGetHandler func(name string) (context.Handler, bool)
}

MockedMuxMapper is a mux mapper for mocking in testing.

func (*MockedMuxMapper) GetHandler

func (mmm *MockedMuxMapper) GetHandler(name string) (context.Handler, bool)

GetHandler implements context.MuxMapper.

Jump to

Keyboard shortcuts

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