Documentation ¶
Index ¶
- func Cast[T any](o runtime.Object) (T, error)
- func LoadResource[T metav1.ObjectMetaAccessor](ctx context.Context, l *Loader, gvr types.GVR) error
- func MatchLabels(labels, sel map[string]string) bool
- func MatchSelector(labels map[string]string, sel *metav1.LabelSelector) bool
- func Save[T metav1.ObjectMetaAccessor](ctx context.Context, dba *DB, gvr types.GVR, oo []runtime.Object) error
- type CastFn
- type ConvertFn
- type DB
- func (db *DB) Dump(gvr types.GVR)
- func (db *DB) Exists(kind types.GVR, fqn string) bool
- func (db *DB) Find(kind types.GVR, fqn string) (any, error)
- func (db *DB) FindJobs(fqn string) ([]*batchv1.Job, error)
- func (db *DB) FindNMX(fqn string) (*mv1beta1.NodeMetrics, error)
- func (db *DB) FindNS(ns string) (*v1.Namespace, error)
- func (db *DB) FindNSBySel(sel *metav1.LabelSelector) ([]*v1.Namespace, error)
- func (db *DB) FindNSNameBySel(sel *metav1.LabelSelector) ([]string, error)
- func (db *DB) FindPMX(fqn string) (*mv1beta1.PodMetrics, error)
- func (db *DB) FindPod(ns string, sel map[string]string) (*v1.Pod, error)
- func (db *DB) FindPods(ns string, sel map[string]string) ([]*v1.Pod, error)
- func (db *DB) FindPodsBySel(ns string, sel *metav1.LabelSelector) ([]*v1.Pod, error)
- func (db *DB) ITFor(gvr types.GVR) (*memdb.Txn, memdb.ResultIterator, error)
- func (db *DB) ListNMX() ([]*mv1beta1.NodeMetrics, error)
- func (db *DB) ListNodes() (map[string]*v1.Node, error)
- func (db *DB) MustITFor(gvr types.GVR) (*memdb.Txn, memdb.ResultIterator)
- func (db *DB) MustITForNS(gvr types.GVR, ns string) (*memdb.Txn, memdb.ResultIterator)
- type Loader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadResource ¶
LoadResource loads resource and save to db.
func MatchLabels ¶
MatchLabels check if pod labels match a selector.
func MatchSelector ¶
func MatchSelector(labels map[string]string, sel *metav1.LabelSelector) bool
MatchSelector check if pod labels match a selector.
Types ¶
type DB ¶
type DB struct {
*memdb.MemDB
}
func (*DB) FindNSBySel ¶
func (*DB) FindNSNameBySel ¶
func (db *DB) FindNSNameBySel(sel *metav1.LabelSelector) ([]string, error)
func (*DB) FindPodsBySel ¶
Click to show internal directories.
Click to hide internal directories.