Files
spoc-bot-vr/storage.go
2024-04-11 22:23:58 -06:00

23 lines
411 B
Go

package main
import "context"
type Storage struct {
driver Driver
}
type Driver interface {
Close() error
ForEach(context.Context, func(string, []byte) error) error
Get(context.Context, string) ([]byte, error)
Set(context.Context, string, []byte) error
}
func NewTestStorage() Storage {
return Storage{driver: NewTestDB()}
}
func NewStorage(driver Driver) Storage {
return Storage{driver: driver}
}