printer

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const GB = float64(1073741824)
View Source
const ServiceAccountSecretPlaceholder = "No secrets"

ServiceAccountSecretPlaceholder is the table placeholder for service account secrets.

Variables

View Source
var (
	// CRDConditionsColumns are columns for a crd conditions table.
	CRDConditionsColumns = component.NewTableCols("Type", "Status", "Last Transition Time", "Message", "Reason")
)
View Source
var (
	JobCols = component.NewTableCols("Name", "Labels", "Completions", "Successful", "Age")
)
View Source
var ServiceAccountSecretCols = component.NewTableCols("Name", "Type")

ServiceAccountSecretCols are columns for a service account secrets table.

Functions

func APIServiceHandler added in v0.15.0

func APIServiceHandler(ctx context.Context, apiService *apiregistrationv1.APIService, options Options) (component.Component, error)

APIServiceHandler is a printFunc that prints a api service

func APIServiceListHandler added in v0.15.0

func APIServiceListHandler(ctx context.Context, list *apiregistrationv1.APIServiceList, options Options) (component.Component, error)

APIServiceListHandler is a printFunc that prints api services

func AddHandlers

func AddHandlers(p Handler) error

AddHandlers adds print handlers to a printer.

func BreakdownRule

func BreakdownRule(rule rbacv1.PolicyRule) []rbacv1.PolicyRule

BreakdownRule takes a rule and builds an equivalent list of rules that each have at most one verb, one resource, and one resource name

func ClusterRoleBindingHandler

func ClusterRoleBindingHandler(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBinding, options Options) (component.Component, error)

ClusterRoleBindingHandler is a printFunc that prints a ClusterRoleBinding

func ClusterRoleBindingListHandler

func ClusterRoleBindingListHandler(ctx context.Context, clusterRoleBindingList *rbacv1.ClusterRoleBindingList, options Options) (component.Component, error)

ClusterRoleBindingListHandler is a printFunc that prints ClusterRoldBindings

func ClusterRoleHandler

func ClusterRoleHandler(ctx context.Context, clusterRole *rbacv1.ClusterRole, options Options) (component.Component, error)

ClusterRoleHandler is a printFunc that prints a cluster role

func ClusterRoleListHandler

func ClusterRoleListHandler(ctx context.Context, list *rbacv1.ClusterRoleList, options Options) (component.Component, error)

ClusterRoleListHandler is a printFunc that prints cluster roles

func CombineResourceGroup

func CombineResourceGroup(resource, group []string) string

func ConfigMapHandler

func ConfigMapHandler(ctx context.Context, cm *corev1.ConfigMap, options Options) (component.Component, error)

ConfigMapHandler is a printFunc that prints a ConfigMap

func ConfigMapListHandler

func ConfigMapListHandler(ctx context.Context, list *corev1.ConfigMapList, opts Options) (component.Component, error)

ConfigMapListHandler is a printFunc that prints ConfigMaps

func CreateCRDConditionsTable added in v0.14.0

func CreateCRDConditionsTable(crd *apiextv1.CustomResourceDefinition) (*component.Table, error)

CreateCRDConditionsTable creates a crd conditions table.

func CronJobHandler

func CronJobHandler(ctx context.Context, cronJob *batchv1beta1.CronJob, options Options) (component.Component, error)

CronJobHandler is a printFunc that prints a CronJob

func CronJobListHandler

func CronJobListHandler(ctx context.Context, list *batchv1beta1.CronJobList, opts Options) (component.Component, error)

CronJobListHandler is a printFunc that lists cronjobs

func CustomResourceDefinitionHandler added in v0.10.0

func CustomResourceDefinitionHandler(
	ctx context.Context,
	crd *apiextv1.CustomResourceDefinition,
	options Options) (component.Component, error)

CustomResourceDefinitionHandler is a print func that prints a custom resource definition.

func CustomResourceDefinitionListHandler added in v0.14.0

func CustomResourceDefinitionListHandler(
	ctx context.Context,
	list *apiextv1.CustomResourceDefinitionList,
	opts Options) (component.Component, error)

CustomResourceDefinitionListHandler is a printFunc that lists custom resource definitions.

func CustomResourceDefinitionVersionList added in v0.14.0

func CustomResourceDefinitionVersionList(
	ctx context.Context,
	crd *unstructured.Unstructured,
	namespace string,
	options Options) (component.Component, error)

CustomResourceDefinitionVersionList lists crd versions.

func CustomResourceHandler

func CustomResourceHandler(ctx context.Context, crd, cr *unstructured.Unstructured, options Options) (component.Component, error)

CustomResourceHandler prints custom resource objects. If the object has columns specified, it will print those columns as well.

func DaemonSetHandler

func DaemonSetHandler(ctx context.Context, daemonSet *appsv1.DaemonSet, options Options) (component.Component, error)

DaemonSetHandler is a printFunc that prints a daemon set

func DaemonSetListHandler

func DaemonSetListHandler(ctx context.Context, list *appsv1.DaemonSetList, opts Options) (component.Component, error)

DaemonSetListHandler is a printFunc that lists daemon sets

func DefaultPrintFunc

func DefaultPrintFunc(_ context.Context, object runtime.Object, _ Options) (component.Component, error)

DefaultPrintFunc is a default object printer. It prints Kubernetes resource lists with three columns: name, labels, age. Returns nil if the object should not be printed.

func DeploymentHandler

func DeploymentHandler(ctx context.Context, deployment *appsv1.Deployment, options Options) (component.Component, error)

