store

package
v0.0.0-...-2f79454 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8tricsPod

type K8tricsPod struct {
	v1.Pod
}

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

func (ps *PodStore) Delete(name, namespace string)

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

func (*PodStore) Upsert

func (ps *PodStore) Upsert(pod v1.Pod)

Upsert takes in pod and adds that pod to the pod store

Jump to

Keyboard shortcuts

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