Skip to content

kraftcloud/go-sdk

Repository files navigation

KraftCloud Go SDK

This SDK is an early version of a Go-based client designed to interface with the KraftCloud API.

📖 Documentation

For a comprehensive list of all API endpoints and detailed usage, refer to the official KraftCloud documentation.

Requirements

Quick start

package main

import (
	"fmt"
	"context"

	kraftcloud "sdk.kraft.cloud"
)

func main() {
	client := kraftcloud.NewClient(
		kraftcloud.WithToken("token"),
	)

	images, err := client.Images().List(context.Background())
	if err != nil {
		fmt.Printf("failed: %v", err)
		return
	}

	for _, i := range images {
		fmt.Println(i.Digest)
	}
}

Examples

For additional practical implementations, check out the examples directory:

This example lists all images in your project

Here, you'll learn how to create an instance and display its console output. Subsequent actions include stopping and starting the instance, listing all instances in the project, and, ultimately, deleting the created instance.