DeploymentHandler is a printFunc that prints a Deployments.

func DeploymentListHandler

func DeploymentListHandler(ctx context.Context, list *appsv1.DeploymentList, opts Options) (component.Component, error)

DeploymentListHandler is a printFunc that lists deployments

func EventHandler

func EventHandler(ctx context.Context, event *corev1.Event, opts Options) (component.Component, error)

func EventListHandler

func EventListHandler(ctx context.Context, list *corev1.EventList, opts Options) (component.Component, error)

EventListHandler is a printFunc that lists events.

func HorizontalPodAutoscalerHandler

func HorizontalPodAutoscalerHandler(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscaler, options Options) (component.Component, error)

HorizontalPodAutoscalerHandler is a printFunc that prints a HorizontalPodAutoscaler

func HorizontalPodAutoscalerListHandler

func HorizontalPodAutoscalerListHandler(ctx context.Context, list *autoscalingv1.HorizontalPodAutoscalerList, options Options) (component.Component, error)

HorizontalPodAutoscalerListHandler is a printFunc that lists horizontal pod autoscalers

func IngressHandler

func IngressHandler(ctx context.Context, ingress *networkingv1.Ingress, options Options) (component.Component, error)

IngressHandler is a printFunc that prints an Ingress

func IngressListHandler

func IngressListHandler(ctx context.Context, list *networkingv1.IngressList, options Options) (component.Component, error)

IngressListHandler is a printFunc that prints ingresses

func JobHandler

func JobHandler(ctx context.Context, job *batchv1.Job, options Options) (component.Component, error)

JobHandler printers a job.

func JobListHandler

func JobListHandler(ctx context.Context, list *batchv1.JobList, opts Options) (component.Component, error)

JobListHandler prints a job list.

func MetadataHandler added in v0.10.0

func MetadataHandler(object runtime.Object, linkGenerator link.Interface) (*component.FlexLayout, error)

MetadataHandler converts object metadata to a flex layout containing object metadata.

func MutatingWebhookConfigurationHandler added in v0.15.0

func MutatingWebhookConfigurationHandler(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, options Options) (component.Component, error)

MutatingWebhookConfigurationHandler is a printFunc that prints a mutating webhook configurations

func MutatingWebhookConfigurationListHandler added in v0.15.0

func MutatingWebhookConfigurationListHandler(ctx context.Context, list *admissionregistrationv1.MutatingWebhookConfigurationList, options Options) (component.Component, error)

MutatingWebhookConfigurationListHandler is a printFunc that prints mutating webhook configurations

func NamespaceHandler

func NamespaceHandler(ctx context.Context, namespace *corev1.Namespace, options Options) (component.Component, error)

func NamespaceListHandler

func NamespaceListHandler(ctx context.Context, list *corev1.NamespaceList, options Options) (component.Component, error)

func NetworkPolicyHandler added in v0.12.0

func NetworkPolicyHandler(ctx context.Context, networkPolicy *networkingv1.NetworkPolicy, options Options) (component.Component, error)

NetworkPolicyHandler is a printFunc that prints NetworkPolicies

func NetworkPolicyListHandler added in v0.12.0

func NetworkPolicyListHandler(ctx context.Context, list *networkingv1.NetworkPolicyList, options Options) (component.Component, error)

NetworkPolicyListHandler is a printFunc that prints network policies

func NodeHandler

func NodeHandler(ctx context.Context, node *corev1.Node, options Options) (component.Component, error)

NodeHandler is a printFunc that prints nodes

func NodeListHandler

func NodeListHandler(ctx context.Context, list *corev1.NodeList, options Options) (component.Component, error)

NodeListHandler is a printFunc that prints nodes

func ObjectReferencePath

func ObjectReferencePath(or corev1.ObjectReference) (string, error)

ObjectReferencePath returns the overview path for an object reference. Currently, this does not support custom resources.

func PersistentVolumeClaimHandler

func PersistentVolumeClaimHandler(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, options Options) (component.Component, error)

PersistentVolumeClaimHandler is a printFunc that prints a PersistentVolumeClaim

func PersistentVolumeClaimListHandler

func PersistentVolumeClaimListHandler(ctx context.Context, list *corev1.PersistentVolumeClaimList, options Options) (component.Component, error)

PersistentVolumeClaimListHandler is a printFunc that prints persistentvolumeclaims

func PersistentVolumeHandler added in v0.11.0

func PersistentVolumeHandler(ctx context.Context, pv *corev1.PersistentVolume, options Options) (component.Component, error)

PersistentVolumeHandler is a printFunc that creates a component to display a single Persistent Volume

func PersistentVolumeListHandler added in v0.11.0

func PersistentVolumeListHandler(ctx context.Context, list *corev1.PersistentVolumeList, options Options) (component.Component, error)

PersistentVolumeListHandler is a printFunc that creates a component to display multiple Persistent Volumes

func PodHandler

func PodHandler(ctx context.Context, pod *corev1.Pod, options Options) (component.Component, error)

PodHandler is a printFunc that prints Pods

func PodListHandler

func PodListHandler(ctx context.Context, list *corev1.PodList, opts Options) (component.Component, error)

PodListHandler is a printFunc that prints pods

func PrintError added in v0.22.0

func PrintError(err error) (component.Component, error)

PrintError prints the events table with the error

func PrintEvents

func PrintEvents(list *corev1.EventList, opts Options) (component.Component, error)

PrintEvents collects events for a resource

