store

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceSyncer

type ResourceSyncer interface {
	// Sync method takes 'upstream' as a basis and synchronize underlying store.
	// It deletes all resources that absent in '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(upstream model.ResourceList, fs ...SyncOptionFunc) error
}

ResourceSyncer allows to synchronize resources in Store

func NewResourceSyncer

func NewResourceSyncer(log logr.Logger, resourceStore store.ResourceStore) ResourceSyncer

type SyncOption

type SyncOption struct {
	Predicate func(r 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 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