cache

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AllKeys = "all"

AllKeys indicates all data keys are being used when referencing a cm or secret.

View Source
const ConfigMapKey = "cm"

ConfigMapKey tracks ConfigMap ressource references

View Source
const DeploymentKey = "dp"

DeploymentKey tracks Deployment ressource references

View Source
const LimitRangeKey = "lr"

LimitRangeKey tracks LimitRange resource references

View Source
const PodDisruptionBudgetKey = "pdb"

PodDisruptionBudgetKey tracks PodDisruptionBudget ressource references

View Source
const SecretKey = "sec"

SecretKey tracks Secret ressource references

Variables

View Source
var Blank = Empty{}

Blank represents an empty value.

Functions

func FQN

func FQN(ns, n string) string

FQN returns a fully qualified resource identifier.

func MetaFQN

func MetaFQN(m metav1.ObjectMeta) string

MetaFQN returns a fully qualified resource identifier based on object meta.

func ResFqn

func ResFqn(k, s string) string

ResFqn returns a resource specific fqn.

Types

type ClusterRoleBinding

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

ClusterRoleBinding represents ClusterRoleBinding cache.

func NewClusterRoleBinding

func NewClusterRoleBinding(crbs map[string]*rbacv1.ClusterRoleBinding) *ClusterRoleBinding

NewClusterRoleBinding returns a new ClusterRoleBinding cache.

func (*ClusterRoleBinding) ListClusterRoleBindings

func (c *ClusterRoleBinding) ListClusterRoleBindings() map[string]*rbacv1.ClusterRoleBinding

ListClusterRoleBindings returns all available ClusterRoleBindings on the cluster.

type ConfigMap

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

ConfigMap represents ConfigMap cache.

func NewConfigMap

func NewConfigMap(cms map[string]*v1.ConfigMap) *ConfigMap

NewConfigMap returns a new ConfigMap cache.

func (*ConfigMap) ListConfigMaps

func (c *ConfigMap) ListConfigMaps() map[string]*v1.ConfigMap

ListConfigMaps returns all available ConfigMaps on the cluster.

type Deployment

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

Deployment represents Deployment cache.

func NewDeployment

func NewDeployment(dps map[string]*appsv1.Deployment) *Deployment

NewDeployment returns a new Deployment cache.

func (*Deployment) ListDeployments

func (d *Deployment) ListDeployments() map[string]*appsv1.Deployment

ListDeployments returns all available Deployments on the cluster.

type Empty

type Empty struct{}

Empty denotes an empty value.

type Endpoints

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

Endpoints represents Endpoints cache.

func NewEndpoints

func NewEndpoints(eps map[string]*v1.Endpoints) *Endpoints

NewEndpoints returns a new Endpoints cache.

func (*Endpoints) GetEndpoints

func (e *Endpoints) GetEndpoints(fqn string) *v1.Endpoints

GetEndpoints returns all available Endpoints on the cluster.

type HorizontalPodAutoscaler

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

HorizontalPodAutoscaler represents a collection of HorizontalPodAutoScalers available on a cluster.

func NewHorizontalPodAutoscaler

func NewHorizontalPodAutoscaler(svcs map[string]*autoscalingv1.HorizontalPodAutoscaler) *HorizontalPodAutoscaler

NewHorizontalPodAutoscaler returns a new HorizontalPodAutoScaler.

func (*HorizontalPodAutoscaler) ListHorizontalPodAutoscalers

func (h *HorizontalPodAutoscaler) ListHorizontalPodAutoscalers() map[string]*autoscalingv1.HorizontalPodAutoscaler

ListHorizontalPodAutoscalers returns all available HorizontalPodAutoScalers on the cluster.

type LimitRange added in v0.3.10

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

LimitRange represents LimitRange cache.

func NewLimitRange added in v0.3.10

func NewLimitRange(lrs map[string]*v1.LimitRange) *LimitRange