func ReplicaSetHandler

func ReplicaSetHandler(ctx context.Context, replicaSet *appsv1.ReplicaSet, options Options) (component.Component, error)

ReplicaSetHandler is a printFunc that prints a ReplicaSets.

func ReplicaSetListHandler

func ReplicaSetListHandler(ctx context.Context, list *appsv1.ReplicaSetList, opts Options) (component.Component, error)

ReplicaSetListHandler is a printFunc that lists deployments

func ReplicationControllerHandler

func ReplicationControllerHandler(ctx context.Context, rc *corev1.ReplicationController, options Options) (component.Component, error)

ReplicationControllerHandler is a printFunc that prints a ReplicationController

func ReplicationControllerListHandler

func ReplicationControllerListHandler(ctx context.Context, list *corev1.ReplicationControllerList, options Options) (component.Component, error)

ReplicationControllerListHandler is a printFunc that lists ReplicationControllers

func RoleBindingHandler

func RoleBindingHandler(ctx context.Context, roleBinding *rbacv1.RoleBinding, options Options) (component.Component, error)

RoleBindingHandler is a printfunc that prints a RoleBinding

func RoleBindingListHandler

func RoleBindingListHandler(ctx context.Context, roleBindingList *rbacv1.RoleBindingList, opts Options) (component.Component, error)

RoleBindingListHandler is a printFunc that prints RoleBindings

func RoleHandler

func RoleHandler(ctx context.Context, role *rbacv1.Role, options Options) (component.Component, error)

RoleHandler is a printFunc that prints roles

func RoleListHandler

func RoleListHandler(ctx context.Context, roleList *rbacv1.RoleList, options Options) (component.Component, error)

RoleListHandler is a printFunc that prints roles

func SecretHandler

func SecretHandler(ctx context.Context, secret *corev1.Secret, options Options) (component.Component, error)

SecretHandler is a printFunc for printing a secret summary.

func SecretListHandler

func SecretListHandler(ctx context.Context, list *corev1.SecretList, options Options) (component.Component, error)

SecretListHandler is a printFunc that lists secrets.

func ServiceAccountHandler

func ServiceAccountHandler(ctx context.Context, serviceAccount *corev1.ServiceAccount, options Options) (component.Component, error)

ServiceAccountHandler is a printFunc that prints ServiceAccounts

func ServiceAccountListHandler

func ServiceAccountListHandler(ctx context.Context, list *corev1.ServiceAccountList, options Options) (component.Component, error)

ServiceAccountListHandler is a printFunc that prints service accounts

func ServiceAccountSecrets added in v0.13.0

func ServiceAccountSecrets(
	ctx context.Context,
	account *corev1.ServiceAccount,
	options Options) (*component.Table, error)

ServiceAccountSecrets generates a service account secrets table. It will return a nil table if there are no secrets.

func ServiceHandler

func ServiceHandler(ctx context.Context, service *corev1.Service, options Options) (component.Component, error)

ServiceHandler is a printFunc that prints a Services.

func ServiceListHandler

func ServiceListHandler(ctx context.Context, list *corev1.ServiceList, options Options) (component.Component, error)

ServiceListHandler is a printFunc that lists services

func StatefulSetHandler

func StatefulSetHandler(ctx context.Context, statefulSet *appsv1.StatefulSet, options Options) (component.Component, error)

StatefulSetHandler is a printFunc that prints a StatefulSet

func StatefulSetListHandler

func StatefulSetListHandler(ctx context.Context, list *appsv1.StatefulSetList, options Options) (component.Component, error)

StatefulSetListHandler is a printFunc that list stateful sets

func StorageClassHandler added in v0.18.0

func StorageClassHandler(ctx context.Context, sc *storagev1.StorageClass, options Options) (component.Component, error)

StorageClassHandler is a printFunc that creates a component to display a single Storage Class

func StorageClassListHandler added in v0.18.0

func StorageClassListHandler(ctx context.Context, list *storagev1.StorageClassList, options Options) (component.Component, error)

StorageClassListHandler is a printFunc that creates a component to display multiple Storage Class

func ValidatePrintHandlerFunc

func ValidatePrintHandlerFunc(printFunc reflect.Value) error

ValidatePrintHandlerFunc validates print handler signature. printFunc is the function that will be called to print an object. printFunc must be of the following type:

func printFunc(ctx context.Context, object ObjectType, options Options) (component.Component, error)

where:

ObjectType is the type of object that will be printed

func ValidatingWebhookConfigurationHandler added in v0.15.0

func ValidatingWebhookConfigurationHandler(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, options Options) (component.Component, error)

ValidatingWebhookConfigurationHandler is a printFunc that prints a validating webhook configurations

func ValidatingWebhookConfigurationListHandler added in v0.15.0

func ValidatingWebhookConfigurationListHandler(ctx context.Context, list *admissionregistrationv1.ValidatingWebhookConfigurationList, options Options) (component.Component, error)

ValidatingWebhookConfigurationListHandler is a printFunc that prints validating webhook configurations

Types

type APIServiceConfiguration added in v0.15.0

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

APIServiceConfiguration generates a apiservice configuration

func NewAPIServiceConfiguration added in v0.15.0

func NewAPIServiceConfiguration(apiService *apiregistrationv1.APIService) *APIServiceConfiguration

NewAPIServiceConfiguration creates an instance of APIServiceConfiguration

func (*APIServiceConfiguration) Create added in v0.15.0

func (c *APIServiceConfiguration) Create(options Options) (*component.Summary, error)

