sdk-go

module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT

README

SDK-GO

This is the Go SDK for Deploifai. It is used to interact with the Deploifai API.

Installation

go get github.com/deploifai/sdk-go

Usage

package main

import (
	"context"
	"github.com/deploifai/sdk-go/config"
	"github.com/deploifai/sdk-go/credentials"
	"github.com/deploifai/sdk-go/service/workspace"
)

func main() {
	// Create a new Credentials instance
	creds := credentials.NewCredentials("<deploifai auth token>")

	// Create a new config with the default config loader, and use the credentials
	cfg, _ := config.LoadDefaultConfig(context.TODO(), config.WithCredentials(creds))

	// Create a new workspace client
	client := workspace.NewFromConfig(cfg)

	// List all workspaces
	_, _ = client.List(context.TODO())
}

Jump to

Keyboard shortcuts

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