lister

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusAvailable refers to a reachable cluster.
	StatusAvailable = "AVAILABLE"

	// StatusUnavailable refers to an unreachable cluster.
	StatusUnavailable = "UNAVAILABLE"

	// StatusUnconfigured refers to an unconfigured cluster (a linked cluster).
	StatusUnconfigured = "UNCONFIGURED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter func(filters *Filters)

Filter is a functional option for list filters.

func AttachedOnly

func AttachedOnly() Filter

AttachedOnly filters cluster items to only keep the current one.

func Linked

func Linked() Filter

Linked indicates that linked clusters should be added to the list.

func Status

func Status(status string) Filter

Status filters cluster items based on the Status field.

type Filters

type Filters struct {
	AttachedOnly bool
	Status       string
	Linked       bool
}

Filters are filtering conditions for cluster lists.

type Item

type Item struct {
	Attached bool   `json:"attached"`
	ID       string `json:"cluster_id"`
	Name     string `json:"name"`
	Status   string `json:"status"`
	URL      string `json:"url"`
	Version  string `json:"version"`
	// contains filtered or unexported fields
}

Item represents a cluster item in the list.

func (*Item) Cluster

func (i *Item) Cluster() *config.Cluster

Cluster returns the cluster associated to the item.

type Lister

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

Lister is able to retrieve locally configured clusters as well as linked clusters.

func New

func New(configManager *config.Manager, logger *logrus.Logger) *Lister

New creates a new cluster lister.

func (*Lister) List

func (l *Lister) List(filters ...Filter) []*Item

List retrieves all known clusters.

Jump to

Keyboard shortcuts

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