Create creates a apiservice configuration summary

type APIServiceStatus added in v0.15.0

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

APIServiceStatus generates a apiservice status

func NewAPIServiceStatus added in v0.15.0

func NewAPIServiceStatus(apiService *apiregistrationv1.APIService) *APIServiceStatus

NewAPIServiceStatus creates an instance of APIServiceStatus

func (*APIServiceStatus) Create added in v0.15.0

func (c *APIServiceStatus) Create(options Options) (*component.Summary, error)

Create creates a apiservice status summary

type CRDSummaryFunc added in v0.14.0

type ClusterRoleBindingConfiguration

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

ClusterRoleBindingConfiguration generates a clusterrolebinding configuration

func NewClusterRoleBindingConfiguration

func NewClusterRoleBindingConfiguration(clusterRoleBinding *rbacv1.ClusterRoleBinding) *ClusterRoleBindingConfiguration

NewClusterRoleBindingConfiguration creates an instance of ClusterRoleBindingConfiguration

func (*ClusterRoleBindingConfiguration) Create

Create creates a clusterrolebinding configuration summary

type ClusterRoleConfiguration

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

ClusterRoleConfiguration generates a clusterrole configuration

func NewClusterRoleConfiguration

func NewClusterRoleConfiguration(clusterRole *rbacv1.ClusterRole) *ClusterRoleConfiguration

NewClusterRoleConfiguration creates an instance of ClusterRoleConfiguration

func (*ClusterRoleConfiguration) Create

func (c *ClusterRoleConfiguration) Create(options Options) (*component.Summary, error)

Create creates a clusterrole configuration summary

type ConfigMapConfiguration

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

ConfigMapConfiguration generates config map configuration

func NewConfigMapConfiguration

func NewConfigMapConfiguration(cm *corev1.ConfigMap) *ConfigMapConfiguration

NewConfigMapConfiguration creates an instance of ConfigMapConfiguration

func (*ConfigMapConfiguration) Create

func (c *ConfigMapConfiguration) Create(options Options) (*component.Summary, error)

Create a configmap configuration summary

type ContainerConfiguration

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

ContainerConfiguration generates container configuration.

func NewContainerConfiguration

NewContainerConfiguration creates an instance of ContainerConfiguration.

func (*ContainerConfiguration) Create

func (cc *ContainerConfiguration) Create() (*component.Summary, error)

Create creates a deployment configuration summary.

type ContainerConfigurationOption added in v0.12.0

type ContainerConfigurationOption func(*ContainerConfiguration)

ContainerConfigurationOption

func IsInit added in v0.12.0

func WithActions added in v0.12.0

func WithActions(actions ...containerActionFunc) ContainerConfigurationOption

func WithPrintOptions added in v0.12.0

func WithPrintOptions(options Options) ContainerConfigurationOption

type CronJobConfiguration

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

CronJobConfiguration generates cronjob configuration

func NewCronJobConfiguration

func NewCronJobConfiguration(c *batchv1beta1.CronJob) *CronJobConfiguration

NewCronJobConfiguration creates an instance of CronJobConfiguration

func (*CronJobConfiguration) Create

func (cc *CronJobConfiguration) Create() (*component.Summary, error)

Create creates a cronjob configuration summary

type CustomResourceDefinitionSummary added in v0.14.0

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

CustomResourceDefinitionSummary creates a crd summary.

func NewCustomResourceDefinitionSummary added in v0.14.0

NewCustomResourceDefinitionSummary creates an instance of CustomResourceDefinitionSummary.

func (*CustomResourceDefinitionSummary) BuildConfig added in v0.14.0

func (h *CustomResourceDefinitionSummary) BuildConfig() error

BuildConfig adds configuration data for a crd to the summary.

func (*CustomResourceDefinitionSummary) BuildItems added in v0.14.0

func (h *CustomResourceDefinitionSummary) BuildItems(options Options) error

BuildItems adds additional items to the crd summary.

type CustomResourceDefinitionSummaryOption added in v0.14.0

type CustomResourceDefinitionSummaryOption func(s *CustomResourceDefinitionSummary)

CustomResourceDefinitionSummaryOption is an option for configuring CustomResourceDefinitionSummary.

func CustomResourceDefinitionSummaryItems added in v0.14.0

func CustomResourceDefinitionSummaryItems(funcs ...CRDSummaryFunc) CustomResourceDefinitionSummaryOption

type CustomResourceLister added in v0.17.0

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

CustomResourceLister lists custom resources.

func NewCustomResourceLister added in v0.17.0

func NewCustomResourceLister(options ...CustomResourceListerOption) *CustomResourceLister

NewCustomResourceLister creates a CustomResourceLister instance.

func (*CustomResourceLister) List added in v0.17.0

func (crl *CustomResourceLister) List(crdObject *unstructured.Unstructured, resources *unstructured.UnstructuredList, version string, linkGenerator link.Interface) (component.Component, error)

List prints a list of custom resources as a table with optional custom columns.

type CustomResourceListerOption added in v0.17.0

type CustomResourceListerOption func(lister *CustomResourceLister)

func CustomResourceListAllVersions added in v0.17.0

func CustomResourceListAllVersions(tf bool) CustomResourceListerOption

CustomResourceListAllVersions set if all versions will be listed.

type DaemonSetConfiguration

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

DaemonSetConfiguration generates a daemonset configuration

func NewDaemonSetConfiguration

func NewDaemonSetConfiguration(ds *appsv1.DaemonSet) *DaemonSetConfiguration

