Categorygithub.com/nuvla/api-client-go
modulepackage
0.9.1
Repository: https://github.com/nuvla/api-client-go.git
Documentation: pkg.go.dev

# README

Api Client Library

Repository in development process, do not use in production environments.

This repository contains the library to communicate with Nuvla API Server.

The module provides multiple clients depending on the type of operations you want to perform. The clients are built using the Composition pattern, so that the base client is extended with the specific operations required for the client.

Client NameDescriptionDev. Status
NuvlaClientContains generic HTTP methods implemented.
- Login
- Get
- Post
- Put
- Remove
- Search
This is the base client which is then imported in all the other clients using the Composition pattern
Pre-production
User ClientExtends the above mentioned client and provides utilities to execute operations related (and allowed) to the user. - Add/Remove resource - Get resource - Search resource - LogIn Then it also has wrappers to access the lower level HTTP operations from NuvlaClient for special operations and non-covered resourcesPre-production
NuvlaEdge ClientFollowing the same pattern, creates a client with specific operations NuvlaEdge requires:
- Activate
- Commission
- Telemetry
- GetResources (Retrieves all the accessible resources from NuvlaEdge)
Pre-production
Deployment ClientClient to control Deployment resources and related operationsPre-production
Job ClientClient to control and retrieve Job resources and related operationsPre-production

Usage

Basic usage for generic NuvlaClient:

package main

import (
	"fmt"
	nuvla "github.com/nuvla/api-client-go/"
)

func main() {
	// Create a new client
	client := nuvla.NewNuvlaClient("https://nuvla.io", false, false)

	// Login
	client.LoginApiKeys("api-key", "api-secret")

	// Get a resource
	res, _ := client.Get("nuvlabox/nuvlabox-id")
	fmt.Println("Resource: ", res)
	
	// Post a resource
	client.Post("resource-endpoint", "resource-data")

	// Put a resource
	client.Put("resource-endpoint", "resource-data", "data-to-delete")

	// Remove a resource
	client.Remove("resource-id")
}

Generic usage for NuvlaClient with detailed configuration:

package main

import (
	"fmt"
	nuvla "github.com/nuvla/api-client-go/"
)

func main() {
	// Create a new client
	// Create options using NewSessionOpts method creates them with default values 
	clientOps := nuvla.NewSessionOpts(&nuvla.SessionOpts{})
	client := nuvla.NewNuvlaClientFromOpts(clientOps)
}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewNuvlaCookies creates a new instance of the NuvlaCookies struct.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author