clusters

package
v0.0.0-...-389ea72 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ClusterPrefix = "Cluster"

Variables

This section is empty.

Functions

func DeepEqual

func DeepEqual(x *Cluster, y *Cluster) bool

func Equal

func Equal(x *Cluster, y *Cluster) bool

func GetClusterKey

func GetClusterKey(clusterid string, poolname string) string

func GetClusterPoolKey

func GetClusterPoolKey(poolname string) string

Types

type Cluster

type Cluster struct {
	ClusterID     string       `json:"ClusterID"`
	PoolName      string       `json:"PoolName"`
	State         ClusterState `json:"State"`
	URL           string       `json:"URL"`
	AdminUser     string       `json:"AdminUser"`
	AdminPassword string       `json:"AdminPassword"`
	CAFile        []string     `json:"CAFile"`
	CertFile      []string     `json:"CertFile"`
	KeyFile       []string     `json:"KeyFile"`
	ExtraInfo     string       `json:"ExtraInfo"`
	CreatedOn     time.Time    `json:"CreatedOn"`
	ActivatedOn   time.Time    `json:"ActivatedOn"`
}

func ClusterByID

func ClusterByID(ctx *generic.Context, poolName string, clusterid string) (*Cluster, error)

ClusterByID gets a Items in a pool with specified ID

func NewCluster

func NewCluster(clusterid string, poolName string) *Cluster

func NewEmptyCluster

func NewEmptyCluster() *Cluster

func (Cluster) Delete

func (c Cluster) Delete(ctx *generic.Context)

deleteInDB deletes Items information from database

func (*Cluster) Return

func (c *Cluster) Return(ctx *generic.Context) error

func (Cluster) Save

func (c Cluster) Save(ctx *generic.Context) error

save saves Items information in database

type ClusterList

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

func List

func List(ctx *generic.Context) (*ClusterList, error)

List gets all the Items in database

func NewClusterList

func NewClusterList() *ClusterList

func WrapClusterList

func WrapClusterList(clusters []*Cluster) *ClusterList

func (*ClusterList) Append

func (l *ClusterList) Append(c *Cluster)

Appends a cluster to the list

func (*ClusterList) ClusterInList

func (l *ClusterList) ClusterInList(c *Cluster) bool

ClusterInList checks if specified cluster is in specified list

func (*ClusterList) ClustersInStateIn

func (l *ClusterList) ClustersInStateIn(state ClusterState) *ClusterList

Extracts list of Items in a specific state

func (*ClusterList) ItemAt

func (l *ClusterList) ItemAt(index int) *Cluster

ItemAt gets cluster of specified index

func (*ClusterList) Len

func (l *ClusterList) Len() int

Len gets the length of the clusters

func (*ClusterList) List

func (l *ClusterList) List(filter func(c *Cluster))

List iterates over all the clusters

func (*ClusterList) OldestN

func (l *ClusterList) OldestN(count int) *ClusterList

Returns the oldest N Items

type ClusterState

type ClusterState string
const (
	ClusterProvisioning   ClusterState = "Provisioning"
	ClusterFailed         ClusterState = "Failed"
	ClusterSuccess        ClusterState = "Success"
	ClusterUsed           ClusterState = "Used"
	ClusterDeProvisioning ClusterState = "Deprovisioning"
	ClusterCleanup        ClusterState = "Cleanup"
	ClusterReturned       ClusterState = "Returned"
)

func (ClusterState) String

func (cs ClusterState) String() string

Jump to

Keyboard shortcuts

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