Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package generic provides a generic object store interface and a generic label/field matching type.
Index ¶
- func AddObjectMetaFieldsSet(source fields.Set, objectMeta *metav1.ObjectMeta, hasNamespaceField bool) fields.Set
 - func MergeFieldsSets(source fields.Set, fragment fields.Set) fields.Set
 - func NewRawStorage(config *storagebackend.Config) (storage.Interface, factory.DestroyFunc)
 - func ObjectMetaFieldsSet(objectMeta *metav1.ObjectMeta, hasNamespaceField bool) fields.Set
 - func UndecoratedStorage(config *storagebackend.Config, objectType runtime.Object, ...) (storage.Interface, factory.DestroyFunc)
 - type RESTOptions
 - type RESTOptionsGetter
 - type StorageDecorator
 - type StoreOptions
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddObjectMetaFieldsSet ¶
func AddObjectMetaFieldsSet(source fields.Set, objectMeta *metav1.ObjectMeta, hasNamespaceField bool) fields.Set
AdObjectMetaField add fields that represent the ObjectMeta to source.
func MergeFieldsSets ¶
MergeFieldsSets merges a fields'set from fragment into the source.
func NewRawStorage ¶
func NewRawStorage(config *storagebackend.Config) (storage.Interface, factory.DestroyFunc)
NewRawStorage creates the low level kv storage. This is a work-around for current two layer of same storage interface. TODO: Once cacher is enabled on all registries (event registry is special), we will remove this method.
func ObjectMetaFieldsSet ¶
func ObjectMetaFieldsSet(objectMeta *metav1.ObjectMeta, hasNamespaceField bool) fields.Set
ObjectMetaFieldsSet returns a fields that represent the ObjectMeta.
func UndecoratedStorage ¶
func UndecoratedStorage( config *storagebackend.Config, objectType runtime.Object, resourcePrefix string, keyFunc func(obj runtime.Object) (string, error), newListFunc func() runtime.Object, getAttrsFunc storage.AttrFunc, trigger storage.TriggerPublisherFunc) (storage.Interface, factory.DestroyFunc)
UndecoratedStorage returns the given a new storage from the given config without any decoration.
Types ¶
type RESTOptions ¶
type RESTOptions struct {
	StorageConfig *storagebackend.Config
	Decorator     StorageDecorator
	EnableGarbageCollection bool
	DeleteCollectionWorkers int
	ResourcePrefix          string
	CountMetricPollPeriod   time.Duration
}
    RESTOptions is set of configuration options to generic registries.
func (RESTOptions) GetRESTOptions ¶
func (opts RESTOptions) GetRESTOptions(schema.GroupResource) (RESTOptions, error)
Implement RESTOptionsGetter so that RESTOptions can directly be used when available (i.e. tests)
type RESTOptionsGetter ¶
type RESTOptionsGetter interface {
	GetRESTOptions(resource schema.GroupResource) (RESTOptions, error)
}
    type StorageDecorator ¶
type StorageDecorator func( config *storagebackend.Config, objectType runtime.Object, resourcePrefix string, keyFunc func(obj runtime.Object) (string, error), newListFunc func() runtime.Object, getAttrsFunc storage.AttrFunc, trigger storage.TriggerPublisherFunc) (storage.Interface, factory.DestroyFunc)
StorageDecorator is a function signature for producing a storage.Interface and an associated DestroyFunc from given parameters.
type StoreOptions ¶
type StoreOptions struct {
	RESTOptions RESTOptionsGetter
	TriggerFunc storage.TriggerPublisherFunc
	AttrFunc    storage.AttrFunc
}
    StoreOptions is set of configuration options used to complete generic registries.