Documentation ¶
Index ¶
- type K8tricsPod
- type PodStore
- func (ps *PodStore) Delete(name, namespace string)
- func (ps *PodStore) Get(name, namespace string) (K8tricsPod, bool)
- func (ps *PodStore) GetByContainerID(containerID string) (*K8tricsPod, bool)
- func (ps *PodStore) GetByLabels(labels map[string]string) (pods []K8tricsPod)
- func (ps *PodStore) Upsert(pod v1.Pod)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type K8tricsPod ¶
K8tricsPod is a wrapper around v1.Pod struct and adds a few helper methods to it
func (K8tricsPod) ContainerIDs ¶
func (kp K8tricsPod) ContainerIDs() (ids []string)
GetContainerIDs return the SHA256 IDs of all of the containers within the pod
func (K8tricsPod) Endpoint ¶
func (kp K8tricsPod) Endpoint() (string, error)
Endpoint returns endpoint which can be hit to communicate with the given pod without assuming any protocol
The method returns the first endpoint it can find and will return an error if no endpoints are found
func (K8tricsPod) GetPod ¶
func (kp K8tricsPod) GetPod() *v1.Pod
GetPod returns a pointer to the internal Pod struct
type PodStore ¶
type PodStore struct {
// contains filtered or unexported fields
}
PodStore is an in memory store for storing pod info
func New ¶
func New() *PodStore
New returns a new instance of pod store - pod store can be used to store pod info in memory
func (*PodStore) Delete ¶
Delete takes in a name and namespace of a pod and deletes the entry corresponding to the name and namespace
func (*PodStore) Get ¶
func (ps *PodStore) Get(name, namespace string) (K8tricsPod, bool)
Get takes in name and namespace of a pod and returns the pod
func (*PodStore) GetByContainerID ¶
func (ps *PodStore) GetByContainerID(containerID string) (*K8tricsPod, bool)
GetByContainerID takes in a container ID and returns the pod that is running the container
func (*PodStore) GetByLabels ¶
func (ps *PodStore) GetByLabels(labels map[string]string) (pods []K8tricsPod)
GetByLabels and returns all of the pods which have the label attached