krucible

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FiveHours *int = getIntPointer(5)
View Source
var FourHours *int = getIntPointer(4)
View Source
var OneHour *int = getIntPointer(1)
View Source
var Permanent *int = nil
View Source
var SixHours *int = getIntPointer(6)
View Source
var ThreeHours *int = getIntPointer(3)
View Source
var TwoHours *int = getIntPointer(2)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config ClientConfig) *Client

NewClient creates a new Krucible client with the given connection information.

func (*Client) CreateCluster

func (c *Client) CreateCluster(createConfig CreateClusterConfig) (cluster Cluster, clientset *kubernetes.Clientset, err error)

CreateCluster creates a Krucible cluster with the given configuration. Both a cluster, containing metadata about the created cluster, and a client, configured for connectivity to the cluster, are returned, both of which should be valid providing that the returned error is nil.

func (*Client) DeleteCluster added in v0.1.10

func (c *Client) DeleteCluster(clusterID string) (err error)

DeleteCluster deletes a Krucible cluster with the given ID.

func (*Client) GetCluster

func (c *Client) GetCluster(id string) (result Cluster, err error)

GetCluster fetches metadata about the given Krucible cluster.

func (*Client) GetClusterClientset

func (c *Client) GetClusterClientset(id string) (result *kubernetes.Clientset, err error)

GetClusterClientset returns a set of clients for a given Krucible cluster. These can be used to connect to the cluster as usual.

func (*Client) GetClusterKubeConfig added in v0.1.8

func (c *Client) GetClusterKubeConfig(id string) (result []byte, err error)

GetClusterKubeConfig returns a cluster's kubeconfig as a byte array.

func (*Client) GetClusters added in v0.1.7

func (c *Client) GetClusters() (result []Cluster, err error)

type ClientConfig

type ClientConfig struct {
	BaseURL      string
	AccountID    string
	APIKeyId     string
	APIKeySecret string
}

type Cluster

type Cluster struct {
	ID                string `json:"id"`
	DisplayName       string `json:"displayName"`
	State             string `json:"state"`
	ConnectionDetails struct {
		Server               string `json:"server"`
		CertificateAuthority string `json:"certificateAuthority"`
		ClusterAuthToken     string `json:"clusterAuthToken"`
	} `json:"connectionDetails"`
	CreatedAt time.Time `json:"createdAt"`
	ExpiresAt time.Time `json:"expiresAt"`
}

Cluster contains metadata about a Krucible cluster.

type CreateClusterConfig

type CreateClusterConfig struct {
	DisplayName string `json:"displayName"`

	// DurationInHours is the number of hours the cluster should be available
	// for. If the cluster should run indefinitely then supply a nil pointer,
	// otherwise an integer between 1 and 6 should be provided.
	DurationInHours *int `json:"durationInHours"` // pointer because it could be null
}

Jump to

Keyboard shortcuts

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