generate

command
v0.9.21 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: Apache-2.0 Imports: 13 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 --api listApis.json --cmd deleteSnapshot
tag:id: missing `doc:"The ID of the snapshot"`

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

Nothing more... nothing less...

TODO

  • Check that the APIName() (Go) matches the command name (JSON).
  • Check that the response (JSON) structs matches the ones in Go.

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