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 ¶
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 ¶
var Specs embed.FS
Functions ¶
func OpenAPIPathFor ¶
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. |