MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / sortedInstances

Function sortedInstances

api/client.go:175–185  ·  view source on GitHub ↗

sortedInstances converts a map keyed by ID into a sorted slice.

(raw map[string]Instance)

Source from the content-addressed store, hash-verified

173
174// sortedInstances converts a map keyed by ID into a sorted slice.
175func sortedInstances(raw map[string]Instance) []Instance {
176 instances := make([]Instance, 0, len(raw))
177 for id, inst := range raw {
178 inst.ID = id
179 instances = append(instances, inst)
180 }
181 sort.Slice(instances, func(i, j int) bool {
182 return instances[i].ID < instances[j].ID
183 })
184 return instances
185}
186
187func (c *Client) ValidateToken(ctx context.Context) (*ValidateTokenResult, error) {
188 var result ValidateTokenResult

Callers 2

ListInstancesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected