Sha256: 7518b8047b275a70d463655f80689ef2501b9d77e55a0e3d1a7ee2dbe5a9841b

Contents?: true

Size: 1.45 KB

Versions: 36

Compression:

Stored size: 1.45 KB

Contents

HaveAPI Client Generator For Go
-------------------------------
HaveAPI-Go-Client generates a client library for accessing selected APIs built
with the [HaveAPI framework](https://github.com/vpsfreecz/haveapi).

## Installation

    $ gem install 'haveapi-go-client'

## CLI
The generator is run against an API server that the resulting client should be
able to work with. The generated client uses one selected API version. When
the API server changes, the client has to be regenerated.

```
$ haveapi-go-client -h
Usage: haveapi-go-client [options] <api url> <destination>
        --version VERSION            Use specified API version
        --module MODULE              Name of the generated Go module
        --package PKG                Name of the generated Go package
```

For example:

```
$ haveapi-go-client https://api.vpsfree.cz ~/go/src/foo/client
```

## Usage
The generated library can then be imported in your projects. For example,
in a project with the following `go.mod`:

```
module foo
```

The client could be imported and used as:

```go
package main

import (
	"fmt"
	"foo/client"
)

func main() {
	api := client.New("https://api.vpsfree.cz")
	api.SetBasicAuthentication("admin", "secret")

	action := api.Cluster.PublicStats.Prepare()
	resp, err := action.Call()

	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Printf("%+v\n", resp)
	fmt.Printf("%+v\n", resp.Response)
	fmt.Printf("%+v\n", resp.Response.Cluster)
	fmt.Printf("%+v\n", resp.Output)
}
```

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
haveapi-go-client-0.25.0 README.md
haveapi-go-client-0.24.0 README.md
haveapi-go-client-0.23.7 README.md
haveapi-go-client-0.23.6 README.md
haveapi-go-client-0.23.5 README.md
haveapi-go-client-0.23.4 README.md
haveapi-go-client-0.23.3 README.md
haveapi-go-client-0.23.2 README.md
haveapi-go-client-0.23.1 README.md
haveapi-go-client-0.23.0 README.md
haveapi-go-client-0.22.1 README.md
haveapi-go-client-0.22.0 README.md
haveapi-go-client-0.21.1 README.md
haveapi-go-client-0.21.0 README.md
haveapi-go-client-0.20.0 README.md
haveapi-go-client-0.19.3 README.md
haveapi-go-client-0.19.2 README.md
haveapi-go-client-0.19.1 README.md
haveapi-go-client-0.19.0 README.md
haveapi-go-client-0.18.2 README.md