- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 721 for sortby (0.18 sec)
-
pkg/slices/slices.go
if len(x) <= 1 { return x } slices.SortStableFunc(x, less) return x } // SortBy is a helper to sort a slice by some value. Typically, this would be sorting a struct // by a single field. If you need to have multiple fields, see the ExampleSort. func SortBy[E any, A constraints.Ordered](x []E, extract func(a E) A) []E { if len(x) <= 1 { return x } SortFunc(x, func(a, b E) int {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed May 15 06:28:11 UTC 2024 - 7.9K bytes - Viewed (0) -
analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/scopeProvider/TestScopeRenderer.kt
withIndent { appendLine(it) } } } } } scope.getPackageSymbols() .toMutableList() .apply { sortBy { it.fqName.asString() } } .renderAll("packages") { prettyRenderPackage(it) } scope.getClassifierSymbols().toList().renderAll("classifiers") { prettyRenderDeclaration(it) }
Registered: Wed Jun 12 09:53:16 UTC 2024 - Last Modified: Tue Jun 04 08:26:19 UTC 2024 - 7.3K bytes - Viewed (0) -
istioctl/pkg/util/handlers/handlers_test.go
return nil, fmt.Errorf("unexpected request") } }), } getFirstPodFunc = func(client corev1client.PodsGetter, namespace string, selector string, timeout time.Duration, sortBy func([]*corev1.Pod) sort.Interface) ( *corev1.Pod, int, error, ) { return attachPod(namespace), 1, nil } for _, tt := range tests { t.Run(strings.Split(tt.name, ".")[0], func(t *testing.T) {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri Jun 09 18:17:49 UTC 2023 - 6.6K bytes - Viewed (0) -
pilot/pkg/config/kube/crdclient/client_test.go
go store.Run(stop) kube.WaitForCacheSync("test", stop, store.HasSynced) // The order of the events doesn't matter, so sort the two slices so the ordering is consistent sortFunc := func(a config.Config) string { return a.Key() } slices.SortBy(cfgsAdded, sortFunc) slices.SortBy(expected, sortFunc) assert.Equal(t, expected, cfgsAdded) } } func TestClientSync(t *testing.T) {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri May 10 02:58:52 UTC 2024 - 14.1K bytes - Viewed (0) -
istioctl/pkg/kubeinject/kubeinject.go
func GetFirstPod(client v1.CoreV1Interface, namespace string, selector string) (*corev1.Pod, error) { options := metav1.ListOptions{LabelSelector: selector} sortBy := func(pods []*corev1.Pod) sort.Interface { return sort.Reverse(podutils.ActivePods(pods)) } podList, err := client.Pods(namespace).List(context.TODO(), options) if err != nil { return nil, err }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri Mar 29 02:29:02 UTC 2024 - 21.6K bytes - Viewed (0) -
istioctl/pkg/ztunnelconfig/ztunnelconfig.go
return types.NamespacedName{}, err } pods := slices.Reference(podsr.Items) if len(pods) > 0 { // We need to pass in a sorter, and the one used by `kubectl logs` is good enough. sortBy := func(pods []*corev1.Pod) sort.Interface { return podutils.ByLogging(pods) } sort.Sort(sortBy(pods)) return config.NamespacedName(pods[0]), nil } return types.NamespacedName{}, fmt.Errorf("no pods found") }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Jun 06 20:18:34 UTC 2024 - 22K bytes - Viewed (0) -
pkg/monitoring/monitoring.go
} // ExportMetricDefinitions reports all currently registered metric definitions. func ExportMetricDefinitions() []MetricDefinition { knownMetrics.mu.Lock() defer knownMetrics.mu.Unlock() return slices.SortBy(maps.Values(knownMetrics.known), func(a MetricDefinition) string { return a.Name }) } // register records a newly defined metric. Only valid before an exporter is set.
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue Oct 24 03:31:28 UTC 2023 - 9.5K bytes - Viewed (0) -
pkg/kube/krt/collection_test.go
got := sets.New(strings.Split(s, ",")...) return want.Equals(got) } } func fetcherSorted[T krt.ResourceNamer](c krt.Collection[T]) func() []T { return func() []T { return slices.SortBy(c.List(), func(t T) string { return t.ResourceName() }) } } func TestCollectionMultipleFetch(t *testing.T) { type Result struct { Named Configs []string }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Sun Apr 28 04:22:19 UTC 2024 - 14.6K bytes - Viewed (0) -
pkg/kube/kclient/client_test.go
tracker.WaitOrdered("add/2") assert.Equal(t, tester.Get(obj2.Name, obj2.Namespace), obj2) // We should not see obj3, it is filtered deploys := tester.List(obj1.Namespace, klabels.Everything()) slices.SortBy(deploys, func(a *appsv1.Deployment) string { return a.Name }) assert.Equal(t, deploys, []*appsv1.Deployment{obj1, obj2}) assert.Equal(t, tester.Get(obj3.Name, obj3.Namespace), nil)
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue Jun 11 15:12:54 UTC 2024 - 17.2K bytes - Viewed (0) -
pilot/pkg/model/telemetry_logging.go
return cfg } func accessLogFormatters(text string, labels *structpb.Struct) []*core.TypedExtensionConfig { formatters := make([]*core.TypedExtensionConfig, 0, maxFormattersLength) defer func() { slices.SortBy(formatters, func(f *core.TypedExtensionConfig) string { return f.Name }) }() formatters = append(formatters, accessLogTextFormatters(text)...) if len(formatters) >= maxFormattersLength {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri Jun 14 04:34:30 UTC 2024 - 23K bytes - Viewed (0)