Documentation
¶
Overview ¶
Package githubgen generates CSF's GitHub protocol client inputs from GitHub's own OpenAPI description: Filter cuts the description down to an allowlist of operations, and Tools writes the MCP tool registrations for the same operations, so the oapi-codegen client and the tools are two projections of one filtered document and cannot drift.
Index ¶
- Variables
- func ClientName(operationID string) string
- func Filter(description []byte, operations []string) ([]byte, error)
- func Operations(filtered []byte) ([]string, error)
- func ReadAllowlist(content []byte) []string
- func ResultSchemaName(operationID string) string
- func ToolName(operationID string) string
- func Tools(filtered []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownOperation = errors.New("githubgen: operation not in the description")
ErrUnknownOperation reports an allowlisted operationId the description does not have.
Functions ¶
func ClientName ¶
ClientName is oapi-codegen's name for an operationId's client method stem: the first letter capitalized, a slash dropped, a dash capitalizing the next letter, issues/create-comment as IssuescreateComment.
func Filter ¶
Filter keeps the allowlisted operations of an OpenAPI 3.0 description, their success responses only, and the components they reach; examples are dropped. An inline JSON success schema is hoisted into components/schemas/<operation>-result so every success type has a name. The output is indented JSON with sorted keys: the same input always yields the same bytes.
func Operations ¶
Operations lists the operationIds a filtered document holds, sorted.
func ReadAllowlist ¶
ReadAllowlist reads one operationId per line; blank lines and # comments are skipped.
func ResultSchemaName ¶
ResultSchemaName is the component an operation's inline success schema is hoisted into.
Types ¶
This section is empty.