saving new turn
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user