gsclient

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsClusterCreationError

func IsClusterCreationError(err error) bool

IsClusterCreationError asserts clusterCreationError.

func IsClusterDeletionError

func IsClusterDeletionError(err error) bool

IsClusterDeletionError asserts clusterDeletionError.

func IsClusterNotFoundError

func IsClusterNotFoundError(err error) bool

IsClusterNotFoundError asserts clusterNotFoundError.

Types

type Client

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

func New

func New(config Config) (*Client, error)

func (*Client) CreateCluster

func (c *Client) CreateCluster(ctx context.Context, releaseVersion string) (string, error)

func (*Client) CreateKubeconfig

func (c *Client) CreateKubeconfig(ctx context.Context, clusterID, kubeconfigPath string) error

func (*Client) DeleteCluster

func (c *Client) DeleteCluster(ctx context.Context, clusterID string) error

func (*Client) GetClusterReleaseVersion

func (c *Client) GetClusterReleaseVersion(ctx context.Context, clusterID string) (string, error)

func (*Client) ListClusters

func (c *Client) ListClusters(ctx context.Context) ([]ClusterEntry, error)

type ClusterEntry

type ClusterEntry struct {
	ID             string `json:"id"`
	ReleaseVersion string `json:"release_version"`
}

type Config

type Config struct {
	Logger micrologger.Logger

	Endpoint string
	Password string
	Token    string
	Username string
}

type CreationResponse

type CreationResponse struct {
	ClusterID string `json:"id"`
	Result    string `json:"result"`
}

TODO: Use the gsctl type directly

type DeletionResponse

type DeletionResponse struct {
	ClusterID string `json:"id"`
	Result    string `json:"result"`
	Error     Error  `json:"error,omitempty"`
}

TODO: Use the gsctl type directly

type Error

type Error struct {
	Kind string `json:"kind"`
}

Jump to

Keyboard shortcuts

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