NewLimitRange returns a new LimitRange cache.

func (*LimitRange) ListLimitRanges added in v0.3.10

func (c *LimitRange) ListLimitRanges() map[string]*v1.LimitRange

ListLimitRanges returns all available LimitRanges on the cluster.

type Namespace

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

Namespace represents a collection of Namespaces available on a cluster.

func NewNamespace

func NewNamespace(nss map[string]*v1.Namespace) *Namespace

NewNamespace returns a new Namespace.

func (*Namespace) ListNamespaces

func (n *Namespace) ListNamespaces() map[string]*v1.Namespace

ListNamespaces returns all available Namespaces on the cluster.

type Node

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

Node represents a collection of Nodes available on a cluster.

func NewNode

func NewNode(svcs map[string]*v1.Node) *Node

NewNode returns a new Node.

func (*Node) ListNodes

func (n *Node) ListNodes() map[string]*v1.Node

ListNodes returns all available Nodes on the cluster.

type NodesMetrics

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

NodesMetrics represents a Node metrics cache.

func NewNodesMetrics

func NewNodesMetrics(mx map[string]*mv1beta1.NodeMetrics) *NodesMetrics

NewNodesMetrics returns new Node metrics cache.

func (*NodesMetrics) ListClusterMetrics

func (n *NodesMetrics) ListClusterMetrics() v1.ResourceList

ListClusterMetrics collects total available cpu and mem on the cluster.

func (*NodesMetrics) ListNodesMetrics

func (n *NodesMetrics) ListNodesMetrics() map[string]*mv1beta1.NodeMetrics

ListNodesMetrics returns all available NodeMetrics on the cluster.

type ObjReferences

type ObjReferences map[string]StringSet

ObjReferences tracks kubernetest object references.

type PersistentVolume

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

PersistentVolume represents a collection of PersistentVolumes available on a cluster.

func NewPersistentVolume

func NewPersistentVolume(pvs map[string]*v1.PersistentVolume) *PersistentVolume

NewPersistentVolume returns a new PersistentVolume.

func (*PersistentVolume) ListPersistentVolumes

func (p *PersistentVolume) ListPersistentVolumes() map[string]*v1.PersistentVolume

ListPersistentVolumes returns all available PersistentVolumes on the cluster.

type PersistentVolumeClaim

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

PersistentVolumeClaim represents a collection of PersistentVolumeClaims available on a cluster.

func NewPersistentVolumeClaim

func NewPersistentVolumeClaim(pvcs map[string]*v1.PersistentVolumeClaim) *PersistentVolumeClaim

NewPersistentVolumeClaim returns a new PersistentVolumeClaim.

func (*PersistentVolumeClaim) ListPersistentVolumeClaims

func (p *PersistentVolumeClaim) ListPersistentVolumeClaims() map[string]*v1.PersistentVolumeClaim

ListPersistentVolumeClaims returns all available PersistentVolumeClaims on the cluster.

type Pod

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

Pod represents a Pod cache.

func NewPod

func NewPod(pods map[string]*v1.Pod) *Pod

NewPod returns a Pod cache.

func (*Pod) GetPod

func (p *Pod) GetPod(sel map[string]string) *v1.Pod

GetPod returns a pod via a label query.

func (*Pod) ListPods

func (p *Pod) ListPods() map[string]*v1.Pod

ListPods return available pods.

func (*Pod) ListPodsBySelector

func (p *Pod) ListPodsBySelector(sel *metav1.LabelSelector) map[string]*v1.Pod

ListPodsBySelector list all pods matching the given selector.

func (*Pod) PodRefs

func (p *Pod) PodRefs(refs ObjReferences)

PodRefs computes all pods external references.

type PodDisruptionBudget added in v0.3.10

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

PodDisruptionBudget represents PodDisruptionBudget cache.

func NewPodDisruptionBudget added in v0.3.10

