package selectors
import "k8s.io/kubernetes/pkg/controller/util/selectors"
Index ¶
- type BiMultimap
- func NewBiMultimap() *BiMultimap
- func (m *BiMultimap) Delete(key Key)
- func (m *BiMultimap) DeleteSelector(key Key)
- func (m *BiMultimap) Exists(key Key) bool
- func (m *BiMultimap) KeepOnly(keys []Key)
- func (m *BiMultimap) KeepOnlySelectors(keys []Key)
- func (m *BiMultimap) Put(key Key, labels map[string]string)
- func (m *BiMultimap) PutSelector(key Key, selector pkglabels.Selector)
- func (m *BiMultimap) ReverseSelect(key Key) (keys []Key, ok bool)
- func (m *BiMultimap) Select(key Key) (keys []Key, ok bool)
- func (m *BiMultimap) SelectorExists(key Key) bool
- type Key
Types ¶
type BiMultimap ¶
type BiMultimap struct {
// contains filtered or unexported fields
}
BiMultimap is an efficient, bi-directional mapping of object keys. Associations are created by putting keys with a selector.
func NewBiMultimap ¶
func NewBiMultimap() *BiMultimap
NewBiMultimap creates a map.
func (*BiMultimap) Delete ¶
func (m *BiMultimap) Delete(key Key)
Delete removes a labeled object and incoming associations.
func (*BiMultimap) DeleteSelector ¶
func (m *BiMultimap) DeleteSelector(key Key)
DeleteSelector deletes a selecting object and associations created by its selector.
func (*BiMultimap) Exists ¶
func (m *BiMultimap) Exists(key Key) bool
Exists returns true if the labeled object is present in the map.
func (*BiMultimap) KeepOnly ¶
func (m *BiMultimap) KeepOnly(keys []Key)
KeepOnly retains only the specified labeled objects and deletes the rest. Like calling Delete for all keys not specified.
func (*BiMultimap) KeepOnlySelectors ¶
func (m *BiMultimap) KeepOnlySelectors(keys []Key)
KeepOnlySelectors retains only the specified selecting objects and deletes the rest. Like calling DeleteSelector for all keys not specified.
func (*BiMultimap) Put ¶
func (m *BiMultimap) Put(key Key, labels map[string]string)
Put inserts or updates an object and the incoming associations based on the object labels.
func (*BiMultimap) PutSelector ¶
func (m *BiMultimap) PutSelector(key Key, selector pkglabels.Selector)
PutSelector inserts or updates an object with a selector. Associations are created or updated based on the selector.
func (*BiMultimap) ReverseSelect ¶
func (m *BiMultimap) ReverseSelect(key Key) (keys []Key, ok bool)
ReverseSelect finds objects selecting the given object. If the given key was found in the map `ok` will be true. Otherwise false.
func (*BiMultimap) Select ¶
func (m *BiMultimap) Select(key Key) (keys []Key, ok bool)
Select finds objects associated with a selecting object. If the given key was found in the map `ok` will be true. Otherwise false.
func (*BiMultimap) SelectorExists ¶
func (m *BiMultimap) SelectorExists(key Key) bool
SelectorExists returns true if the selecting object is present in the map.
type Key ¶
Key is a tuple of name and namespace.
func Parse ¶
Parse turns a string in the format namespace/name into a Key.
func (Key) String ¶
Source Files ¶
bimultimap.go
- Version
- v1.33.1 (latest)
- Published
- May 15, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 11 hours ago –
Tools for package owners.