28 lines
420 B
Go
28 lines
420 B
Go
package storage
|
|
|
|
import (
|
|
"io/fs"
|
|
)
|
|
|
|
type Data interface {
|
|
}
|
|
|
|
type Item struct {
|
|
Version int `json:"version"`
|
|
MinorVersion *int `json:"minor_version,omitempty"`
|
|
Key string `json:"key"`
|
|
Data Data `json:"data"`
|
|
}
|
|
|
|
type Store struct {
|
|
fs.FS
|
|
}
|
|
|
|
func Open(dir fs.FS) (*Store, error) {
|
|
stor, err := fs.Sub(dir, ".storage")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &Store{stor}, nil
|
|
}
|