contractcheck

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 2 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 contractcheck holds what the actions that check a step against a contract, the http action's OpenAPI document and the grpc action's .proto files, share: reading the flags of the contract option, the shape of a violation, and handing the result to the runner and to res.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flag

func Flag(o map[string]any, name, key string, def bool) (bool, error)

Flag returns the boolean key of the option o, named name as the step writes it, such as openapi, or def when it is missing.

func Report

func Report(c *actionrpc.Contract, ret map[string]any, violations []any, matched map[string]any)

Report tells c, for the runner to take as the step's test, the violations a check found and what the contract matched the step to, and puts them in the res of ret, as violations and contract, for the step's own test to read. A nil violations means the step was checked against no contract, and nothing is reported.

func Violation

func Violation(in, message, reason, field string) map[string]any

Violation is one thing a contract does not allow, found in the request or the response as in says, in the shape actionrpc.ContractCheckOf reads.

Types

This section is empty.

Jump to

Keyboard shortcuts

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