func NewPodDisruptionBudget(cms map[string]*v1beta1.PodDisruptionBudget) *PodDisruptionBudget

NewPodDisruptionBudget returns a new PodDisruptionBudget cache.

func (*PodDisruptionBudget) ForLabels added in v0.3.10

func (c *PodDisruptionBudget) ForLabels(labels map[string]string) *v1beta1.PodDisruptionBudget

ForLabels returns a pdb whose selector match the given labels. Returns nil if no match.

func (*PodDisruptionBudget) ListPodDisruptionBudgets added in v0.3.10

func (c *PodDisruptionBudget) ListPodDisruptionBudgets() map[string]*v1beta1.PodDisruptionBudget

ListPodDisruptionBudgets returns all available PodDisruptionBudgets on the cluster.

type PodsMetrics

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

PodsMetrics represents a Pod metrics cache.

func NewPodsMetrics

func NewPodsMetrics(mx map[string]*mv1beta1.PodMetrics) *PodsMetrics

NewPodsMetrics returns new Pod metrics cache.

func (*PodsMetrics) ListPodsMetrics

func (p *PodsMetrics) ListPodsMetrics() map[string]*mv1beta1.PodMetrics

ListPodsMetrics returns all available PodMetrics on the cluster.

type RoleBinding

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

RoleBinding represents RoleBinding cache.

func NewRoleBinding

func NewRoleBinding(crbs map[string]*rbacv1.RoleBinding) *RoleBinding

NewRoleBinding returns a new RoleBinding cache.

func (*RoleBinding) ListRoleBindings

func (r *RoleBinding) ListRoleBindings() map[string]*rbacv1.RoleBinding

ListRoleBindings returns all available RoleBindings on the cluster.

type Secret

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

Secret represents a collection of Secrets available on a cluster.

func NewSecret

func NewSecret(ss map[string]*v1.Secret) *Secret

NewSecret returns a new Secret cache.

func (*Secret) ListSecrets

func (s *Secret) ListSecrets() map[string]*v1.Secret

ListSecrets returns all available Secrets on the cluster.

type Service

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

Service represents a collection of Services available on a cluster.

func NewService

func NewService(svcs map[string]*v1.Service) *Service

NewService returns a new Service.

func (*Service) ListServices

func (s *Service) ListServices() map[string]*v1.Service

ListServices returns all available Services on the cluster.

type ServiceAccount

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

ServiceAccount tracks serviceaccounts.

func NewServiceAccount

func NewServiceAccount(sas map[string]*v1.ServiceAccount) *ServiceAccount

NewServiceAccount returns a new serviceaccount loader.

func (*ServiceAccount) ListServiceAccounts

func (s *ServiceAccount) ListServiceAccounts() map[string]*v1.ServiceAccount

ListServiceAccounts list available ServiceAccounts.

func (*ServiceAccount) ServiceAccountRefs

func (s *ServiceAccount) ServiceAccountRefs(refs ObjReferences)

ServiceAccountRefs computes all serviceaccount external references.

type StatefulSet

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

StatefulSet represents a collection of StatefulSets available on a cluster.

func NewStatefulSet

func NewStatefulSet(sts map[string]*appsv1.StatefulSet) *StatefulSet

NewStatefulSet returns a new StatefulSet.

func (*StatefulSet) ListStatefulSets

func (s *StatefulSet) ListStatefulSets() map[string]*appsv1.StatefulSet

ListStatefulSets returns all available StatefulSets on the cluster.

type StringSet

type StringSet map[string]Empty

StringSet represents a set of strings.

func (StringSet) Add

func (ss StringSet) Add(strs ...string)

Add a collection of elements to the set.

func (StringSet) Diff

func (ss StringSet) Diff(set StringSet) StringSet

Diff computes B-A.

func (StringSet) Has

func (ss StringSet) Has(s string) bool

Has checks if an item is in the set.

Jump to

Keyboard shortcuts

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