contract

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 2 Imported by: ? 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 contract provides protocol contract testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatResult

func FormatResult(c *Contract, r *Result) string

FormatResult formats a verification result.

Types

type Contract

type Contract struct {
	Provider string   `json:"provider"`
	Consumer string   `json:"consumer"`
	Fields   []string `json:"required_fields"`
	Version  string   `json:"version"`
}

Contract represents a protocol contract between provider and consumer.

type Result

type Result struct {
	Compatible bool     `json:"compatible"`
	Missing    []string `json:"missing_fields"`
	Extra      []string `json:"extra_fields"`
}

Result represents a contract verification result.

func Verify

func Verify(provider, consumer []string) *Result

Verify verifies compatibility between provider and consumer fields.

Jump to

Keyboard shortcuts

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