MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / cloneAndSortStorageNodes

Function cloneAndSortStorageNodes

internal/ui/components/storage_browser.go:611–621  ·  view source on GitHub ↗
(nodes []*api.Node)

Source from the content-addressed store, hash-verified

609}
610
611func cloneAndSortStorageNodes(nodes []*api.Node) []*api.Node {
612 cloned := make([]*api.Node, 0, len(nodes))
613 cloned = append(cloned, nodes...)
614 sort.Slice(cloned, func(i, j int) bool {
615 if cloned[i].Name == cloned[j].Name {
616 return cloned[i].SourceProfile < cloned[j].SourceProfile
617 }
618 return cloned[i].Name < cloned[j].Name
619 })
620 return cloned
621}
622
623func selectionKey(node *api.Node, storage *api.Storage) string {
624 if node == nil {

Callers 1

SetNodesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected