cloudcontract

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 17 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 cloudcontract checks requests and answers against Conch Cloud's contract (conch-cloud's contract/openapi.yaml), for the fakes conch's tests put in the control plane's place. The contract is owned by conch-cloud; it is read from a checkout beside this one (or CONCH_CLOUD_CONTRACT), and conch's own CI has none, so a test that finds no contract says so and checks behaviour against its fake alone.

Only the subset of JSON Schema the contract uses is understood. Tests import this package; nothing conch ships does.

Index

Constants

View Source
const Env = "CONCH_CLOUD_CONTRACT"

Env names an openapi.yaml to check against.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spec

type Spec struct {
	Path string
	// contains filtered or unexported fields
}

Spec is a loaded contract.

func Load

func Load(version string) (*Spec, string)

Load is the contract of version (or a later one of the same major), or nil with why it is not there.

func (*Spec) CheckRequest

func (s *Spec) CheckRequest(method, path string, h http.Header, body []byte) []string

checkRequest is every way a request to path breaks the contract.

func (*Spec) CheckResponse

func (s *Spec) CheckResponse(method, path string, status int, h http.Header, body []byte) []string

checkResponse is every way an answer breaks the contract.

func (*Spec) HasPath

func (s *Spec) HasPath(path string) bool

HasPath says whether the contract has path, a template or a real one.

func (*Spec) Version

func (s *Spec) Version() string

Version is the contract's info.version.

Jump to

Keyboard shortcuts

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