Documentation
¶
Overview ¶
Package sdkspec is the Go SDK as data: its spec, which osapi sdk spec get prints and the SDK skill is made from, and its checks, which osapi sdk validate runs. It reads the SDK's own description of itself, types.All and client.Services, as osapi agent collector reads gohai.Collectors.
Index ¶
Constants ¶
const ( // KindPackage is a package of pkg/sdk. KindPackage = "package" // KindCall is how a call is made and how it fails. KindCall = "call" // KindService is a service of the client. KindService = "service" )
The kinds of the SDK's spec.
const ( RuleDoc = "doc" RuleValues = "values" RuleExample = "example" RuleClient = "client" )
The rules of Checks.
Variables ¶
var Checks = guide.Checks{ { Rule: RuleDoc, Requires: "Each type, each service and each method of the SDK says what it is.", Fix: "Give the type a doc comment, or the schema or the operation of the spec a description, and run just generate.", }, { Rule: RuleValues, Requires: "Each type for values has at least one value.", Fix: "Give the type constants and list them in its Values.", }, { Rule: RuleExample, Requires: "Each method of the client has an example, which examples/sdk/client runs, but a method that a program calls, which the spec marks x-osapi-program.", Fix: "Add an Example to the method's definition, and run just generate.", }, { Rule: RuleClient, Requires: "Each service that client.Services lists is a field of client.Client, and each of its methods is a method of that field.", Fix: "Run just generate: client.Services and the client come from one run.", }, }
Checks are the rules that osapi sdk validate applies.
Functions ¶
Types ¶
type Problem ¶
type Problem struct {
// Name is the type, the service or the method, such as Hostname.Update.
Name string `json:"name"`
// Rule is the rule, from Checks.
Rule string `json:"rule"`
// Message says what is wrong.
Message string `json:"message"`
// Fix is how to fix it, from the check of Rule.
Fix string `json:"fix" table:"-"`
}
Problem is one thing of the SDK that breaks a rule of Checks.