NewDaemonSetConfiguration creates an instance of DaemonSetConfiguration

func (*DaemonSetConfiguration) Create

func (dc *DaemonSetConfiguration) Create() (*component.Summary, error)

Create generates a daemonset configuration summary

type DefaultObjectFactory added in v0.14.0

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

func NewDefaultObjectFactory added in v0.14.0

func NewDefaultObjectFactory() *DefaultObjectFactory

func (DefaultObjectFactory) Factory added in v0.14.0

func (d DefaultObjectFactory) Factory(object runtime.Object, options Options) (*Object, error)

type DeploymentConfiguration

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

DeploymentConfiguration generates deployment configuration.

func NewDeploymentConfiguration

func NewDeploymentConfiguration(d *appsv1.Deployment) *DeploymentConfiguration

NewDeploymentConfiguration creates an instance of DeploymentConfiguration.

func (*DeploymentConfiguration) Create

Create creates a deployment configuration summary.

type Handler

type Handler interface {
	Handler(printFunc interface{}) error
}

Handler configures handlers for a printer.

type HorizontalPodAutoscalerConfiguration

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

HorizontalPodAutoscalerConfiguration generates a horizontalpodautoscaler configuration

func NewHorizontalPodAutoscalerConfiguration

func NewHorizontalPodAutoscalerConfiguration(hpa *autoscalingv1.HorizontalPodAutoscaler) *HorizontalPodAutoscalerConfiguration

NewHorizontalPodAutoscalerConfiguration creates an instance of HorizontalPodAutoscalerConfiguration

func (*HorizontalPodAutoscalerConfiguration) Create

Create creates a horizontalpodautoscaler configuration summary

type IngressConfiguration

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

IngressConfiguration generates an ingress configuration

func NewIngressConfiguration

func NewIngressConfiguration(ingress *networkingv1.Ingress) *IngressConfiguration

NewIngressConfiguration creates an instance of Ingressconfiguration

func (*IngressConfiguration) Create

func (i *IngressConfiguration) Create(options Options) (*component.Summary, error)

Create creates an ingress configuration summary

type ItemDescriptor

type ItemDescriptor struct {
	Component component.Component
	Func      ObjectPrinterFunc
	Width     int
}

ItemDescriptor describes a func to print a view and its width.

type JobConfiguration

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

JobConfiguration generates a job configuration

func NewJobConfiguration

func NewJobConfiguration(job *batchv1.Job) *JobConfiguration

NewJobConfiguration creates an instance of JobConfiguration

func (*JobConfiguration) Create

func (j *JobConfiguration) Create(option Options) (*component.Summary, error)

Create creates a job configuration summary

type JobTemplate

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

func NewJobTemplate

func NewJobTemplate(ctx context.Context, parent runtime.Object, jobTemplateSpec batchv1beta1.JobTemplateSpec) *JobTemplate

func (*JobTemplate) AddToFlexLayout

func (jt *JobTemplate) AddToFlexLayout(fl *flexlayout.FlexLayout, options Options) error

type JobTemplateHeader

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

JobTemplateHeader creates a job template header

func NewJobTemplateHeader

func NewJobTemplateHeader(labels map[string]string) *JobTemplateHeader

NewJobTemplateHeader creates an instance of JobTemplateHeader

func (*JobTemplateHeader) Create

func (jth *JobTemplateHeader) Create() (*component.Labels, error)

Create creates a label component

type Metadata

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

Metadata represents object metadata.

func NewMetadata

func NewMetadata(object runtime.Object, l link.Interface) (*Metadata, error)

NewMetadata creates an instance of Metadata.

func (*Metadata) AddToFlexLayout

func (m *Metadata) AddToFlexLayout(fl *flexlayout.FlexLayout) error

AddToFlexLayout adds metadata to a flex layout.

type MutatingWebhook added in v0.15.0

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

MutatingWebhook generates a mutating webhook

func NewMutatingWebhook added in v0.15.0

func NewMutatingWebhook(mutatingWebhook *admissionregistrationv1.MutatingWebhook) *MutatingWebhook

NewMutatingWebhook creates an instance of MutatingWebhook

func (*MutatingWebhook) Create added in v0.15.0

func (c *MutatingWebhook) Create(options Options) (*component.Summary, error)

Create creates a mutating webhook summary

type NamespaceResourceLimits

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

NamespaceResourceLimits creates a namespace resource limit component.

func NewNamespaceResourceLimits

func NewNamespaceResourceLimits(namespace *corev1.Namespace) *NamespaceResourceLimits

func (*NamespaceResourceLimits) Create

func (n *NamespaceResourceLimits) Create(ctx context.Context, options Options) (*component.Table, error)

Create creates a namespace limit component.

type NamespaceResourceQuotas

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

NamespaceResourceQuotas creates a namespace resource quota component.

func NewNamespaceResourceQuotas

func NewNamespaceResourceQuotas(namespace *corev1.Namespace) *NamespaceResourceQuotas

func (*NamespaceResourceQuotas) Create

type NamespaceStatus

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

NamespaceStatus creates a namespace status component.

func NewNamespaceStatus

func NewNamespaceStatus(namespace *corev1.Namespace) *NamespaceStatus

NewNamespaceStatus creates an instance of NamespaceStatus

func (*NamespaceStatus) Create

func (n *NamespaceStatus) Create(options Options) (*component.Summary, error)

Create creates a namespace configuration summary

