Refactored test utils in VK module
This commit is contained in:
parent
d5f9a495b7
commit
121bb9fc9c
6 changed files with 124 additions and 112 deletions
|
|
@ -12,6 +12,17 @@ import (
|
|||
"gitlab.com/flygrounder/go-mtg-vk/internal/cardsinfo"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
Sender Sender
|
||||
Logger *log.Logger
|
||||
SecretKey string
|
||||
GroupId int64
|
||||
ConfirmationString string
|
||||
DictPath string
|
||||
Cache CardCache
|
||||
InfoFetcher CardInfoFetcher
|
||||
}
|
||||
|
||||
type CardInfoFetcher interface {
|
||||
GetPrices(name string) ([]cardsinfo.CardPrice, error)
|
||||
FormatCardPrices(name string, prices []cardsinfo.CardPrice) string
|
||||
|
|
@ -24,17 +35,6 @@ type CardCache interface {
|
|||
Set(cardName string, message string)
|
||||
}
|
||||
|
||||
type Handler struct {
|
||||
Sender Sender
|
||||
Logger *log.Logger
|
||||
SecretKey string
|
||||
GroupId int64
|
||||
ConfirmationString string
|
||||
DictPath string
|
||||
Cache CardCache
|
||||
InfoFetcher CardInfoFetcher
|
||||
}
|
||||
|
||||
type messageRequest struct {
|
||||
Type string `json:"type"`
|
||||
GroupId int64 `json:"group_id"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue