Documentation ¶
Index ¶
- Constants
- func NewStore(ctx context.Context, cachedVirtualClient, cachedHostClient client.Client, ...) (synccontext.MappingsStore, error)
- type Backend
- type BackendWatchEvent
- type BackendWatchEventType
- type BackendWatchResponse
- type Mapping
- type Store
- func (s *Store) HasHostObject(ctx context.Context, pObj synccontext.Object) bool
- func (s *Store) HasVirtualObject(ctx context.Context, vObj synccontext.Object) bool
- func (s *Store) HostToVirtualName(_ context.Context, pObj synccontext.Object) (types.NamespacedName, bool)
- func (s *Store) RecordAndSaveReference(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
- func (s *Store) RecordReference(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
- func (s *Store) ReferencesTo(ctx context.Context, vObj synccontext.Object) []synccontext.NameMapping
- func (s *Store) SaveMapping(ctx context.Context, nameMapping synccontext.NameMapping) error
- func (s *Store) StartGarbageCollection(ctx context.Context)
- func (s *Store) VirtualToHostName(_ context.Context, vObj synccontext.Object) (types.NamespacedName, bool)
- func (s *Store) Watch(gvk schema.GroupVersionKind, addQueueFn synccontext.AddQueueFunc) source.Source
Constants ¶
View Source
const GarbageCollectionInterval = time.Minute * 3
Variables ¶
This section is empty.
Functions ¶
func NewStore ¶
func NewStore(ctx context.Context, cachedVirtualClient, cachedHostClient client.Client, backend Backend) (synccontext.MappingsStore, error)
Types ¶
type Backend ¶
type Backend interface { // List retrieves all saved mappings List(ctx context.Context) ([]*Mapping, error) // Watch lists and watches for new mappings Watch(ctx context.Context) <-chan BackendWatchResponse // Save saves the given mapping Save(ctx context.Context, mapping *Mapping) error // Delete removes the given mapping Delete(ctx context.Context, mapping *Mapping) error }
func NewEtcdBackend ¶
func NewMemoryBackend ¶
type BackendWatchEvent ¶
type BackendWatchEvent struct { Type BackendWatchEventType Mapping *Mapping }
type BackendWatchEventType ¶
type BackendWatchEventType string
const ( BackendWatchEventTypeUpdate BackendWatchEventType = "Update" BackendWatchEventTypeDelete BackendWatchEventType = "Delete" )
type BackendWatchResponse ¶
type BackendWatchResponse struct { Events []*BackendWatchEvent Err error }
type Mapping ¶
type Mapping struct { synccontext.NameMapping `json:",inline"` References []synccontext.NameMapping `json:"references,omitempty"` // contains filtered or unexported fields }
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) HasHostObject ¶
func (*Store) HasVirtualObject ¶
func (*Store) HostToVirtualName ¶
func (s *Store) HostToVirtualName(_ context.Context, pObj synccontext.Object) (types.NamespacedName, bool)
func (*Store) RecordAndSaveReference ¶
func (s *Store) RecordAndSaveReference(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
func (*Store) RecordReference ¶
func (s *Store) RecordReference(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
func (*Store) ReferencesTo ¶
func (s *Store) ReferencesTo(ctx context.Context, vObj synccontext.Object) []synccontext.NameMapping
func (*Store) SaveMapping ¶
func (s *Store) SaveMapping(ctx context.Context, nameMapping synccontext.NameMapping) error
func (*Store) StartGarbageCollection ¶
func (*Store) VirtualToHostName ¶
func (s *Store) VirtualToHostName(_ context.Context, vObj synccontext.Object) (types.NamespacedName, bool)
func (*Store) Watch ¶
func (s *Store) Watch(gvk schema.GroupVersionKind, addQueueFn synccontext.AddQueueFunc) source.Source
Click to show internal directories.
Click to hide internal directories.