model

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

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

func FighterToProto(f *Fighter) *gen.Fighter

FighterToProto converts a single Fighter struct into a generated proto counterpart.

func FightersReqToProto

func FightersReqToProto(freq FightersRequest) *gen.FightersRequest

func FightersToProto

func FightersToProto(fs []*Fighter) []*gen.Fighter

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
)

func (Division) String

func (d Division) String() string

String returns the string representation of a Division.

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

func FighterFromProto(f *gen.Fighter) *Fighter

FighterFromProto converts a generated proto counterpart into a single Fighter struct.

func FightersFromProto

func FightersFromProto(fs []*gen.Fighter) []*Fighter

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

type HealthStatus

type HealthStatus struct {
	AppDevVersion string `json:"app_dev_version"`
	AppName       string `json:"app_name"`
	AppRunDate    int64  `json:"app_run_date"`
	AppTimeAlive  int64  `json:"app_time_alive"`
	Healthy       bool   `json:"healthy"`
	Message       string `json:"message"`
	Timestamp     string `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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