refactor: storage namings
This commit is contained in:
@@ -100,7 +100,7 @@ func NewFS(storageRoot string) (*fsStorage, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *fsStorage) StateExists(callback func(bool, error)) {
|
||||
func (s *fsStorage) StateExistsAsync(callback func(bool, error)) {
|
||||
go func() {
|
||||
exists, err := s.FileExists(stateFileName)
|
||||
if callback != nil {
|
||||
@@ -109,7 +109,7 @@ func (s *fsStorage) StateExists(callback func(bool, error)) {
|
||||
}()
|
||||
}
|
||||
|
||||
func (s *fsStorage) LoadState(callback func(client.State, error)) {
|
||||
func (s *fsStorage) LoadStateAsync(callback func(client.State, error)) {
|
||||
go func() {
|
||||
state, err := s.loadStateSync()
|
||||
if callback != nil {
|
||||
@@ -118,7 +118,7 @@ func (s *fsStorage) LoadState(callback func(client.State, error)) {
|
||||
}()
|
||||
}
|
||||
|
||||
func (s *fsStorage) SaveState(state client.State, callback func(error)) {
|
||||
func (s *fsStorage) SaveStateAsync(state client.State, callback func(error)) {
|
||||
go func() {
|
||||
err := s.saveStateSync(state)
|
||||
if callback != nil {
|
||||
@@ -127,7 +127,7 @@ func (s *fsStorage) SaveState(state client.State, callback func(error)) {
|
||||
}()
|
||||
}
|
||||
|
||||
func (s *fsStorage) LoadReport(id client.GameID, turn uint, callback func(report.Report, error)) {
|
||||
func (s *fsStorage) LoadReportAsync(id client.GameID, turn uint, callback func(report.Report, error)) {
|
||||
go func() {
|
||||
rep, err := s.loadReportSync(id, turn)
|
||||
if callback != nil {
|
||||
@@ -136,7 +136,7 @@ func (s *fsStorage) LoadReport(id client.GameID, turn uint, callback func(report
|
||||
}()
|
||||
}
|
||||
|
||||
func (s *fsStorage) SaveReport(id client.GameID, turn uint, rep report.Report, callback func(error)) {
|
||||
func (s *fsStorage) SaveReportAsync(id client.GameID, turn uint, rep report.Report, callback func(error)) {
|
||||
go func() {
|
||||
err := s.saveReportSync(id, turn, rep)
|
||||
if callback != nil {
|
||||
@@ -145,7 +145,7 @@ func (s *fsStorage) SaveReport(id client.GameID, turn uint, rep report.Report, c
|
||||
}()
|
||||
}
|
||||
|
||||
func (s *fsStorage) LoadOrder(id client.GameID, turn uint, callback func(order.Order, error)) {
|
||||
func (s *fsStorage) LoadOrderAsync(id client.GameID, turn uint, callback func(order.Order, error)) {
|
||||
go func() {
|
||||
o, err := s.loadOrderSync(id, turn)
|
||||
if callback != nil {
|
||||
@@ -154,7 +154,7 @@ func (s *fsStorage) LoadOrder(id client.GameID, turn uint, callback func(order.O
|
||||
}()
|
||||
}
|
||||
|
||||
func (s *fsStorage) SaveOrder(id client.GameID, turn uint, o order.Order, callback func(error)) {
|
||||
func (s *fsStorage) SaveOrderAsync(id client.GameID, turn uint, o order.Order, callback func(error)) {
|
||||
go func() {
|
||||
err := s.saveOrderSync(id, turn, o)
|
||||
if callback != nil {
|
||||
|
||||
Reference in New Issue
Block a user