Documentation
¶
Overview ¶
Package client resolves schemas over HTTP, for the case a service meets an identifier it does not hold.
That case is the rare one by design. A service embeds its schemas and validates without a network call; this is the fallback, and a schema.Guard in front of it fails open when it cannot reach the registry. A service that must reach the registry to validate has taken a runtime dependency on it, which is what a registry should most avoid being.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client resolves schemas from a registry over HTTP. It implements schema.Resolver.
func (*Client) Resolve ¶
Resolve fetches a schema by identifier.
A 404 becomes schema.ErrNotFound so that a caller can tell "the registry says no such schema" from "the registry did not answer" — the first is a fact, the second is an outage, and a guard counts them the same way but an operator should not.
func (*Client) Timeout ¶
Timeout reports the deadline this client applies to a resolution.
Exported so the bound can be asserted. A test that only checks "an unreachable host returns an error" passes with a two-second timeout, a two-hour one, or none at all, which makes the documented bound unasserted exactly where it matters.