popeye: github.com/derailed/popeye/internal/cache Index | Files

package cache

import "github.com/derailed/popeye/internal/cache"

Index

Package Files

cluster.go cm.go crb.go dp.go ds.go ep.go helper.go hpa.go ing.go limit_range.go no.go no_mx.go np.go ns.go pdb.go pod.go pod_mx.go psp.go pv.go pvc.go rb.go rs.go sa.go sec.go set.go sts.go svc.go

Constants

const AllKeys = "all"

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

const ClusterKey = "cl"

ClusterKey tracks Cluster ressource references

const ConfigMapKey = "cm"

ConfigMapKey tracks ConfigMap ressource references

const DaemonSetKey = "ds"

DaemonSetKey tracks DaemonSet ressource references

const DeploymentKey = "dp"

DeploymentKey tracks Deployment ressource references

const IngressKey = "ing"

IngressKey tracks Ingress ressource references

const LimitRangeKey = "lr"

LimitRangeKey tracks LimitRange resource references

const NetworkPolicyKey = "np"

NetworkPolicyKey tracks NetworkPolicy ressource references

const PodDisruptionBudgetKey = "pdb"

PodDisruptionBudgetKey tracks PodDisruptionBudget ressource references

const PodSecurityPolicyKey = "psp"

PodSecurityPolicyKey tracks PodSecurityPolicy ressource references

const ReplicaSetKey = "ds"

ReplicaSetKey tracks ReplicaSet ressource references

const SecretKey = "sec"

SecretKey tracks Secret ressource references

Variables

var Blank = Empty{}

Blank represents an empty value.

func FQN Uses

func FQN(ns, n string) string

FQN returns a fully qualified resource identifier.

func MetaFQN Uses

func MetaFQN(m metav1.ObjectMeta) string

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

func ResFqn Uses

func ResFqn(k, s string) string

ResFqn returns a resource specific fqn.

type Cluster Uses

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

Cluster represents Cluster cache.

func NewCluster Uses

func NewCluster(major, minor string) *Cluster

NewCluster returns a new Cluster cache.

func (*Cluster) ListVersion Uses

func (c *Cluster) ListVersion() (string, string)

ListVersion returns cluster server version.

type ClusterRoleBinding Uses

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

ClusterRoleBinding represents ClusterRoleBinding cache.

func NewClusterRoleBinding Uses

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

NewClusterRoleBinding returns a new ClusterRoleBinding cache.

func (*ClusterRoleBinding) ListClusterRoleBindings Uses

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

ListClusterRoleBindings returns all available ClusterRoleBindings on the cluster.

type ConfigMap Uses

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

ConfigMap represents ConfigMap cache.

func NewConfigMap Uses

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

NewConfigMap returns a new ConfigMap cache.

func (*ConfigMap) ListConfigMaps Uses

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

ListConfigMaps returns all available ConfigMaps on the cluster.

type DaemonSet Uses

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

DaemonSet represents DaemonSet cache.

func NewDaemonSet Uses

func NewDaemonSet(ds map[string]*appsv1.DaemonSet) *DaemonSet

NewDaemonSet returns a new DaemonSet cache.

func (*DaemonSet) ListDaemonSets Uses

func (d *DaemonSet) ListDaemonSets() map[string]*appsv1.DaemonSet

ListDaemonSets returns all available DaemonSets on the cluster.

type Deployment Uses

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

Deployment represents Deployment cache.

func NewDeployment Uses

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

NewDeployment returns a new Deployment cache.

func (*Deployment) ListDeployments Uses

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

ListDeployments returns all available Deployments on the cluster.

type Empty Uses

type Empty struct{}

Empty denotes an empty value.

type Endpoints Uses

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

Endpoints represents Endpoints cache.

func NewEndpoints Uses

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

NewEndpoints returns a new Endpoints cache.

func (*Endpoints) GetEndpoints Uses

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

GetEndpoints returns all available Endpoints on the cluster.

type HorizontalPodAutoscaler Uses

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

HorizontalPodAutoscaler represents a collection of HorizontalPodAutoScalers available on a cluster.

