blasphem/pkg/storage/storage.go

29 lines
420 B
Go
Raw Normal View History

2022-10-02 14:39:55 -04:00
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
}