Documentation ¶
Index ¶
- func IndexFunction(data interface{}) map[string][]string
- type ConfigIndex
- func (ci *ConfigIndex) ListAll() (namespaceIDs []string)
- func (ci *ConfigIndex) LookupNamespace(namespaceID string) (found bool, data *namespacemodel.Namespace)
- func (ci *ConfigIndex) LookupNamespacesByKey(namespaceKeySelector string) (namespaceIDs []string)
- func (ci *ConfigIndex) LookupNamespacesByLabelSelector(namespaceLabelSelector string) (namespaceIDs []string)
- func (ci *ConfigIndex) RegisterNamespace(namespaceID string, data *namespacemodel.Namespace)
- func (ci *ConfigIndex) UnRegisterNamespace(namespaceID string) (found bool, data *namespacemodel.Namespace)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexFunction ¶
IndexFunction creates secondary indexes. Currently podName and podNamespace fields are indexed.
Types ¶
type ConfigIndex ¶
type ConfigIndex struct {
// contains filtered or unexported fields
}
ConfigIndex implements a cache for configured Namespaces. Primary index is PolicyName.
func NewConfigIndex ¶
func NewConfigIndex(logger logging.Logger, title string) *ConfigIndex
NewConfigIndex creates new instance of ConfigIndex
func (*ConfigIndex) ListAll ¶
func (ci *ConfigIndex) ListAll() (namespaceIDs []string)
ListAll returns all registered namespaces in the mapping.
func (*ConfigIndex) LookupNamespace ¶
func (ci *ConfigIndex) LookupNamespace(namespaceID string) (found bool, data *namespacemodel.Namespace)
LookupNamespace looks up the entry of a Namespace given a namespace ID
func (*ConfigIndex) LookupNamespacesByKey ¶
func (ci *ConfigIndex) LookupNamespacesByKey(namespaceKeySelector string) (namespaceIDs []string)
LookupNamespacesByKey performs lookup based on secondary index podNamespace/podLabelKey.
func (*ConfigIndex) LookupNamespacesByLabelSelector ¶
func (ci *ConfigIndex) LookupNamespacesByLabelSelector(namespaceLabelSelector string) (namespaceIDs []string)
LookupNamespacesByLabelSelector performs lookup based on secondary index namespaceLabelSelector.
func (*ConfigIndex) RegisterNamespace ¶
func (ci *ConfigIndex) RegisterNamespace(namespaceID string, data *namespacemodel.Namespace)
RegisterNamespace adds new Namespace entry into the mapping
func (*ConfigIndex) UnRegisterNamespace ¶
func (ci *ConfigIndex) UnRegisterNamespace(namespaceID string) (found bool, data *namespacemodel.Namespace)
UnRegisterNamespace removes the Namespace entry from the mapping