ke

package
v0.0.0-...-908e76c Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

Cluster is an application for managing Kubernetes clusters.

All methods of Cluster returns errors defined in internal/app/errors.go, such as app.ErrNotFound. Or it returns errors as is if unknown.

func NewCluster

func NewCluster(rt runtime, logger *zap.Logger) *Cluster

func (*Cluster) Create

func (c *Cluster) Create(ctx context.Context, cluster *kev1alpha.Cluster) (*kev1alpha.Cluster, error)

Create creates a new cluster.

The unique name of the cluster is generated automatically by the application. The name is returned in the response. If the num_nodes is 0, it is set to 3. If the num_nodes is greater than 5, it returns app.ErrInvalidArgument.

func (*Cluster) Delete

func (c *Cluster) Delete(ctx context.Context, name string) (*empty.Empty, error)

Delete deletes a cluster by name.

If the cluster does not exist, it returns app.ErrNotFound.

func (*Cluster) Get

func (c *Cluster) Get(ctx context.Context, name string) (*kev1alpha.Cluster, error)

Get returns a cluster by name.

func (*Cluster) List

func (c *Cluster) List(ctx context.Context, pageSize int32, page *v1.Pagination) ([]*kev1alpha.Cluster, *v1.Pagination, error)

List returns a list of clusters and next page.

If pageSize is 0 or greater than 30, it is set to 30.

func (*Cluster) Update

func (c *Cluster) Update(ctx context.Context, cluster *kev1alpha.Cluster, mask *fieldmaskpb.FieldMask) (*kev1alpha.Cluster, error)

Update updates a cluster by name.

If the cluster does not exist, it returns app.ErrNotFound. If the mask is invalid, it returns app.ErrInvalidArgument. If the num_nodes is invalid, it returns app.ErrInvalidArgument.

Directories

Path Synopsis
Package mockke is a generated GoMock package.
Package mockke is a generated GoMock package.

Jump to

Keyboard shortcuts

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