-
Notifications
You must be signed in to change notification settings - Fork 0
/
statistics.go
110 lines (92 loc) · 2.64 KB
/
statistics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package fixtures
import (
"time"
"github.com/syurchen93/api-football-client/common"
)
type TeamStatistics struct {
Team TeamBasic `json:"team"`
Statistics []TeamStatistic `json:"statistics"`
}
type PlayerStatistics struct {
Team TeamBasic `json:"team"`
Players []TeamPlayerStats `mapstructure:"players" json:"players"`
}
type TeamStatistic struct {
Type common.StatsType `json:"type"`
Value int `json:"value"`
}
type TeamBasic struct {
ID int `json:"id"`
Name string `json:"name"`
Logo string `json:"logo"`
Updated *time.Time `mapstructue:"update,omitempty" json:"updated,omitempty"`
}
type TeamPlayerStats struct {
Player Player `json:"player"`
Statistics PlayerGameStatistics `json:"statistics"`
}
type PlayerGameStatistics struct {
General GeneralStats `mapstructure:"games" json:"genaral"`
Offsides int `json:"offsides"`
Shots ShotsStats `json:"shots"`
Goals GoalStats `json:"goals"`
Passes PassesStats `json:"passes"`
Tackles TacklesStats `json:"tackles"`
Duels DuelsStats `json:"duels"`
Dribbles DribblesStats `json:"dribbles"`
Fouls FoulsStats `json:"fouls"`
Cards CardsStats `json:"cards"`
Penalty PenaltyStats `json:"penalty"`
}
type GeneralStats struct {
Minutes int `json:"minutes"`
Number int `json:"number"`
Position LineupPosition `json:"position"`
Rating float32 `json:"rating"`
Captain bool `json:"captain"`
Substitute bool `json:"substitute"`
}
type ShotsStats struct {
Total int `json:"total"`
On int `json:"on"`
}
type GoalStats struct {
Total int `json:"total"`
Conceded int `json:"conceded"`
Assists int `json:"assists"`
Saves int `json:"saves"`
}
type PassesStats struct {
Total int `json:"total"`
Key int `json:"key"`
AccuracyPercent int `mapstructure:"accuracy" json:"accuracy"`
}
type TacklesStats struct {
Total int `json:"total"`
Blocks int `json:"blocks"`
Interceptions int `json:"interceptions"`
}
type DuelsStats struct {
Total int `json:"total"`
Won int `json:"won"`
}
type DribblesStats struct {
Attempts int `json:"attempts"`
Success int `json:"success"`
Past int `json:"past"`
}
type FoulsStats struct {
Drawn int `json:"drawn"`
Committed int `json:"committed"`
}
type CardsStats struct {
Yellow int `json:"yellow"`
Red int `json:"red"`
}
type PenaltyStats struct {
Won int `json:"won"`
Committed int `mapstructure:"commited" json:"committed"`
Scored int `json:"scored"`
Missed int `json:"missed"`
Saved int `json:"saved"`
}