This project github.com/hivelocity/hivelocity-client-go/client
is an autogenerated OpenAPI v3 client from our Hosted API Specification.
Hivelocity API Docs: developers.hivelocity.net/docs
If you're just looking to use this client in your project, simply run go get -u github.com/hivelocity/hivelocity-client-go/client
. Then checkout the GoDoc.
Here is an example how to list all available service types.
package main
import (
"context"
"fmt"
"log"
"os"
hv "github.com/hivelocity/hivelocity-client-go/client"
)
func main() {
apiKey := os.Getenv("HIVELOCITY_API_KEY")
if apiKey == "" {
log.Fatalln("Missing environment variable HIVELOCITY_API_KEY")
os.Exit(1)
}
authContext := context.WithValue(context.Background(), hv.ContextAPIKey, hv.APIKey{
Key: apiKey,
})
apiClient := hv.NewAPIClient(hv.NewConfiguration())
serviceTypes, _, err := apiClient.ServiceApi.GetServiceTypeResource(authContext, nil)
if err != nil {
log.Fatalln(err)
os.Exit(1)
}
for _, st := range serviceTypes {
fmt.Printf("service type: %+v\n", st)
}
}
The code in the directory "client" was auto-generated by swagger. Do not change this code, since
changes will be overwritten the next time make client
gets called.
To generate a client, first you need java
, make
, and wget
install. These should be available in your package manager:
# Debian/Ubuntu Linux or WSL
$ sudo apt-get install -y make wget java
# Homebrew (OSX)
$ brew install make wget
$ brew cask install java
After all the dependencies are installed, run the following make command to update the client code from the latest Swagger Specification:
$ make client
To release a version of the client using the current date (i.e: v2020.08.12.1
), run:
$ make release