scraper

package
v0.0.0-...-9db51f9 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectGarbage

func CollectGarbage(ctx context.Context, queries *queries.Queries, factory informers.SharedInformerFactory) error

func StartGarbageCollector

func StartGarbageCollector(ctx context.Context, queries *queries.Queries, factory informers.SharedInformerFactory)

func StartScraper

func StartScraper(ctx context.Context, queries *queries.Queries, clientSet *kubernetes.Clientset, interval time.Duration, disableScrapingDelay bool) error

func WithTransaction

func WithTransaction(ctx context.Context, conn *pgx.Conn, f func(tx pgx.Tx) error) error

Types

type Manager

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

func NewManager

func NewManager(ctx context.Context, disableScrapingDelay bool) *Manager

func (*Manager) AddTarget

func (m *Manager) AddTarget(id string, scrapeFunc ScrapeFunc, interval time.Duration)

func (*Manager) RemoveTarget

func (m *Manager) RemoveTarget(id string)

type NodeEventHandler

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

func NewNodeEventHandler

func NewNodeEventHandler(
	manager *Manager,
	k8sClient k8s.ClientInterface,
	queries *queries.Queries,
	interval time.Duration,
	cache PodCache,
) *NodeEventHandler

func (*NodeEventHandler) OnAdd

func (h *NodeEventHandler) OnAdd(obj interface{}, isInInitialList bool)

func (*NodeEventHandler) OnDelete

func (h *NodeEventHandler) OnDelete(obj interface{})

func (*NodeEventHandler) OnUpdate

func (h *NodeEventHandler) OnUpdate(oldObj, obj interface{})

type NodeScraper

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

func NewNodeScrapper

func NewNodeScrapper(name string, k8sClients k8s.ClientInterface, queries *queries.Queries, cache PodCache) *NodeScraper

func (*NodeScraper) Scrape

func (s *NodeScraper) Scrape(ctx context.Context) error

type PersistObjectHandler

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

func NewPersistObjectHandler

func NewPersistObjectHandler(queries *queries.Queries, kind string) *PersistObjectHandler

func (*PersistObjectHandler) OnAdd

func (h *PersistObjectHandler) OnAdd(obj interface{}, isInInitialList bool)

func (*PersistObjectHandler) OnDelete

func (h *PersistObjectHandler) OnDelete(obj interface{})

func (*PersistObjectHandler) OnUpdate

func (h *PersistObjectHandler) OnUpdate(oldObj, newObj interface{})

func (*PersistObjectHandler) Upsert

func (h *PersistObjectHandler) Upsert(obj interface{})

type PodCache

type PodCache interface {
	Get(namespace, name string) (*v1.Pod, error)
}

type PodCacheK8s

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

PodCacheK8s is a wrapper around listerv1.PodLister original client is hard to mock wrapper provides an easier to use interface

func NewPodCacheK8s

func NewPodCacheK8s(lister listerv1.PodLister) *PodCacheK8s

func (*PodCacheK8s) Get

func (p *PodCacheK8s) Get(namespace, name string) (*v1.Pod, error)

type PodLister

type PodLister listerv1.PodLister

type alias for mock generation

type PodNamespaceLister

type PodNamespaceLister listerv1.PodNamespaceLister

type ScrapeFunc

type ScrapeFunc func(ctx context.Context) error

Jump to

Keyboard shortcuts

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