func NewHorizontalPodAutoscaler Uses

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

NewHorizontalPodAutoscaler returns a new HorizontalPodAutoScaler.

func (*HorizontalPodAutoscaler) ListHorizontalPodAutoscalers Uses

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

ListHorizontalPodAutoscalers returns all available HorizontalPodAutoScalers on the cluster.

type Ingress Uses

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

Ingress represents Ingress cache.

func NewIngress Uses

func NewIngress(ings map[string]*nv1beta1.Ingress) *Ingress

NewIngress returns a new Ingress cache.

func (*Ingress) ListIngresses Uses

func (d *Ingress) ListIngresses() map[string]*nv1beta1.Ingress

ListIngresses returns all available Ingresss on the cluster.

type LimitRange Uses

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

LimitRange represents LimitRange cache.

func NewLimitRange Uses

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

NewLimitRange returns a new LimitRange cache.

func (*LimitRange) ListLimitRanges Uses

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

ListLimitRanges returns all available LimitRanges on the cluster.

type Namespace Uses

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

Namespace represents a collection of Namespaces available on a cluster.

func NewNamespace Uses

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

NewNamespace returns a new Namespace.

func (*Namespace) ListNamespaces Uses

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

ListNamespaces returns all available Namespaces on the cluster.

func (*Namespace) ListNamespacesBySelector Uses

func (n *Namespace) ListNamespacesBySelector(sel *metav1.LabelSelector) map[string]*v1.Namespace

ListNamespacesBySelector list all pods matching the given selector.

type NetworkPolicy Uses

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

NetworkPolicy represents NetworkPolicy cache.

func NewNetworkPolicy Uses

func NewNetworkPolicy(nps map[string]*nv1.NetworkPolicy) *NetworkPolicy

NewNetworkPolicy returns a new NetworkPolicy cache.

func (*NetworkPolicy) ListNetworkPolicies Uses

func (d *NetworkPolicy) ListNetworkPolicies() map[string]*nv1.NetworkPolicy

ListNetworkPolicies returns all available NetworkPolicys on the cluster.

type Node Uses

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

Node represents a collection of Nodes available on a cluster.

func NewNode Uses

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

NewNode returns a new Node.

func (*Node) ListNodes Uses

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

ListNodes returns all available Nodes on the cluster.

type NodesMetrics Uses

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

NodesMetrics represents a Node metrics cache.

func NewNodesMetrics Uses

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

NewNodesMetrics returns new Node metrics cache.

func (*NodesMetrics) ListClusterMetrics Uses

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

ListClusterMetrics collects total available cpu and mem on the cluster.

func (*NodesMetrics) ListNodesMetrics Uses

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

ListNodesMetrics returns all available NodeMetrics on the cluster.

type ObjReferences Uses

type ObjReferences map[string]StringSet

ObjReferences tracks kubernetes object references.

type PersistentVolume Uses

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

PersistentVolume represents a collection of PersistentVolumes available on a cluster.

func NewPersistentVolume Uses

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

NewPersistentVolume returns a new PersistentVolume.

func (*PersistentVolume) ListPersistentVolumes Uses

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

ListPersistentVolumes returns all available PersistentVolumes on the cluster.

type PersistentVolumeClaim Uses

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

PersistentVolumeClaim represents a collection of PersistentVolumeClaims available on a cluster.

func NewPersistentVolumeClaim Uses

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

NewPersistentVolumeClaim returns a new PersistentVolumeClaim.

func (*PersistentVolumeClaim) ListPersistentVolumeClaims Uses

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

ListPersistentVolumeClaims returns all available PersistentVolumeClaims on the cluster.

type Pod Uses

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

Pod represents a Pod cache.

func NewPod Uses

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

NewPod returns a Pod cache.

func (*Pod) GetPod Uses

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

GetPod returns a pod via a label query.

func (*Pod) ListPods Uses

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

ListPods return available pods.

func (*Pod) ListPodsBySelector Uses

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

ListPodsBySelector list all pods matching the given selector.

