mtg-price-bot/internal/scenario/test_cache.go
2021-06-06 17:21:29 +03:00

23 lines
445 B
Go

package scenario
import (
"errors"
"gitlab.com/flygrounder/go-mtg-vk/internal/cardsinfo"
)
type testCache struct {
table map[string][]cardsinfo.ScgCardPrice
}
func (t *testCache) Get(cardName string) ([]cardsinfo.ScgCardPrice, error) {
msg, ok := t.table[cardName]
if !ok {
return nil, errors.New("test")
}
return msg, nil
}
func (t *testCache) Set(cardName string, prices []cardsinfo.ScgCardPrice) {
t.table[cardName] = prices
}