public save API

This commit is contained in:
Anton Kalyaev 2017-01-13 20:48:42 +04:00 committed by Ethan Buchman
parent 332f7056f7
commit e7656873c1
1 changed files with 6 additions and 0 deletions

View File

@ -368,6 +368,12 @@ func (a *AddrBook) loadFromFile(filePath string) bool {
return true
}
// Save saves the book.
func (a *AddrBook) Save() {
log.Info("Saving AddrBook to file", "size", a.Size())
a.saveToFile(a.filePath)
}
/* Private methods */
func (a *AddrBook) saveRoutine() {