contract

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 8 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

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigRequired = errors.New("config is required")

Functions

This section is empty.

Types

type ArazzoConfig

type ArazzoConfig struct {
	Doc       string   `yaml:"doc" json:"doc"`
	Workflows []string `yaml:"workflows,omitempty" json:"workflows,omitempty"` // empty = all
}

ArazzoConfig specifies Arazzo workflow run.

type ArazzoResult

type ArazzoResult struct {
	Workflows []WorkflowResult `json:"workflows"`
	Passed    int              `json:"passed"`
	Total     int              `json:"total"`
}

ArazzoResult is the result of Arazzo workflow runs.

type Config

type Config struct {
	OpenAPI  *OpenAPIConfig `yaml:"openapi,omitempty" json:"openapi,omitempty"`
	Arazzo   *ArazzoConfig  `yaml:"arazzo,omitempty" json:"arazzo,omitempty"`
	BaseURL  string         `yaml:"baseUrl,omitempty" json:"baseUrl,omitempty"`
	ProxyURL string         `yaml:"proxyUrl,omitempty" json:"proxyUrl,omitempty"`
	Output   string         `yaml:"output,omitempty" json:"output,omitempty"` // human, junit, json
}

Config is the barometer config file (e.g. barometer.yaml).

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig reads a config file from path.

type OpenAPIConfig

type OpenAPIConfig struct {
	Spec string   `yaml:"spec" json:"spec"`
	Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
}

OpenAPIConfig specifies OpenAPI contract test run.

type OpenAPIResult

type OpenAPIResult struct {
	Results []openapi.ContractResult `json:"results"`
	Passed  int                      `json:"passed"`
	Total   int                      `json:"total"`
}

OpenAPIResult is the result of OpenAPI contract tests.

type Result

type Result struct {
	OpenAPI *OpenAPIResult `json:"openapi,omitempty"`
	Arazzo  *ArazzoResult  `json:"arazzo,omitempty"`
	Pass    bool           `json:"pass"`
}

Result holds the combined result of a contract test run (OpenAPI + Arazzo).

func Run

func Run(ctx context.Context, cfg *Config, client *runner.Client) (*Result, error)

Run executes contract tests and/or Arazzo workflows from config.

type WorkflowResult

type WorkflowResult struct {
	WorkflowID string         `json:"workflowId"`
	Pass       bool           `json:"pass"`
	Error      string         `json:"error,omitempty"`
	Outputs    map[string]any `json:"outputs,omitempty"`
}

WorkflowResult is the result of one workflow run.

Jump to

Keyboard shortcuts

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