store

package
v3.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStatsOutput

func GetStatsOutput(stats []*Stats) string

func SetStoreConfigCli

func SetStoreConfigCli(fs *pflag.FlagSet)

Types

type Stats

type Stats struct {
	ResourceType     resources.ResourceType
	ItemPerNamespace map[string]int
	LastDumped       time.Time
}

func GetStatsFromStores

func GetStatsFromStores(stores []*Store) []*Stats

type Store

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

Store stores the current state of k8s resources

func NewStore

func NewStore(ctx context.Context, storeConfig *StoreConfig,
	ctorConfig resources.CtorConfig, resourceType resources.ResourceType) *Store

NewStore creates a new store

func (*Store) AddResource

func (k *Store) AddResource(obj interface{})

AddResource adds a new k8s object to the store

func (*Store) AddResourceList

func (k *Store) AddResourceList(lstRuntime []runtime.Object)

AddResourceList clears current state add the objects to the store. It will trigger a full dump This is used for polled resources, no need for mutex

func (*Store) DeleteResource

func (k *Store) DeleteResource(obj interface{})

DeleteResource removes an existing k8s object to the store

func (*Store) DumpFullState

func (k *Store) DumpFullState() error

DumpFullState writes the full state to the cache file

func (*Store) GetStats

func (k *Store) GetStats() *Stats

func (*Store) UpdateResource

func (k *Store) UpdateResource(oldObj, newObj interface{})

UpdateResource update an existing k8s object

type StoreConfig

type StoreConfig struct {
	clusterconfig.ClusterConfig
	// contains filtered or unexported fields
}

StoreConfig defines configuration to store This is shared between all resources

func NewStoreConfig

func NewStoreConfig(storeConfigCli *StoreConfigCli) *StoreConfig

func (*StoreConfig) GetTimeBetweenFullDump

func (s *StoreConfig) GetTimeBetweenFullDump() time.Duration

type StoreConfigCli

type StoreConfigCli struct {
	*clusterconfig.ClusterConfigCli
	TimeBetweenFullDump time.Duration
}

func GetStoreConfigCli

func GetStoreConfigCli() StoreConfigCli

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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