liveodds

package module
v0.0.0-...-c7c1e90 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2014 License: GPL-3.0 Imports: 2 Imported by: 0

README

brinplay

BetRadar InPlay Protocol implementation in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwayTeam

type AwayTeam struct {
	Value string `xml:",chardata"`
	Id    uint32 `xml:"id,attr"`
}

type BetRadarLiveOdds

type BetRadarLiveOdds struct {
	XMLName   xml.Name `xml:"BetradarLiveOdds"`
	Status    string   `xml:"status,attr"`
	Timestamp int64    `xml:"timestamp,attr"`
	StartTime int64    `xml:"starttime,attr,omitempty"`
	EndTime   int64    `xml:"endtime,attr,omitempty"`
	ReplyType string   `xml:"replytype,attr,omitempty"`
	XMLNS     string   `xml:"xmlns,attr"`
	Matches   []Match  `xml:"Match"`
	OddsType  []OddsType
}

BetRadarLiveOdds is a Struct ready to XML Unmarshal a BetRadarLiveOdds XML message from BetRadar in play live XML Feeds. It can be used just as:

v := BetRadarLiveOdds{} xml_msg := `

<BetRadarLiveOdds status="alive" timestamp="1386870302430"
      xmlns="http://www.betradar.com/BetradarLiveOdds">
`

err := xml.Unmatshal([]byte(xml_data), &v)

if err != nil {
    fmt.Printf("error: %v", err)
}

func (*BetRadarLiveOdds) Epoch

func (t *BetRadarLiveOdds) Epoch() (epoch time.Time)

BetRadar does not follows the RFC3339 for Epoch Timestamps

type BookMakerStatus

type BookMakerStatus struct {
	XMLName     xml.Name `xml:"BookMakerStatus"`
	Timestamp   int64    `xml:"timestamp,attr"`
	Type        string   `xml:"type,attr"`
	BookmakerID uint16   `xml:"bookmakerid,attr"`
	Match       []Match  `xml:"Match,omitempty"`
}

type Card

type Card struct {
	CardID uint32 `xml:"id,attr"`
	Player string `xml:"player,attr"`
	Team   string `xml:"team,attr"`
	Time   uint8  `xml:"time,attr"`
	Type   string `xml:"type,attr"`
}

type Category

type Category struct {
	Value string `xml:",chardata"`
	Id    uint16 `xml:"id,attr"`
}

type HomeTeam

type HomeTeam struct {
	Value string `xml:",chardata"`
	Id    uint32 `xml:"id,attr"`
}

type Match

type Match struct {
	Active       bool   `xml:"active,attr"`
	BetStatus    string `xml:"betstatus,attr,omitempty"`
	MatchID      uint32 `xml:"matchid,attr"`
	MatchTime    uint8  `xml:"matchtime,attr,omitempty"`
	MsgNR        uint16 `xml:"msgnr,attr,omitempty"`
	GameScore    string `xml:"gamescore,attr,omitempty"`
	ClearedScore string `xml:"clearedscore,attr,omitempty"`
	Score        string `xml:"score,attr,omitempty"`
	Status       string `xml:"status,attr,omitempty"`
	SetScores    string `xml:"setscores,attr,omitempty"`
	Odds         []Odd
	Card         []Card
	Scores       []Score   `xml:"Score"`
	MatchInfo    MatchInfo `xml:"MatchInfo"`
}

type MatchInfo

type MatchInfo struct {
	DateOfMatch int64      `xml:"DateOfMatch"`
	Sport       Sport      `xml:"Sport"`
	Category    Category   `xml:"Category"`
	Tournament  Tournament `xml:"Tournament"`
	HomeTeam    HomeTeam   `xml:"HomeTeam"`
	AwayTeam    AwayTeam   `xml:"AwayTeam"`
}

type Name

type Name struct {
	Value string `xml:",chardata"`
	Lang  string `xml:"lang,attr"`
}

type Odd

type Odd struct {
	OddsID           uint32 `xml:"id,attr"`
	Active           bool   `xml:"active,attr"`
	Changed          string `xml:"changed,attr"`
	Combination      uint8  `xml:"combination,attr"`
	FreeText         string `xml:"freetext,attr"`
	SpecialOddsValue string `xml:"specialoddsvalue,attr"`
	SubType          uint16 `xml:"subtype,attr"`
	Type             string `xml:"type,attr"`
	TypeID           uint16 `xml:"typeid,attr"`
	OddsField        []OddsField
}

type OddsField

type OddsField struct {
	Value   string `xml:",chardata"` // has to be string cos sometimes is empty (rollback packet for example)
	Active  bool   `xml:"active,attr,omitempty"`
	Outcome bool   `xml:"outcome,attr,omitempty"`
	Type    string `xml:"type,attr"`
}

type OddsType

type OddsType struct {
	Type      string `xml:"type,attr"`
	FreeText  string `xml:"freetext,attr,omitempty"`
	TypeID    uint16 `xml:"typeid,attr"`
	OddsField []TranslationOddsField
	Name      []Name
}

type Score

type Score struct {
	ScoreID     uint32 `xml:"id,attr"`
	Away        bool   `xml:"away,attr"`
	Home        bool   `xml:"home,attr"`
	Player      string `xml:"player,attr,omitempty"`
	ScoringTeam string `xml:"scoringteam,attr"`
	Time        int8   `xml:"time,attr"`
	Type        string `xml:"type,attr"`
}

type Sport

type Sport struct {
	Value string `xml:",chardata"`
	Id    uint8  `xml:"id,attr"`
}

type Tournament

type Tournament struct {
	Value string `xml:",chardata"`
	Id    uint32 `xml:"id,attr"`
}

type TranslationOddsField

type TranslationOddsField struct {
	Type string `xml:"type,attr"`
	Name []Name
}

Jump to

Keyboard shortcuts

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