Documentation ¶
Index ¶
- Constants
- func NewStore(ctx context.Context, cachedVirtualClient, cachedHostClient client.Client, ...) (synccontext.MappingsStore, error)
- func NewStoreWithVerifyMapping(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) AddReference(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
- func (s *Store) AddReferenceAndSave(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
- func (s *Store) DeleteMapping(ctx context.Context, nameMapping synccontext.NameMapping) error
- func (s *Store) DeleteReference(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
- func (s *Store) DeleteReferenceAndSave(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
- 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) 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
- type VerifyMapping
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)
func NewStoreWithVerifyMapping ¶
func NewStoreWithVerifyMapping(ctx context.Context, cachedVirtualClient, cachedHostClient client.Client, backend Backend, verifyMapping VerifyMapping) (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"` Sender string `json:"sender,omitempty"` References []synccontext.NameMapping `json:"references,omitempty"` // contains filtered or unexported fields }
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AddReference ¶
func (s *Store) AddReference(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
func (*Store) AddReferenceAndSave ¶
func (s *Store) AddReferenceAndSave(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
func (*Store) DeleteMapping ¶
func (s *Store) DeleteMapping(ctx context.Context, nameMapping synccontext.NameMapping) error
func (*Store) DeleteReference ¶
func (s *Store) DeleteReference(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
func (*Store) DeleteReferenceAndSave ¶
func (s *Store) DeleteReferenceAndSave(ctx context.Context, nameMapping, belongsTo synccontext.NameMapping) error
func (*Store) HasHostObject ¶
func (*Store) HasVirtualObject ¶
func (*Store) HostToVirtualName ¶
func (s *Store) HostToVirtualName(_ context.Context, pObj synccontext.Object) (types.NamespacedName, bool)
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
type VerifyMapping ¶
type VerifyMapping func(mapping synccontext.NameMapping) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.