Code Monkey home page Code Monkey logo

hivelocity-client-go's Introduction

Hivelocity Go Client

GoDoc Build Status

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

Getting Started

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.

Example Code

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)
	}
}

Internal Development

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.

Generating a fresh client with latest API changes

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.