MCPcopy Index your code
hub / github.com/mudler/LocalAI / Set

Method Set

core/explorer/database.go:60–69  ·  view source on GitHub ↗

Set stores a Token in the Database by its token.

(token string, t TokenData)

Source from the content-addressed store, hash-verified

58
59// Set stores a Token in the Database by its token.
60func (db *Database) Set(token string, t TokenData) error {
61 db.flock.Lock()
62 defer db.flock.Unlock()
63 db.Lock()
64 defer db.Unlock()
65 db.load()
66 db.data[token] = t
67
68 return db.save()
69}
70
71// Delete removes a Token from the Database by its token.
72func (db *Database) Delete(token string) error {

Callers

nothing calls this directly

Calls 4

loadMethod · 0.95
saveMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected