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
}

func NewCluster

func NewCluster(client *ent.Client) *Cluster

func (*Cluster) Create

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

Create creates a cluster. If the cluster already exists, it returns infra.ErrAlreadyExists.

func (*Cluster) Delete

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

Delete deletes a cluster by name. If the cluster does not exist, it returns infra.ErrNotFound.

func (*Cluster) Get

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

Get returns a cluster by name. If the cluster does not exist, it returns infra.ErrNotFound.

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 the page is nil, it returns the first page. If next page does not exist, it returns nil.

func (*Cluster) Update

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

Update updates a cluster.

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

Jump to

Keyboard shortcuts

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