scenario

package
v0.0.0-...-24ff1af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardCache

type CardCache interface {
	Get(cardName string) ([]cardsinfo.ScgCardPrice, error)
	Set(cardName string, prices []cardsinfo.ScgCardPrice)
}

type CardInfoFetcher

type CardInfoFetcher interface {
	GetNameByCardId(set string, number string) string
	GetOriginalName(name string) string
	GetPrices(name string) ([]cardsinfo.ScgCardPrice, error)
}

type Scenario

type Scenario struct {
	Sender      Sender
	Logger      *log.Logger
	InfoFetcher CardInfoFetcher
	Cache       CardCache
}

func (*Scenario) HandleSearch

func (s *Scenario) HandleSearch(msg *UserMessage)

type Sender

type Sender interface {
	Send(userId int64, message string)
	SendPrices(userId int64, cardName string, prices []cardsinfo.ScgCardPrice)
}

type TestScenarioCtx

type TestScenarioCtx struct {
	Scenario *Scenario
	Sender   *testSender
	LogBuf   *bytes.Buffer
}

func GetTestScenarioCtx

func GetTestScenarioCtx() TestScenarioCtx

type UserMessage

type UserMessage struct {
	Body   string
	UserId int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL