Documentation
¶
Index ¶
- func FighterStatsrToProto(f *FighterStats) *gen.FighterStats
- func FighterToProto(f *Fighter) *gen.Fighter
- func FightersReqToProto(freq FightersRequest) *gen.FightersRequest
- func FightersToProto(fs []*Fighter) []*gen.Fighter
- func HealthStatusToProto(status *HealthStatus) *gen.HealthResponse
- type Division
- type Fighter
- type FighterStats
- type FighterStatus
- type FightersRequest
- type HealthStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FighterStatsrToProto ¶
func FighterStatsrToProto(f *FighterStats) *gen.FighterStats
FighterStatsrToProto converts a single Fighter stats struct into a generated proto counterpart.
func FighterToProto ¶
FighterToProto converts a single Fighter struct into a generated proto counterpart.
func FightersReqToProto ¶
func FightersReqToProto(freq FightersRequest) *gen.FightersRequest
func FightersToProto ¶
FightersToProto converts a slice of Fighter structs into a slice of generated proto counterparts.
func HealthStatusToProto ¶
func HealthStatusToProto(status *HealthStatus) *gen.HealthResponse
HealthStatusToProto converts HealthStatus model to gen.HealthResponse
Types ¶
type Division ¶
type Division int
Division represents weight divisions
const ( Flyweight Division = 1 Bantamweight Division = 2 Featherweight Division = 3 Lightweight Division = 4 Welterweight Division = 5 Middleweight Division = 6 Lightheavyweight Division = 7 Heavyweight Division = 8 WomensStrawweight Division = 9 WomensFlyweight Division = 10 WomensBantamweight Division = 11 WomensFeatherweight Division = 12 )
type Fighter ¶
type Fighter struct { FighterId int32 `json:"fighter_id,omitempty"` Name string `json:"name"` NickName string `json:"nickName"` DivisionId Division `json:"division_id"` Status FighterStatus `json:"status"` Hometown string `json:"hometown"` TrainsAt string `json:"trainsAt"` FightingStyle string `json:"fightingStyle"` Age int8 `json:"age"` Height float32 `json:"height"` Weight float32 `json:"weight"` OctagonDebut string `json:"octagonDebut"` DebutTimestamp int `json:"debutTimestamp"` Reach float32 `json:"reach"` LegReach float32 `json:"legReach"` Wins int `json:"wins"` Loses int `json:"loses"` Draw int `json:"draw"` FighterUrl string `json:"fighterUrl"` ImageUrl string `json:"imageUrl"` Stats FighterStats `json:"stats"` }
Fighter represents fighter information
func FighterFromProto ¶
FighterFromProto converts a generated proto counterpart into a single Fighter struct.
func FightersFromProto ¶
FightersFromProto converts a slice of generated proto counterparts into a slice of Fighter structs.
type FighterStats ¶
type FighterStats struct { StatId int32 `json:"stat_id"` FighterId int32 `json:"fighter_id,omitempty"` TotalSigStrLanded int `json:"totalSigStrLandned,omitempty"` TotalSigStrAttempted int `json:"totalSigStrAttempted,omitempty"` StrAccuracy int `json:"strAccuracy,omitempty"` TotalTkdLanded int `json:"totalTkdLanded,omitempty"` TotalTkdAttempted int `json:"totalTkdAttempted,omitempty"` TkdAccuracy int `json:"tkdAccuracy,omitempty"` SigStrLanded float32 `json:"sigStrLanded,omitempty"` SigStrAbs float32 `json:"sigStrAbs,omitempty"` SigStrDefense int8 `json:"sigStrDefense,omitempty"` TakedownDefense int8 `json:"takedownDefense,omitempty"` TakedownAvg float32 `json:"takedownAvg,omitempty"` SubmissionAvg float32 `json:"submissionAvg,omitempty"` KnockdownAvg float32 `json:"knockdownAvg,omitempty"` AvgFightTime string `json:"avgFightTime,omitempty"` WinByKO int `json:"winByKO"` WinBySub int `json:"winBySub"` WinByDec int `json:"winByDec"` }
FighterStats represents statistical information for a fighter
func FighterStatsFromProto ¶
func FighterStatsFromProto(f *gen.FighterStats) *FighterStats
FighterStatsFromProto converts a generated proto counterpart into a single Fighter stats struct..
type FighterStatus ¶
type FighterStatus string
FighterStatus defines a fighter status. Uses to find active fighters
type FightersRequest ¶
type FightersRequest struct { Status string `json:"status"` FightersIds []int32 `json:"fighter_ids"` }
FightersRequest represents a request for fighters