Documentation ¶
Index ¶
- Constants
- Variables
- func GetCrossTable(player1 string, player2 string) (int, error)
- func GetOpeningEco(fen string) string
- func GetOpeningName(fen string) string
- func NormalizeFEN(fen string) (string, error)
- func OpenPgn(pgnFileOrUrl string) (io.ReadCloser, error)
- func Pct(numerator int, denominator int) float64
- func PctS(numerator int, denominator int) string
- func PctS2(pctf float64) string
- type CloudEvalResp
- type CloudPV
- type CrossTableGames
- type EvalCtx
- func (evalCtx *EvalCtx) Close()
- func (evalCtx *EvalCtx) Eval() *EvalResult
- func (evalCtx *EvalCtx) GetPosition() string
- func (evalCtx *EvalCtx) InitEngine()
- func (evalCtx *EvalCtx) SetFEN(fen string) *EvalCtx
- func (evalCtx *EvalCtx) WithCacheOnly() *EvalCtx
- func (evalCtx *EvalCtx) WithEvalDepth(evalDepth int) *EvalCtx
- func (evalCtx *EvalCtx) WithEvalTime(evalTimeInSec uint) *EvalCtx
- func (evalCtx *EvalCtx) WithFEN(fen string) *EvalCtx
- func (evalCtx *EvalCtx) WithHashSize(hashSizeInMiB uint64) *EvalCtx
- func (evalCtx *EvalCtx) WithMoveNum(moveNum uint) *EvalCtx
- func (evalCtx *EvalCtx) WithPgnFile(pgnFile string) *EvalCtx
- func (evalCtx *EvalCtx) WithStaleOk() *EvalCtx
- func (evalCtx *EvalCtx) WithThreads(numThreads uint64) *EvalCtx
- func (evalCtx *EvalCtx) WithTurn(turn chess.Color) *EvalCtx
- func (evalCtx *EvalCtx) WithoutCloudCache() *EvalCtx
- type EvalResult
- type GameInfo
- type MoveStats
- type Opening
- type OpeningGame
- func (openingGame *OpeningGame) ChoicesString(ignoreThreshold bool) string
- func (openingGame *OpeningGame) GetMoveCount() int
- func (openingGame *OpeningGame) String() string
- func (openingGame *OpeningGame) Turn() chess.Color
- func (openingGame *OpeningGame) WithAllSpeeds(fetchAllSpeeds bool) *OpeningGame
- func (openingGame *OpeningGame) WithEval(doEval bool) *OpeningGame
- func (openingGame *OpeningGame) WithFEN(fen string) *OpeningGame
- func (openingGame *OpeningGame) WithFullRatingRange(fetchFullRatingRange bool) *OpeningGame
- func (openingGame *OpeningGame) WithGame(game *chess.Game) *OpeningGame
- func (openingGame *OpeningGame) WithMove(move string) *OpeningGame
- func (openingGame *OpeningGame) WithOpponent(playerIn string, colorIn chess.Color) *OpeningGame
- func (openingGame *OpeningGame) WithParent(parent *OpeningGame) *OpeningGame
- func (openingGame *OpeningGame) WithThreshold(threshold float64) *OpeningGame
- func (openingGame *OpeningGame) WithTopReplies(fetchTop bool) *OpeningGame
- type OpeningResp
- type PlayerInfo
Constants ¶
View Source
const ( KiB = 1024 MiB = 1024 * KiB DefaultEvalTimeInSec = 300 DefaultDepth = -1 // infinite )
View Source
const ( LichessDbBaseUrl = "https://explorer.lichess.ovh/lichess" PlayerDbBaseUrl = "https://explorer.lichess.ovh/player" )
View Source
const (
LichessApiBaseUrl = "https://lichess.org/api/crosstable"
)
View Source
const LichessUrlPrefix = "https://lichess.org"
Variables ¶
View Source
var ErrCacheMiss = errors.New("cache miss")
View Source
var ErrCacheStale = errors.New("cache stale")
Functions ¶
func GetOpeningEco ¶
func GetOpeningName ¶
func NormalizeFEN ¶
Types ¶
type CloudEvalResp ¶
type CrossTableGames ¶
type CrossTableGames struct {
NumGames int `json:"nbGames"`
}
type EvalCtx ¶
type EvalCtx struct {
// contains filtered or unexported fields
}
func NewEvalCtx ¶
func (*EvalCtx) Eval ¶
func (evalCtx *EvalCtx) Eval() *EvalResult
func (*EvalCtx) GetPosition ¶
func (*EvalCtx) InitEngine ¶
func (evalCtx *EvalCtx) InitEngine()
func (*EvalCtx) WithCacheOnly ¶
func (*EvalCtx) WithEvalDepth ¶
func (*EvalCtx) WithEvalTime ¶
func (*EvalCtx) WithHashSize ¶
func (*EvalCtx) WithMoveNum ¶
func (*EvalCtx) WithPgnFile ¶
func (*EvalCtx) WithStaleOk ¶
func (*EvalCtx) WithThreads ¶
func (*EvalCtx) WithoutCloudCache ¶
type EvalResult ¶
type GameInfo ¶
type GameInfo struct { Uci string `json:"uci"` Id string `json:"id"` Winner string `json:"winner"` Speed string `json:"speed"` Mode string `json:"mode"` Year int `json:"year"` Month string `json:"month"` Black PlayerInfo `json:"black"` White PlayerInfo `json:"white"` }
type MoveStats ¶
type OpeningGame ¶
type OpeningGame struct { G *chess.Game Parent *OpeningGame Eco string OpeningResp *OpeningResp Threshold float64 // percent of games // contains filtered or unexported fields }
func NewOpeningGame ¶
func NewOpeningGame() *OpeningGame
func (*OpeningGame) ChoicesString ¶
func (openingGame *OpeningGame) ChoicesString(ignoreThreshold bool) string
func (*OpeningGame) GetMoveCount ¶
func (openingGame *OpeningGame) GetMoveCount() int
func (*OpeningGame) String ¶
func (openingGame *OpeningGame) String() string
func (*OpeningGame) Turn ¶
func (openingGame *OpeningGame) Turn() chess.Color
func (*OpeningGame) WithAllSpeeds ¶
func (openingGame *OpeningGame) WithAllSpeeds(fetchAllSpeeds bool) *OpeningGame
func (*OpeningGame) WithEval ¶
func (openingGame *OpeningGame) WithEval(doEval bool) *OpeningGame
func (*OpeningGame) WithFEN ¶
func (openingGame *OpeningGame) WithFEN(fen string) *OpeningGame
func (*OpeningGame) WithFullRatingRange ¶
func (openingGame *OpeningGame) WithFullRatingRange(fetchFullRatingRange bool) *OpeningGame
func (*OpeningGame) WithGame ¶
func (openingGame *OpeningGame) WithGame(game *chess.Game) *OpeningGame
func (*OpeningGame) WithMove ¶
func (openingGame *OpeningGame) WithMove(move string) *OpeningGame
func (*OpeningGame) WithOpponent ¶
func (openingGame *OpeningGame) WithOpponent(playerIn string, colorIn chess.Color) *OpeningGame
func (*OpeningGame) WithParent ¶
func (openingGame *OpeningGame) WithParent(parent *OpeningGame) *OpeningGame
func (*OpeningGame) WithThreshold ¶
func (openingGame *OpeningGame) WithThreshold(threshold float64) *OpeningGame
func (*OpeningGame) WithTopReplies ¶
func (openingGame *OpeningGame) WithTopReplies(fetchTop bool) *OpeningGame
type OpeningResp ¶
type OpeningResp struct { WhiteWins int `json:"white"` BlackWins int `json:"black"` Draws int `json:"draws"` Moves []MoveStats `json:"moves"` TopGames []GameInfo `json:"topGames"` RecentGames []GameInfo `json:"recentGames"` }
func (*OpeningResp) Total ¶
func (openingResp *OpeningResp) Total() int
type PlayerInfo ¶
Click to show internal directories.
Click to hide internal directories.