Help us shape the future of Go! Take the 2026 Go Developer Survey

plugintest

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package plugintest holds invokePlugins and a contract source for the tests of the chain's entries (ADR-0302, ADR-0303).

Index

Constants

View Source
const BadBody = `{"bad":true}`

BadBody is the body BadAnswer refuses.

View Source
const EmailInput = `` /* 137-byte string literal not displayed */

EmailInput is an input contract with one required email field, the field #1339's email case reads.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadAnswer

type BadAnswer struct{}

BadAnswer refuses, with a 500 problem, an answer whose body is BadBody.

func (BadAnswer) After

func (BadAnswer) Applies

func (BadAnswer) Applies(*invoke.Call) bool

func (BadAnswer) Name

func (BadAnswer) Name() string

type Contract

type Contract struct{ Pair *contractcheck.Pair }

Contract is a contractcheck.Source that serves one compiled contract for every call.

func CompileContract

func CompileContract(t testing.TB, input, output string) Contract

CompileContract compiles an input and an output side with the bounds funcd checks calls with (ADR-0303).

type Peeker

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

Peeker sees every answer at After and reads no body.

func (*Peeker) After

func (*Peeker) Applies

func (*Peeker) Applies(*invoke.Call) bool

func (*Peeker) Name

func (*Peeker) Name() string

func (*Peeker) Seen

func (p *Peeker) Seen() int

Seen is how many answers the peeker saw.

type Recorder

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

Recorder records each call's caller at Before.

func (*Recorder) Applies

func (*Recorder) Applies(*invoke.Call) bool

func (*Recorder) Before

func (r *Recorder) Before(_ context.Context, c *invoke.Call) *invoke.Refusal

func (*Recorder) Callers

func (r *Recorder) Callers() []invoke.Caller

Callers returns the callers recorded so far, in order.

func (*Recorder) Name

func (*Recorder) Name() string

type Refuser

type Refuser struct{}

Refuser refuses every call at Before with a 403 problem.

func (Refuser) Applies

func (Refuser) Applies(*invoke.Call) bool

func (Refuser) Before

func (Refuser) Name

func (Refuser) Name() string

Jump to

Keyboard shortcuts

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