gen

command
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 23 Imported by: 0 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

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.

Jump to

Keyboard shortcuts

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