refactor: storage interface

This commit is contained in:
Ilia Denisov
2026-03-13 17:30:39 +02:00
parent d7e12cbee0
commit 43039a79bf
3 changed files with 61 additions and 42 deletions
+4 -4
View File
@@ -37,16 +37,16 @@ type UIStorage interface {
// otherwise callback func accepts loaded [report.Report].
LoadReport(client.GameID, uint, func(report.Report, error))
// PutReport stores given [report.Report] for a given [model.GameID] and turn number at the filesystem asynchronously.
// SaveReport stores given [report.Report] for a given [model.GameID] and turn number at the filesystem asynchronously.
// I/O or encoding error may occur, it that case callback func will be called with non-nil error.
PutReport(client.GameID, uint, report.Report, func(error))
SaveReport(client.GameID, uint, report.Report, func(error))
// LoadOrder loads a [order.Order] for a given [model.GameID] and turn number from filesystem asynchronously.
// Passed callback func will will accept non-nil error in case of I/O or decoding errors occuried,
// otherwise callback func accepts loaded [order.Order].
LoadOrder(client.GameID, uint, func(order.Order, error))
// PutOrder stores given [order.Order] for a given [model.GameID] and turn number at the filesystem asynchronously.
// SaveOrder stores given [order.Order] for a given [model.GameID] and turn number at the filesystem asynchronously.
// I/O or encoding error may occur, it that case callback func will be called with non-nil error.
PutOrder(client.GameID, uint, order.Order, func(error))
SaveOrder(client.GameID, uint, order.Order, func(error))
}