Documentation
¶
Overview ¶
Command gen writes the typed services of the Go SDK, pkg/sdk/client, from the full spec of the API, internal/controller/api/gen/api.yaml. For each service, <service>.gen.go has its methods, and <service>_types.gen.go the types only it sends and receives; types.gen.go has the types that more than one service has, and services.gen.go puts each service on the Client. A method sends its request through the SDK's Send, and decodes the answer into the SDK's types: the SDK uses nothing that oapi-codegen writes. just sdk-generate runs it, after go generate writes the spec. It is not a go:generate directive: go generate lists the files of each package before it runs, so a run that removed the file of a group that is gone made go generate fail on that file (osapi-io/osapi#1261).
The same run writes a program for each service whose methods have examples, examples/sdk/client/<service>.go: it calls each method with the input of each example of the method's definition, which the spec has in x-osapi-examples. With -docs, it writes the SDK's reference pages under docs/docs/sidebar/sdk instead, from the same model and the methods of the SDK's source, and the table of services of client.md.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sdkmodel is what the Go SDK is made of, read from the full spec of the API: each service, its methods with their parameters, body and result, and each type the methods send and receive.
|
Package sdkmodel is what the Go SDK is made of, read from the full spec of the API: each service, its methods with their parameters, body and result, and each type the methods send and receive. |