cache

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ClusterKey = "cl"

ClusterKey tracks Cluster resource references

View Source
const ClusterRoleKey = "clusterrole"

ClusterRoleKey tracks ClusterRole resource references

View Source
const ConfigMapKey = "cm"

ConfigMapKey tracks ConfigMap resource references

View Source
const DaemonSetKey = "ds"

DaemonSetKey tracks DaemonSet resource references

View Source
const DeploymentKey = "dp"

DeploymentKey tracks Deployment resource references

View Source
const IngressKey = "ing"

IngressKey tracks Ingress resource references

View Source
const LimitRangeKey = "lr"

LimitRangeKey tracks LimitRange resource references

View Source
const NetworkPolicyKey = "np"

NetworkPolicyKey tracks NetworkPolicy resource references

View Source
const PodDisruptionBudgetKey = "pdb"

PodDisruptionBudgetKey tracks PodDisruptionBudget resource references

View Source
const PodSecurityPolicyKey = "psp"

PodSecurityPolicyKey tracks PodSecurityPolicy resource references

View Source
const ReplicaSetKey = "ds"

ReplicaSetKey tracks ReplicaSet resource references

View Source
const RoleKey = "role"

RoleKey represents a role identifier.

View Source
const SecretKey = "sec"

SecretKey tracks Secret resource references

Variables

This section is empty.

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 Cluster added in v0.4.0

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

Cluster represents Cluster cache.

func NewCluster added in v0.4.0

func NewCluster(major, minor string) *Cluster

NewCluster returns a new Cluster cache.

func (*Cluster) ListVersion added in v0.4.0

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

ListVersion returns cluster server version.

type ClusterRole added in v0.6.0

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

ClusterRole represents ClusterRole cache.

func NewClusterRole added in v0.6.0

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

NewClusterRole returns a new ClusterRole cache.

func (*ClusterRole) ListClusterRoles added in v0.6.0

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

ListClusterRoles returns all available ClusterRoles on the cluster.

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) ClusterRoleRefs added in v0.6.0

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

ClusterRoleRefs computes all clusterrole external references.

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 DaemonSet added in v0.4.0

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

DaemonSet represents DaemonSet cache.

func NewDaemonSet added in v0.4.0

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

NewDaemonSet returns a new DaemonSet cache.

func (*DaemonSet) ListDaemonSets added in v0.4.0

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

ListDaemonSets returns all available DaemonSets 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 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 Ingress added in v0.4.0

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

Ingress represents Ingress cache.

func NewIngress added in v0.4.0

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

NewIngress returns a new Ingress cache.

func (*Ingress) IngressRefs added in v0.5.0

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

IngressRefs computes all ingress external references.

func (*Ingress) ListIngresses added in v0.4.0

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

ListIngresses returns all available Ingresss 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.

func (*Namespace) ListNamespacesBySelector added in v0.4.0

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

ListNamespacesBySelector list all pods matching the given selector.

type NetworkPolicy added in v0.4.0

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

NetworkPolicy represents NetworkPolicy cache.

func NewNetworkPolicy added in v0.4.0

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

NewNetworkPolicy returns a new NetworkPolicy cache.

func (*NetworkPolicy) ListNetworkPolicies added in v0.4.0

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

ListNetworkPolicies returns all available NetworkPolicys 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) ListAllocatedMetrics added in v0.6.0

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

ListAllocatedMetrics collects total used cpu and mem on the cluster.

func (*NodesMetrics) ListAvailableMetrics added in v0.6.0

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

ListAvailableMetrics return the total cluster available cpu/mem.

func (*NodesMetrics) ListNodesMetrics

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

ListNodesMetrics returns all available NodeMetrics on the cluster.

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

ListPodsBySelector list all pods matching the given selector.

func (*Pod) PodRefs

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

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]*polv1beta1.PodDisruptionBudget) *PodDisruptionBudget

NewPodDisruptionBudget returns a new PodDisruptionBudget cache.

func (*PodDisruptionBudget) ForLabels added in v0.3.10

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]*polv1beta1.PodDisruptionBudget

ListPodDisruptionBudgets returns all available PodDisruptionBudgets on the cluster.

type PodSecurityPolicy added in v0.4.0

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

PodSecurityPolicy represents PodSecurityPolicy cache.

func NewPodSecurityPolicy added in v0.4.0

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

NewPodSecurityPolicy returns a new PodSecurityPolicy cache.

func (*PodSecurityPolicy) ListPodSecurityPolicies added in v0.4.0

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

ListPodSecurityPolicies returns all available PodSecurityPolicies 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 ReplicaSet added in v0.4.0

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

ReplicaSet represents ReplicaSet cache.

func NewReplicaSet added in v0.4.0

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

NewReplicaSet returns a new ReplicaSet cache.

func (*ReplicaSet) ListReplicaSets added in v0.4.0

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

ListReplicaSets returns all available ReplicaSets on the cluster.

type Role added in v0.6.0

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

Role represents Role cache.

func NewRole added in v0.6.0

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

NewRole returns a new Role cache.

func (*Role) ListRoles added in v0.6.0

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

ListRoles returns all available Roles on the cluster.

type RoleBinding

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

RoleBinding represents RoleBinding cache.

func NewRoleBinding

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

func (*RoleBinding) RoleRefs added in v0.6.0

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

RoleRefs computes all role external references.

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

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.

Jump to

Keyboard shortcuts

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