func (*Pod) PodRefs Uses

func (p *Pod) PodRefs(refs ObjReferences)

PodRefs computes all pods external references.

type PodDisruptionBudget Uses

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

PodDisruptionBudget represents PodDisruptionBudget cache.

func NewPodDisruptionBudget Uses

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

NewPodDisruptionBudget returns a new PodDisruptionBudget cache.

func (*PodDisruptionBudget) ForLabels Uses

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 Uses

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

ListPodDisruptionBudgets returns all available PodDisruptionBudgets on the cluster.

type PodSecurityPolicy Uses

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

PodSecurityPolicy represents PodSecurityPolicy cache.

func NewPodSecurityPolicy Uses

func NewPodSecurityPolicy(psps map[string]*pv1beta1.PodSecurityPolicy) *PodSecurityPolicy

NewPodSecurityPolicy returns a new PodSecurityPolicy cache.

func (*PodSecurityPolicy) ListPodSecurityPolicies Uses

func (p *PodSecurityPolicy) ListPodSecurityPolicies() map[string]*pv1beta1.PodSecurityPolicy

ListPodSecurityPolicies returns all available PodSecurityPolicies on the cluster.

type PodsMetrics Uses

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

PodsMetrics represents a Pod metrics cache.

func NewPodsMetrics Uses

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

NewPodsMetrics returns new Pod metrics cache.

func (*PodsMetrics) ListPodsMetrics Uses

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

ListPodsMetrics returns all available PodMetrics on the cluster.

type ReplicaSet Uses

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

ReplicaSet represents ReplicaSet cache.

func NewReplicaSet Uses

func NewReplicaSet(rss map[string]*appsv1.ReplicaSet) *ReplicaSet

NewReplicaSet returns a new ReplicaSet cache.

func (*ReplicaSet) ListReplicaSets Uses

func (d *ReplicaSet) ListReplicaSets() map[string]*appsv1.ReplicaSet

ListReplicaSets returns all available ReplicaSets on the cluster.

type RoleBinding Uses

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

RoleBinding represents RoleBinding cache.

func NewRoleBinding Uses

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

NewRoleBinding returns a new RoleBinding cache.

func (*RoleBinding) ListRoleBindings Uses

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

ListRoleBindings returns all available RoleBindings on the cluster.

type Secret Uses

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

Secret represents a collection of Secrets available on a cluster.

func NewSecret Uses

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

NewSecret returns a new Secret cache.

func (*Secret) ListSecrets Uses

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

ListSecrets returns all available Secrets on the cluster.

type Service Uses

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

Service represents a collection of Services available on a cluster.

func NewService Uses

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

NewService returns a new Service.

func (*Service) ListServices Uses

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

ListServices returns all available Services on the cluster.

type ServiceAccount Uses

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

ServiceAccount tracks serviceaccounts.

func NewServiceAccount Uses

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

NewServiceAccount returns a new serviceaccount loader.

func (*ServiceAccount) ListServiceAccounts Uses

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

ListServiceAccounts list available ServiceAccounts.

func (*ServiceAccount) ServiceAccountRefs Uses

func (s *ServiceAccount) ServiceAccountRefs(refs ObjReferences)

ServiceAccountRefs computes all serviceaccount external references.

type StatefulSet Uses

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

StatefulSet represents a collection of StatefulSets available on a cluster.

func NewStatefulSet Uses

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

NewStatefulSet returns a new StatefulSet.

func (*StatefulSet) ListStatefulSets Uses

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

ListStatefulSets returns all available StatefulSets on the cluster.

type StringSet Uses

type StringSet map[string]Empty

StringSet represents a set of strings.

func (StringSet) Add Uses

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

Add a collection of elements to the set.

func (StringSet) Diff Uses

func (ss StringSet) Diff(set StringSet) StringSet

Diff computes B-A.

func (StringSet) Has Uses

func (ss StringSet) Has(s string) bool

Has checks if an item is in the set.

Package cache imports 12 packages (graph) and is imported by 2 packages. Updated 2019-08-29. Refresh now. Tools for package owners.