go-client

command module
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Avisi Cloud API go-client

Description

This repository contains the Golang client to communicate with the Avisi Cloud Platform API.

Website | Documentation

Installation

To make use of this go-client include it in your go.mod file, e.g.:

go get github.com/avisi-cloud/go-client

Getting Started

Usage

Setting up a client

To create a client that uses a personal access token (PAT) for authentication we first need to create a NewPersonalAccessTokenAuthenticator to which you pass in the PAT, e.g.:

authenticator := acloudapi.NewPersonalAccessTokenAuthenticator(token)

Then we create a ClientOpts object in which you configure the URL of the Avisi Cloud Platform API you want to connect to, e.g.:

clientOpts := acloudapi.ClientOpts{
	APIUrl: "https://example.com",
}

Next, create a NewClient, using the Authenticator and ClientOpts created in the previous steps:

c := acloudapi.NewClient(authenticator, clientOpts)
Example

Full example:

personalAccessToken := os.Getenv("ACLOUD_PAT")
authenticator := acloudapi.NewPersonalAccessTokenAuthenticator(personalAccessToken)
clientOpts := acloudapi.ClientOpts{
	APIUrl: "https://example.com",
}
client := acloudapi.NewClient(authenticator, clientOpts)

createEnvironment := acloudapi.CreateEnvironment{
	Name:        "name",
	Type:        "staging",
	Description: "a description of the environment",
}

org := "organisation-slug"
environment, err := client.CreateEnvironment(context.Background(), createEnvironment, org)

if err != nil {
	return err
}
// environment has been created

License

Apache 2.0 License

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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