store

package
v0.0.0-...-d6ccb9e Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobalSyncCallback

func GlobalSyncCallback(
	ctx context.Context,
	syncer ResourceSyncer,
	k8sStore bool,
	kubeFactory resources_k8s.KubeFactory,
	systemNamespace string,
) *client.Callbacks

func ZoneSyncCallback

func ZoneSyncCallback(ctx context.Context, configToSync map[string]bool, syncer ResourceSyncer, k8sStore bool, localZone string, kubeFactory resources_k8s.KubeFactory, systemNamespace string) *client.Callbacks

Types

type OnUpdate

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

type ResourceSyncer

type ResourceSyncer interface {
	// Sync method takes 'upstream' as a basis and synchronize underlying store.
	// It deletes resources that were removed in the upstream, creates new resources that
	// are not represented in store yet and updates the rest.
	// Using 'PrefilterBy' option Sync allows to select scope of resources that will be
	// affected by Sync
	//
	// Sync takes into account only 'Name' and 'Mesh' when it comes to upstream's Meta.
	// 'Version', 'CreationTime' and 'ModificationTime' are managed by downstream store.
	Sync(ctx context.Context, upstream client.UpstreamResponse, fs ...SyncOptionFunc) error
}

ResourceSyncer allows to synchronize resources in Store

func NewResourceSyncer

func NewResourceSyncer(
	log logr.Logger,
	resourceStore core_manager.ResourceManager,
	transactions store.Transactions,
	extensions context.Context,
) (ResourceSyncer, error)

type SyncOption

type SyncOption struct {
	Predicate func(r core_model.Resource) bool
	Zone      string
}

func NewSyncOptions

func NewSyncOptions(fs ...SyncOptionFunc) *SyncOption

type SyncOptionFunc

type SyncOptionFunc func(*SyncOption)

func PrefilterBy

func PrefilterBy(predicate func(r core_model.Resource) bool) SyncOptionFunc

func Zone

func Zone(name string) SyncOptionFunc

Jump to

Keyboard shortcuts

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