pumper

package
v0.0.0-...-1ffba5b Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntryTypeKey = "entry"

	SummonerTypeKey = "sum"
	MatchTypeKey    = "match"
)

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "pump",
	Short: "start a local pumper all",
	Run: func(cmd *cobra.Command, args []string) {
		Run(cmd.Context())
	},
}

Functions

func ConvertEndmark

func ConvertEndmark(str string) (err error)

func ConvertRankToStr

func ConvertRankToStr(tier riotmodel.TIER, div uint) (string, string)

func ConvertStrToRank

func ConvertStrToRank(tierStr, divStr string) (riotmodel.TIER, uint)

func Run

func Run(ctx context.Context)

Types

type DBResult

type DBResult struct {
	Type  string
	Brief string
	Data  interface{}
}

type Pumper

type Pumper struct {
	Exit chan struct{}
	// contains filtered or unexported fields
}

func NewPumper

func NewPumper(id string, opts ...Setup) (*Pumper, error)

func (*Pumper) FetchEntryBySumnID

func (p *Pumper) FetchEntryBySumnID(sumnID string, loc riotmodel.LOCATION)

func (*Pumper) FetchMatchByID

func (p *Pumper) FetchMatchByID(req *scheduler.Task, host, matchID string) (res *riotmodel.MatchDB)

func (*Pumper) FetchMatchBySumnID

func (p *Pumper) FetchMatchBySumnID(sumnID string, loc riotmodel.LOCATION)

func (*Pumper) LoadAll

func (p *Pumper) LoadAll()

func (*Pumper) LoadSingleSummoner

func (p *Pumper) LoadSingleSummoner(name, loc string) (res *riotmodel.SummonerDTO)

func (*Pumper) Schedule

func (p *Pumper) Schedule()

func (*Pumper) StartEngine

func (p *Pumper) StartEngine()

func (*Pumper) TaskHandlers

func (p *Pumper) TaskHandlers(body []byte) error

func (*Pumper) UpdateAll

func (p *Pumper) UpdateAll()

UpdateAll 's push task

func (*Pumper) UpdateEntries

func (p *Pumper) UpdateEntries()

func (*Pumper) UpdateMatch

func (p *Pumper) UpdateMatch()

func (*Pumper) UpdateSumoner

func (p *Pumper) UpdateSumoner()

type Setup

type Setup func(*Strategy) // Strategy的配置选项

func WithAreaLoc

func WithAreaLoc(areas ...riotmodel.AREA) Setup

WithAreaLoc (riotmodel.LOC_ALL) WithAreaLoc (riotmodel.LOC_AMERICAS,riotmodel.LOC_ASIA)

func WithContext

func WithContext(ctx context.Context) Setup

func WithEndMark

func WithEndMark(tier riotmodel.TIER, div uint) Setup

WithEndMark (riotmodel.DIAMOND,1) WithEndMark (riotmodel.IRON,4)

func WithLoc

func WithLoc(locs ...riotmodel.LOCATION) Setup

func WithMaxMatchCount

func WithMaxMatchCount(size int) Setup

func WithQues

func WithQues(ques ...riotmodel.QUECODE) Setup

WithQues (riotmodel.RANKED_SOLO_5x5)

func WithToken

func WithToken(token string) Setup

type Strategy

type Strategy struct {
	Token string
	// registryURL   string
	Ctx           context.Context
	Loc           []riotmodel.LOCATION // 地区列表
	Que           []riotmodel.QUECODE  // 队列类型列表
	TestEndMark1  riotmodel.TIER       // 测试用终止标记
	TestEndMark2  uint                 // 测试用终止标记
	MaxSize       int                  // Task最大切割尺寸
	MaxMatchCount int                  // 最大比赛场次
	Retry         uint                 // 任务重试次数
	LifeTime      time.Duration        // 缓存生命周期
}

Jump to

Keyboard shortcuts

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