2020-06-02 15:45:21 +00:00
|
|
|
package player
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-05-05 17:32:45 +00:00
|
|
|
"github.com/tribalwarshelp/shared/tw/twmodel"
|
2020-06-02 15:45:21 +00:00
|
|
|
)
|
|
|
|
|
2020-06-24 13:05:31 +00:00
|
|
|
type FetchConfig struct {
|
|
|
|
Server string
|
2021-05-05 17:32:45 +00:00
|
|
|
Filter *twmodel.PlayerFilter
|
2021-03-21 12:03:39 +00:00
|
|
|
Select bool
|
2020-06-24 13:05:31 +00:00
|
|
|
Count bool
|
2020-11-21 09:08:22 +00:00
|
|
|
Sort []string
|
|
|
|
Limit int
|
|
|
|
Offset int
|
2020-06-24 13:05:31 +00:00
|
|
|
}
|
|
|
|
|
2020-12-25 11:07:54 +00:00
|
|
|
type SearchPlayerConfig struct {
|
|
|
|
Version string
|
|
|
|
Name string
|
|
|
|
ID int
|
|
|
|
Count bool
|
|
|
|
Sort []string
|
|
|
|
Limit int
|
|
|
|
Offset int
|
|
|
|
}
|
|
|
|
|
2020-06-02 15:45:21 +00:00
|
|
|
type Repository interface {
|
2021-05-05 17:32:45 +00:00
|
|
|
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)
|
2020-06-02 15:45:21 +00:00
|
|
|
}
|