type NetworkPolicyConfiguration added in v0.12.0

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

NetworkPolicyConfiguration generates networkPolicy configuration

func NewNetworkPolicyConfiguration added in v0.12.0

func NewNetworkPolicyConfiguration(n *networkingv1.NetworkPolicy) *NetworkPolicyConfiguration

NewNetworkPolicyConfiguration creates an instance of NetworkPolicyConfiguration

func (*NetworkPolicyConfiguration) Create added in v0.12.0

Create creates a networkPolicy configuration summary

type NodeConfiguration

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

NodeConfiguration generates a node configuration

func NewNodeConfiguration

func NewNodeConfiguration(node *corev1.Node) *NodeConfiguration

NewNodeConfiguration creates an instance of NodeConfiguration

func (*NodeConfiguration) Create

func (n *NodeConfiguration) Create(options Options) (*component.Summary, error)

Create creates a node configuration summary

type Object

type Object struct {
	PodTemplateGen func(context.Context, runtime.Object, corev1.PodTemplateSpec, *flexlayout.FlexLayout, Options) error
	JobTemplateGen func(context.Context, runtime.Object, batchv1beta1.JobTemplateSpec, *flexlayout.FlexLayout, Options) error
	EventsGen      func(ctx context.Context, object runtime.Object, fl *flexlayout.FlexLayout, options Options) error
	ConditionsGen  func(ctx context.Context, object runtime.Object, fl *flexlayout.FlexLayout) error
	// contains filtered or unexported fields
}

Object prints an object.

func CustomResourceDefinitionObjectFactory added in v0.14.0

func CustomResourceDefinitionObjectFactory(object runtime.Object, options Options) (*Object, error)

CustomResourceDefinitionObjectFactory is an object factory that describes a crd summary.

func NewObject

func NewObject(object runtime.Object, options ...ObjectOpts) *Object

NewObject creates an instance of Object.

func (*Object) AddButton

func (o *Object) AddButton(name string, payload action.Payload, buttonOptions ...component.ButtonOption)

func (*Object) DisableConditions added in v0.23.0

func (o *Object) DisableConditions()

EnableConditions enables the conditions view for the object.

func (*Object) EnableEvents

func (o *Object) EnableEvents()

EnableEvents enables the event view for the object.

func (*Object) EnableJobTemplate

func (o *Object) EnableJobTemplate(templateSpec batchv1beta1.JobTemplateSpec)

EnableJobTemplate enables the job template view for the object.

func (*Object) EnablePodTemplate

func (o *Object) EnablePodTemplate(templateSpec corev1.PodTemplateSpec)

EnablePodTemplate enables the pod template view for the object.

func (*Object) RegisterConfig

func (o *Object) RegisterConfig(summary *component.Summary)

RegisterConfig registers the config view for an object.

func (*Object) RegisterItems

func (o *Object) RegisterItems(items ...ItemDescriptor)

RegisterItems registers one or more items to be printed in a section. Each call to RegisterItems will create a new section.

func (*Object) RegisterSummary

func (o *Object) RegisterSummary(summary *component.Summary)

RegisterSummary registers a summary view for an object.

func (*Object) ToComponent

func (o *Object) ToComponent(ctx context.Context, options Options) (component.Component, error)

ToComponent converts Object to a view.

type ObjectFactory added in v0.14.0

type ObjectFactory interface {
	Factory(object runtime.Object, options Options) (*Object, error)
}

type ObjectInterface

type ObjectInterface interface {
	// AddButton adds a button.
	AddButton(name string, payload action.Payload, buttonOptions ...component.ButtonOption)
	// EnableEvents enables showing events.
	EnableEvents()
	// EnableJobTemplate adds a job template.
	EnableJobTemplate(templateSpec batchv1beta1.JobTemplateSpec)
	// EnablePodTemplate adds a pod template.
	EnablePodTemplate(templateSpec corev1.PodTemplateSpec)
	// RegisterConfig registers a config summary component.
	RegisterConfig(summary *component.Summary)
	// RegisterItems registers items to be shown
	RegisterItems(items ...ItemDescriptor)
	// RegisterSummary registers a summary summary component.
	RegisterSummary(summary *component.Summary)
}

ObjectInterface is an interface for printing an object.

type ObjectOpts

type ObjectOpts func(o *Object)

ObjectOpts are options for configuration Object.

type ObjectPrinterFunc

type ObjectPrinterFunc func() (component.Component, error)

ObjectPrinterFunc is a func that create a view.

type ObjectPrinterLayoutFunc

type ObjectPrinterLayoutFunc func(*flexlayout.FlexLayout) error

ObjectPrinterLayoutFunc is a func that render a view in a flex layout.

type ObjectTable added in v0.13.0

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

ObjectTable is a helper for creating a table containing a list of objects.

func NewObjectTable added in v0.13.0

func NewObjectTable(title, placeholder string, cols []component.TableCol, objectStore store.Store) *ObjectTable

NewObjectTable creates an instance of ObjectTable.

func (*ObjectTable) AddFilters added in v0.13.0

func (ol *ObjectTable) AddFilters(filters map[string]component.TableFilter)

AddFilters adds filters to a set of table columns.

func (*ObjectTable) AddRowForObject added in v0.13.0

func (ol *ObjectTable) AddRowForObject(ctx context.Context, object runtime.Object, row component.TableRow) error

AddRowForObject adds a row for an object to the table.

func (*ObjectTable) EnablePluginStatus added in v0.23.0

