generate

command
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

README

Generation tool

Inspired by go-cloudstack, which is entirely generated, this tool aims at finding errors in the implementation of the interfaces. Because naming things are hard, going full code generation seems far fetched at the current times.

Setup

Download the API definition from your CloudStack instance using the famous cs cli tool.

$ cs listApis > listApis.json

Find all errors

Reading the Go code and the JSON description (-apis) it lists the errors per struct.

$ go run generate/main.go -apis listApis.json
...

Find specific error

Then, inspect the errors of a particular command using -cmd

$ go run generate/main.go -apis listApis.json -cmd deleteSnapshot
tag:id: missing `doc:"The ID of the snapshot"`

snapshots.go:97.6: DeleteSnapshot has 1 error(s)

Find errors in response

All commands response may also be checked, but you have to give the expected output type.

go run generate/main.go -apis listApis.json -cmd listApis -type API

Nothing more... nothing less...

TODO

  • Check that the APIName() (Go) matches the command name (JSON).
  • Find the corresponding type for the responses.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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