MCPcopy Index your code
hub / github.com/coder/coder / Next

Method Next

aibridge/keypool/keypool.go:265–278  ·  view source on GitHub ↗

Next returns a Key handle for the next available key without modifying the pool state. Returns *Error when no more keys are available.

()

Source from the content-addressed store, hash-verified

263//
264// Returns *Error when no more keys are available.
265func (w *Walker) Next() (*Key, *Error) {
266 for i := w.pos; i < len(w.pool.keys); i++ {
267 key := &w.pool.keys[i]
268 if key.State() != KeyStateValid {
269 continue
270 }
271 // Key is available.
272 w.pos = i + 1
273 return key, nil
274 }
275
276 // No keys available.
277 return nil, w.pool.keyPoolError()
278}

Callers 3

ProcessRequestMethod · 0.95
ProcessRequestMethod · 0.95
ProcessRequestMethod · 0.95

Calls 2

keyPoolErrorMethod · 0.80
StateMethod · 0.45

Tested by

no test coverage detected