func (ol *ObjectTable) EnablePluginStatus(pluginManager plugin.ManagerInterface)

func (*ObjectTable) SetSortOrder added in v0.13.0

func (ol *ObjectTable) SetSortOrder(name string, reverse bool)

SetSortOrder sets the sort order for the table.

func (*ObjectTable) ToComponent added in v0.13.0

func (ol *ObjectTable) ToComponent() (component.Component, error)

ToComponent converts the ObjectTable instance to a component.

type Options

type Options struct {
	DisableLabels bool
	DashConfig    config.Dash
	Link          link.Interface
	ObjectFactory ObjectFactory
}

Options provides options to a print handler

type PersistentVolumeClaimConfiguration

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

PersistentVolumeClaimConfiguration generates a persistentvolumeclaim configuration

func NewPersistentVolumeClaimConfiguration

func NewPersistentVolumeClaimConfiguration(pvc *corev1.PersistentVolumeClaim) *PersistentVolumeClaimConfiguration

NewPersistentVolumeClaimConfiguration creates an instance of PersistentVolumeClaimConfiguration

func (*PersistentVolumeClaimConfiguration) Create

Create creates a persistentvolumeclaim configuration summary

type PersistentVolumeConfiguration added in v0.11.0

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

PersistentVolumeConfiguration is used to create the Persistent Volume's configuration component when displaying a single Persistent Volume

func NewPersistentVolumeConfiguration added in v0.11.0

func NewPersistentVolumeConfiguration(pv *corev1.PersistentVolume) *PersistentVolumeConfiguration

NewPersistentVolumeConfiguration creates a new PersistentVolumeConfiguration using the supplied Persistent Volume

func (*PersistentVolumeConfiguration) Create added in v0.11.0

func (pvc *PersistentVolumeConfiguration) Create(options Options) (*component.Summary, error)

Create the Configuration Summary component for a Persistent Volume

type PersistentVolumeStatus added in v0.11.0

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

PersistentVolumeStatus is used to create the Persistent Volume's status component when displaying a single Persistent Volume

func NewPersistentVolumeStatus added in v0.11.0

func NewPersistentVolumeStatus(pv *corev1.PersistentVolume) *PersistentVolumeStatus

NewPersistentVolumeStatus creates a new PersistentVolumeStatus using the supplied Persistent Volume

func (*PersistentVolumeStatus) Create added in v0.11.0

func (pvs *PersistentVolumeStatus) Create(ctx context.Context, options Options) (*component.Summary, error)

Create the Status Summary component for a Persistent Volume

type PodConfiguration

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

PodConfiguration generates pod configuration.

func NewPodConfiguration

func NewPodConfiguration(p *corev1.Pod) *PodConfiguration

NewPodConfiguration creates an instance of PodConfiguration.

func (*PodConfiguration) Create

func (p *PodConfiguration) Create(options Options) (*component.Summary, error)

Create creates a pod configuration summary.

type PodTemplate

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

func NewPodTemplate

func NewPodTemplate(parent runtime.Object, podTemplateSpec corev1.PodTemplateSpec) *PodTemplate

func (*PodTemplate) AddToFlexLayout

func (pt *PodTemplate) AddToFlexLayout(ctx context.Context, fl *flexlayout.FlexLayout, options Options) error

type PodTemplateHeader

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

PodTemplateHeader creates a pod template header. It consists of a selectors component with title `Pod Template` and the associated match selectors.

func NewPodTemplateHeader

func NewPodTemplateHeader(labels map[string]string) *PodTemplateHeader

NewPodTemplateHeader creates an instance of PodTemplateHeader.

func (*PodTemplateHeader) Create

func (pth *PodTemplateHeader) Create() *component.Labels

Create creates a labels component.

type Printer

type Printer interface {
	// Print prints a runtime object.
	Print(ctx context.Context, object runtime.Object) (component.Component, error)
}

Printer is an interface for printing runtime objects.

type ReplicaSetConfiguration

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

ReplicaSetConfiguration generates a replicaset configuration

func NewReplicaSetConfiguration

func NewReplicaSetConfiguration(rs *appsv1.ReplicaSet) *ReplicaSetConfiguration

NewReplicaSetConfiguration creates an instance of ReplicaSetConfiguration

func (*ReplicaSetConfiguration) Create

func (rc *ReplicaSetConfiguration) Create(options Options) (*component.Summary, error)

Create generates a replicaset configuration summary

type ReplicaSetStatus

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

ReplicaSetStatus generates a replicaset status

func NewReplicaSetStatus

func NewReplicaSetStatus(ctx context.Context, replicaSet *appsv1.ReplicaSet, options Options) *ReplicaSetStatus

NewReplicaSetStatus creates an instance of ReplicaSetStatus

func (*ReplicaSetStatus) Create

func (replicaSetStatus *ReplicaSetStatus) Create() (*component.Quadrant, error)

Create generates a replicaset status quadrant

type ReplicationControllerConfiguration

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

ReplicationControllerConfiguration generates a replicationcontroller configuration

func NewReplicationControllerConfiguration

func NewReplicationControllerConfiguration(rc *corev1.ReplicationController) *ReplicationControllerConfiguration

NewReplicationControllerConfiguration creates an instance of ReplicationControllerConfiguration

func (*ReplicationControllerConfiguration) Create

Create generates a replicationcontroller configuration summary

type ReplicationControllerStatus

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

ReplicationControllerStatus generates a replication controller status

func NewReplicationControllerStatus

