player

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FetchLimit = 200
	MaxOrders  = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchConfig

type FetchConfig struct {
	Server string
	Filter *twmodel.PlayerFilter
	Select bool
	Count  bool
	Sort   []string
	Limit  int
	Offset int
}

type Repository

type Repository interface {
	Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Player, int, error)
	FetchNameChanges(ctx context.Context, code twmodel.VersionCode, playerID ...int) (map[int][]*twmodel.PlayerNameChange, error)
	FetchPlayerServers(ctx context.Context, code twmodel.VersionCode, playerID ...int) (map[int][]string, error)
	SearchPlayer(ctx context.Context, cfg SearchPlayerConfig) ([]*twmodel.FoundPlayer, int, error)
}

type SearchPlayerConfig

type SearchPlayerConfig struct {
	Version string
	Name    string
	ID      int
	Count   bool
	Sort    []string
	Limit   int
	Offset  int
}

type Usecase

type Usecase interface {
	Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Player, int, error)
	GetByID(ctx context.Context, server string, id int) (*twmodel.Player, error)
	SearchPlayer(ctx context.Context, cfg SearchPlayerConfig) ([]*twmodel.FoundPlayer, int, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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