# README
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
- Go 1.20 or higher.
- Valid KraftCloud authentication credentials. Sign up for the beta!
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.
# Packages
Package certificates manages TLS certificates on KraftCloud.
Package client provides the underlying structures, interfaces and methods for peforming requests against KraftCloud's API.
Package images manages application images on KraftCloud.
Package instances manages instances on KraftCloud.
No description provided by the author
No description provided by the author
No description provided by the author
Package uuid allows inspecting RFC 4122 UUIDs.
No description provided by the author
# Functions
NewAutoscaleClient instantiates a client which interfaces with KraftCloud's autoscale API.
NewCertificatesClient instantiates a client which interfaces with KraftCloud's certificates API.
NewClient is the top-level KraftCloud Services client used to speak with the API.
NewClientFromOptions is the top-level KraftCloud Services client used to speak with the API with pre-defined options.
NewDefaultOptions is a constructor method for instantiation a new set of default options for underlying requests to the KraftCloud API.
NewImagesClient instantiates a new image services client based on the provided options.
NewInstancesClient instantiates a client which interfaces with KraftCloud's instances API.
NewMetrosClient instantiates a client which interfaces with KraftCloud's metros API.
NewServicesClient instantiates a client which interfaces with KraftCloud's volumes API.
NewUsersClient instantiates a client which interfaces with KraftCloud's users API.
NewVolumesClient instantiates a client which interfaces with KraftCloud's volumes API.
WithDefaultMetro sets a KraftCloud metro, e.g.
WithHTTPClient sets the HTTP client that's used to customize the connection to KraftCloud's API.
WithToken sets the access token of the client connecting to KraftCloud.
# Interfaces
KraftCloud are the public endpoint categories for the KraftCloud API.
# Type aliases
Option is an option function used during initialization of a client.