func NewReplicationControllerStatus(ctx context.Context, replicationController *corev1.ReplicationController, options Options) *ReplicationControllerStatus

NewReplicationControllerStatus creates an instance of ReplicationControllerStatus

func (*ReplicationControllerStatus) Create

Create generates a replicaset status quadrant

type Resource

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

Resource prints runtime objects.

func NewResource

func NewResource(dashConfig config.Dash) *Resource

NewResource creates an instance of ResourcePrinter.

func (*Resource) Handler

func (p *Resource) Handler(printFunc interface{}) error

Handler adds a printer handler. See ValidatePrintHandlerFunc for required method signature.

func (*Resource) Print

func (p *Resource) Print(ctx context.Context, object runtime.Object) (component.Component, error)

Print prints a runtime object. If not handler can be found for the type, it will print using `DefaultPrintFunc`.

type RoleBindingConfiguration

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

RoleBindingConfiguration generates a rolebinding configuration

func NewRoleBindingConfiguration

func NewRoleBindingConfiguration(roleBinding *rbacv1.RoleBinding) *RoleBindingConfiguration

NewRoleBindingConfiguration creates an instance of RoleBindingConfiguration

func (*RoleBindingConfiguration) Create

Create creates a rolebinding configuration summary

type RoleConfiguration

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

RoleConfiguration generates a role configuration

func NewRoleConfiguration

func NewRoleConfiguration(role *rbacv1.Role) *RoleConfiguration

NewRoleConfiguration creates an instance of RoleConfiguration

func (*RoleConfiguration) Create

func (r *RoleConfiguration) Create(options Options) (*component.Summary, error)

Create creates a role configuration summary

type SecretConfiguration

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

SecretConfiguration generates a secret configuration

func NewSecretConfiguration

func NewSecretConfiguration(secret *corev1.Secret) *SecretConfiguration

NewSecretConfiguration creates an instance of SecretConfiguration

func (*SecretConfiguration) Create

func (s *SecretConfiguration) Create(options Options) (*component.Summary, error)

Create creates a secret configuration summary

type ServiceAccountConfiguration

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

ServiceAccountConfiguration generates a service account configuration

func NewServiceAccountConfiguration

func NewServiceAccountConfiguration(ctx context.Context, serviceAccount *corev1.ServiceAccount, options Options) *ServiceAccountConfiguration

NewServiceAccountConfiguration creates an instance of ServiceAccountConfiguration

func (*ServiceAccountConfiguration) Create

Create creates a service account configuration summary

type ServiceAccountPolicyRules

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

ServiceAccountPolicyRules generates a service account policy rule

func NewServiceAccountPolicyRules

func NewServiceAccountPolicyRules(ctx context.Context, serviceAccount *corev1.ServiceAccount, options Options) *ServiceAccountPolicyRules

NewServiceAccountPolicyRules creates an instance of ServiceAccountPolicyRules

func (*ServiceAccountPolicyRules) Create

Create generates a service account policy rule table

type ServiceConfiguration

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

ServiceConfiguration generates a service configuration

func NewServiceConfiguration

func NewServiceConfiguration(service *corev1.Service) *ServiceConfiguration

NewServiceConfiguration creates an instance of ServiceConfiguration

func (*ServiceConfiguration) Create

func (sc *ServiceConfiguration) Create(ctx context.Context, options Options) (*component.Summary, error)

Create generates a service configuration summary

type StatefulSetConfiguration

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

StatefulSetConfiguration generates a statefulset configuration

func NewStatefulSetConfiguration

func NewStatefulSetConfiguration(statefulSet *appsv1.StatefulSet) *StatefulSetConfiguration

NewStatefulSetConfiguration creates an instance of StatefulSetConfiguration

func (*StatefulSetConfiguration) Create

func (sc *StatefulSetConfiguration) Create(options Options) (*component.Summary, error)

Create generates a statefulset configuration summary

type StatefulSetStatus

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

StatefulSetStatus generates a statefulset status

func NewStatefulSetStatus

func NewStatefulSetStatus(ctx context.Context, statefulSet *appsv1.StatefulSet, options Options) *StatefulSetStatus

NewStatefulSetStatus creates an instance of StatefulSetStatus

func (*StatefulSetStatus) Create

func (statefulSetStatus *StatefulSetStatus) Create() (*component.Quadrant, error)

Create generates a statefulset status quadrant

type StorageClassConfiguration added in v0.18.0

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

StorageClassConfiguration is used to create the Storage Class' configuration component when displaying a single Storage Class

func NewStorageClassConfiguration added in v0.18.0

func NewStorageClassConfiguration(sc *storagev1.StorageClass) *StorageClassConfiguration

NewStorageClassConfiguration creates a new StorageClassConfiguration using the supplied Storage Class

func (*StorageClassConfiguration) Create added in v0.18.0

func (scc *StorageClassConfiguration) Create(options Options) (*component.Summary, error)

Create the Configuration Summary component for a Storage Class

type ValidatingWebhook added in v0.15.0

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

ValidatingWebhook generates a validating webhook

func NewValidatingWebhook added in v0.15.0

func NewValidatingWebhook(validatingWebhook *admissionregistrationv1.ValidatingWebhook) *ValidatingWebhook

NewValidatingWebhook creates an instance of ValidatingWebhook

func (*ValidatingWebhook) Create added in v0.15.0

func (c *ValidatingWebhook) Create(options Options) (*component.Summary, error)

Create creates a validating webhook summary

Directories

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

Jump to

Keyboard shortcuts

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