saving new turn

This commit is contained in:
Ilia Denisov
2025-09-26 01:38:49 +03:00
parent 6d87ea6086
commit 282150a253
13 changed files with 170 additions and 57 deletions
+14
View File
@@ -2,12 +2,26 @@ package repo
import (
"encoding"
"errors"
"github.com/iliadenisov/galaxy/pkg/repo/fs"
)
type StorageError error
func NewStorageError(err error) error {
return StorageError(err)
}
type StateError error
func NewStateError(msg string) error {
return StateError(errors.New(msg))
}
type Storage interface {
Lock() (func() error, error)
Exist(string) (bool, error)
Write(string, encoding.BinaryMarshaler) error
Read(string, encoding.BinaryUnmarshaler) error
}