Documentation
¶
Overview ¶
Package xfcc provides methods for communicating correspondence chess sites with XFCC protocol.
POST /xfccbasic.asmx HTTP/1.1 Host: www.iccf.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://www.bennedik.com/webservices/XfccBasic/GetMyGames"
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetMyGames xmlns="http://www.bennedik.com/webservices/XfccBasic">
<username>string</username>
<password>string</password>
</GetMyGames>
</soap:Body>
</soap:Envelope>
Package xfcc provides methods for communicating correspondence chess sites with XFCC protocol.
Index ¶
Constants ¶
const DateRegularExpressionString = `^(\d\d\d\d|\?\?\?\?)[.-](\d\d?|\?\?)[.-](\d\d?|\?\?)$`
DateRegularExpressionString is the string that is used to create DateRegularExpression.
const FewPiecesGame2b = `` /* 4488-byte string literal not displayed */
FewPiecesGame2b is something to be fixed
const GetMyGamesSOAPXML = `` /* 404-byte string literal not displayed */
GetMyGamesSOAPXML is the SOAP request template for GetMyGames.
const ICCFBaseURL = "https://www.iccf.com/XfccBasic.asmx"
ICCFBaseURL is the base URL for the XFCC endpoint of International Correspondence Chess Federation (ICCF).
const ICCFSOAPMIMEType = "text/xml"
ICCFSOAPMIMEType is the MIME type ICCF uses.
const ISO8601Layout = "2006-01-02"
ISO8601Layout is date layout for ISO8601 standard.
const MaximumMoveTextLength = 78
MaximumMoveTextLength defines the maximum length of lines of the movetext of a game.
const PGNLayout = "2006.01.02"
PGNLayout is date layout for PGN tags.
const PGNTemplate = `` /* 128-byte string literal not displayed */
PGNTemplate is a template for Portable Game Notation.
const ResultBlackWins = "0-1"
ResultBlackWins is the string value for a Black win.
const ResultDraw = "1/2-1/2"
ResultDraw is the string value for a draw.
const ResultUnknown = "*"
ResultUnknown is the string value for an unknown result.
const ResultWhiteWins = "1-0"
ResultWhiteWins is the string value for a White win.
const SOAPMIMEType = "application/soap+xml"
SOAPMIMEType is the MIME type for SOAP requests.
Variables ¶
var DateRegularExpression *regexp.Regexp
DateRegularExpression is used for parsin Dates from strings.
Functions ¶
func GetMyGamesXML ¶
GetMyGamesXML returns the XML of your games.
Types ¶
type Body ¶
type Body struct {
XMLName xml.Name
Response GetMyGamesResponse `xml:"GetMyGamesResponse"`
}
Body is just for parsing the XML.
type Date ¶
Date models the date.
type Game ¶
type Game struct {
XMLName xml.Name `xml:"XfccGame"`
ID uint64 `xml:"id"`
Event string `xml:"event"`
Site string `xml:"site"`
Date string `xml:"date"`
EventDate string `xml:"eventDate"`
White Player `xml:"white"`
Black Player `xml:"black"`
Result Result `xml:"result"`
Movetext Movetext `xml:"moves"`
WhiteElo int `xml:"whiteElo"`
BlackElo int `xml:"blackElo"`
DrawOffered bool `xml:"drawOffered"`
MyTurn bool `xml:"myTurn"`
}
Game models a correspondence chess game.
func GetMyGames ¶
GetMyGames returns your games.
type GetMyGamesResponse ¶
type GetMyGamesResponse struct {
XMLName xml.Name `xml:"GetMyGamesResponse"`
Result GetMyGamesResult `xml:"GetMyGamesResult"`
}
GetMyGamesResponse models the result of GetMyGames SOAP query.
type GetMyGamesResult ¶
type GetMyGamesResult struct {
XMLName xml.Name `xml:"GetMyGamesResult"`
Games []Game `xml:"XfccGame"`
}
GetMyGamesResult models the result containg the games.
type Result ¶
type Result string
Result models the result of the game. It can have following values: - "Ongoing" - "WhiteWins" - "BlackWins" - "Draw" - "WhiteWinAdjudicated" - "BlackWinAdjudicated" - "DrawAdjudicated" - "WhiteDefaulted" - "BlackDefaulted" - "BothDefaulted" - "Cancelled" - "AdjudicationPending"