contracts

package module
v0.0.0-...-3cf217b Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 1 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 contracts embeds the API and event specifications so Go code can validate itself against them at test time.

The specs are a COPY of the repo-root contracts/ directory, synced by `make contracts-gen`. The copy exists because go:embed cannot reach outside its module root, and because a Docker build stage that copies only shared/ must still be able to build. A CI drift guard fails if the copy diverges from the source, so the duplication cannot rot silently.

contracts/ at the repo root remains the source of truth. Never edit these copies.

Index

Constants

View Source
const (
	AsyncAPIPath = "specs/asyncapi/booking-events.yaml"

	OpenAPICatalog      = "specs/openapi/catalog.yaml"
	OpenAPIAvailability = "specs/openapi/availability.yaml"
	OpenAPIBooking      = "specs/openapi/booking.yaml"
	OpenAPIPayment      = "specs/openapi/payment.yaml"
)

Paths within Specs.

Variables

View Source
var Specs embed.FS

Functions

func OpenAPIPathFor

func OpenAPIPathFor(service string) (string, bool)

OpenAPIPathFor returns the embedded spec path for a service, and whether it has one. Notification has no HTTP contract — it is consumer-only in the slice.

Types

This section is empty.

Directories

Path Synopsis
Package events is the wire form of every event in contracts/asyncapi/booking-events.yaml.
Package events is the wire form of every event in contracts/asyncapi/booking-events.yaml.
openapi
availability
Package availability provides primitives to interact with the openapi HTTP API.
Package availability provides primitives to interact with the openapi HTTP API.
booking
Package booking provides primitives to interact with the openapi HTTP API.
Package booking provides primitives to interact with the openapi HTTP API.
catalog
Package catalog provides primitives to interact with the openapi HTTP API.
Package catalog provides primitives to interact with the openapi HTTP API.
payment
Package payment provides primitives to interact with the openapi HTTP API.
Package payment provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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