MCPcopy
hub / github.com/mudler/LocalAI / save

Method save

core/explorer/database.go:116–125  ·  view source on GitHub ↗

Save writes the Database to disk.

()

Source from the content-addressed store, hash-verified

114
115// Save writes the Database to disk.
116func (db *Database) save() error {
117 // Marshal db.data into JSON
118 // Write the JSON to the file
119 f, err := os.Create(db.path)
120 if err != nil {
121 return err
122 }
123 defer f.Close()
124 return json.NewEncoder(f).Encode(db.data)
125}

Callers 2

SetMethod · 0.95
DeleteMethod · 0.95

Calls 3

EncodeMethod · 0.80
CreateMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected