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

package cache

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


Package Files

cluster.go cm.go cr.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 role.go rs.go sa.go sec.go sts.go svc.go


const ClusterKey = "cl"

ClusterKey tracks Cluster resource references

const ClusterRoleKey = "clusterrole"

ClusterRoleKey tracks ClusterRole resource references

const ConfigMapKey = "cm"

ConfigMapKey tracks ConfigMap resource references

const DaemonSetKey = "ds"

DaemonSetKey tracks DaemonSet resource references

const DeploymentKey = "dp"

DeploymentKey tracks Deployment resource references

const IngressKey = "ing"

IngressKey tracks Ingress resource references

const LimitRangeKey = "lr"

LimitRangeKey tracks LimitRange resource references

const NetworkPolicyKey = "np"

NetworkPolicyKey tracks NetworkPolicy resource references

const PodDisruptionBudgetKey = "pdb"

PodDisruptionBudgetKey tracks PodDisruptionBudget resource references

const PodSecurityPolicyKey = "psp"

PodSecurityPolicyKey tracks PodSecurityPolicy resource references

const ReplicaSetKey = "ds"

ReplicaSetKey tracks ReplicaSet resource references

const RoleKey = "role"

RoleKey represents a role identifier.

const SecretKey = "sec"

SecretKey tracks Secret resource references

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 ClusterRole Uses

type ClusterRole struct {
    // contains filtered or unexported fields

ClusterRole represents ClusterRole cache.

func NewClusterRole Uses

func NewClusterRole(crs map[string]*rbacv1.ClusterRole) *ClusterRole

NewClusterRole returns a new ClusterRole cache.

func (*ClusterRole) ListClusterRoles Uses

func (c *ClusterRole) ListClusterRoles() map[string]*rbacv1.ClusterRole

ListClusterRoles returns all available ClusterRoles on the cluster.

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) ClusterRoleRefs Uses

func (c *ClusterRoleBinding) ClusterRoleRefs(refs *sync.Map)

ClusterRoleRefs computes all clusterrole external references.

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 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) IngressRefs Uses

func (d *Ingress) IngressRefs(refs *sync.Map)

IngressRefs computes all ingress external references.

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) ListAllocatedMetrics Uses

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

ListAllocatedMetrics collects total used cpu and mem on the cluster.

func (*NodesMetrics) ListAvailableMetrics Uses

func (n *NodesMetrics) ListAvailableMetrics(nn map[string]*v1.Node) v1.ResourceList

ListAvailableMetrics return the total cluster available cpu/mem.

func (*NodesMetrics) ListNodesMetrics Uses

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

ListNodesMetrics returns all available NodeMetrics on the cluster.

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(ns string, 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(ns string, sel *metav1.LabelSelector) map[string]*v1.Pod

ListPodsBySelector list all pods matching the given selector.

func (*Pod) PodRefs Uses

func (p *Pod) PodRefs(refs *sync.Map)

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 Role Uses

type Role struct {
    // contains filtered or unexported fields

Role represents Role cache.

func NewRole Uses

func NewRole(ros map[string]*rbacv1.Role) *Role

NewRole returns a new Role cache.

func (*Role) ListRoles Uses

func (r *Role) ListRoles() map[string]*rbacv1.Role

ListRoles returns all available Roles on the cluster.

type RoleBinding Uses

type RoleBinding struct {
    // contains filtered or unexported fields

RoleBinding represents RoleBinding cache.

func NewRoleBinding Uses

func NewRoleBinding(rbs 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.

func (*RoleBinding) RoleRefs Uses

func (r *RoleBinding) RoleRefs(refs *sync.Map)

RoleRefs computes all role external references.

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 *sync.Map)

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.

Package cache imports 13 packages (graph) and is imported by 2 packages. Updated 2020-08-05. Refresh now. Tools for package owners.