Documentation
¶
Overview ¶
Package discovery reads Google's Discovery Document — the format they publish for their own REST APIs, and which no OpenAPI parser understands.
It is worth a dialect of its own because it is not one API: Google serves a discovery document for over three hundred services — Drive, Sheets, Calendar, Gmail, YouTube, Search Console, Analytics — all at a predictable address, all in the same shape. Written once, every one of them becomes reachable without a line of code per API.
What it is NOT good for: an API whose surface is huge. Drive has 64 methods, YouTube 83, Gmail 79 — publishing them whole gives a model dozens of tools it will never call, and a wrong option to pick among them. Use `--include-paths` to say what this connector is actually for.
Index ¶
Constants ¶
const DefaultDepth = 2
DefaultDepth is how far `$ref` chains are followed. Two levels covers the shape of a request (its fields, and the fields of the objects it holds) without dragging in the whole type graph.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
BaseURL string // beats the document's own baseUrl
Auth auth.Applier
Client *http.Client
IncludePaths []*regexp.Regexp
ExcludePaths []*regexp.Regexp
IncludeMethods []string
ExcludeMethods []string
Headers map[string]string
Depth int // how far $ref chains are expanded; see DefaultDepth
}
Options are decisions made by whoever starts the server, not by the document.