Documentation ¶
Index ¶
- func ByServiceSelector(namespace string, selector labels.Instance) func(*model.WorkloadInstance) bool
- func FindAllInIndex(index Index, predicate func(*model.WorkloadInstance) bool) []*model.WorkloadInstance
- func FindInstance(instances []*model.WorkloadInstance, ...) *model.WorkloadInstance
- func GetInstanceForProxy(index Index, proxy *model.Proxy, proxyIP string) *model.WorkloadInstance
- func InstanceNameForProxy(proxy *model.Proxy) types.NamespacedName
- type Index
- type MultiValueMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByServiceSelector ¶
func ByServiceSelector(namespace string, selector labels.Instance) func(*model.WorkloadInstance) bool
ByServiceSelector returns a predicate that matches workload instances of a given service.
func FindAllInIndex ¶
func FindAllInIndex(index Index, predicate func(*model.WorkloadInstance) bool) []*model.WorkloadInstance
FindAllInIndex returns a list of workload instances in the index that match given predicate.
The returned list is not ordered.
func FindInstance ¶
func FindInstance(instances []*model.WorkloadInstance, predicate func(*model.WorkloadInstance) bool) *model.WorkloadInstance
FindInstance returns the first workload instance matching given predicate.
func GetInstanceForProxy ¶
GetInstanceForProxy returns a workload instance that corresponds to a given proxy, if any.
func InstanceNameForProxy ¶
func InstanceNameForProxy(proxy *model.Proxy) types.NamespacedName
InstanceNameForProxy returns a name of the workload instance that corresponds to a given proxy, if any.
Types ¶
type Index ¶
type Index interface { // Insert adds/updates given workload instance to the index. // // Returns previous value in the index, or nil otherwise. Insert(*model.WorkloadInstance) *model.WorkloadInstance // Delete removes given workload instance from the index. // // Returns value removed from the index, or nil otherwise. Delete(*model.WorkloadInstance) *model.WorkloadInstance // GetByIP returns a list of all workload instances associated with a // given IP address. The list is ordered by namespace/name. // // There are several use cases where multiple workload instances might // have the same IP address: // 1) there are multiple Istio Proxies running on a single host, e.g. // in 'router' mode or even in 'sidecar' mode. // 2) workload instances have the same IP but different networks GetByIP(string) []*model.WorkloadInstance // Empty returns whether the index is empty. Empty() bool // ForEach iterates over all workload instances in the index. ForEach(func(*model.WorkloadInstance)) }
Index reprensents an index over workload instances from workload entries.
Indexes are thread-safe.
type MultiValueMap ¶
MultiValueMap represents a map where each key might be associated with multiple values.
func (MultiValueMap) Delete ¶
func (m MultiValueMap) Delete(key, value string) MultiValueMap
Delete removes given (key, value) pair out of the map.
func (MultiValueMap) Insert ¶
func (m MultiValueMap) Insert(key, value string) MultiValueMap
Insert adds given (key, value) pair into the map.