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: 0

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