Documentation
¶
Index ¶
- func BetRequestToProto(bet *Bet) *gen.CreateBetRequest
- func BetsToProto(bets []*Bet) []*gen.Bet
- func EventRequestToProto(req *EventRequest) *gen.CreateEventRequest
- func EventsToProto(events []*Event) []*gen.Event
- func FightResultToProto(req *FightResultRequest) *gen.FightResultRequest
- func FightsToProto(fights []Fight) []*gen.Fight
- func HealthStatusToProto(status *HealthStatus) *gen.HealthResponse
- type Bet
- type BetsResponse
- type Event
- type EventRequest
- type EventsResponse
- type Fight
- type FightResponse
- type FightResultRequest
- type FullEventResponse
- type HealthStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BetRequestToProto ¶
func BetRequestToProto(bet *Bet) *gen.CreateBetRequest
func BetsToProto ¶
func EventRequestToProto ¶
func EventRequestToProto(req *EventRequest) *gen.CreateEventRequest
func EventsToProto ¶
func FightResultToProto ¶
func FightResultToProto(req *FightResultRequest) *gen.FightResultRequest
func FightsToProto ¶
func HealthStatusToProto ¶
func HealthStatusToProto(status *HealthStatus) *gen.HealthResponse
HealthStatusToProto converts HealthStatus model to gen.HealthResponse
Types ¶
type Bet ¶
type Bet struct {
BetId int32 `json:"bet_id"`
FightId int32 `json:"fight_id"`
UserId int32 `json:"user_id"`
FighterId int32 `json:"fighter_id"`
}
Bet represents users bet properties
func BetRequestFromProto ¶
func BetRequestFromProto(p *gen.CreateBetRequest) *Bet
func BetsFromProto ¶
type BetsResponse ¶
type Event ¶
type Event struct {
EventId int32 `json:"event_id"`
Name string `json:"name"`
Fights []Fight `json:"fights"`
IsDone bool `json:"is_done"`
}
Event represents a event struct with []Fights
func EventsFromProto ¶
type EventRequest ¶
EventRequest represents a request for event with name and slice of fights
func EventRequestFromProto ¶
func EventRequestFromProto(p *gen.CreateEventRequest) *EventRequest
type EventsResponse ¶
EventResponse represents a event response with []Event
type Fight ¶
type Fight struct {
FightId int32 `json:"fight_id"`
EventId int32 `json:"event_id"`
FighterRedId int32 `json:"fighter_red_id"`
FighterBlueId int32 `json:"fighter_blue_id"`
IsDone bool `json:"is_done"`
IsDraw bool `json:"is_draw"`
IsCanceled bool `json:"is_canceled"`
NotContest bool `json:"not_contest"`
WinnerId int32 `json:"winner_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
FightDate sql.NullTime `json:"fight_date"`
}
Fight is a structure with fight information and fighters ids
func FightsFromProto ¶
type FightResponse ¶
type FightResponse struct {
FightId int32 `json:"fight_id"`
EventId int32 `json:"event_id,omitempty"`
FighterRed fightersmodel.Fighter `json:"fighter_red"`
FighterBlue fightersmodel.Fighter `json:"fighter_blue"`
IsDone bool `json:"is_done"`
IsCanceled bool `json:"is_canceled"`
NotContest bool `json:"not_contest"`
Result int32 `json:"result"`
CreatedAt int64 `json:"created_at"`
FightDate int `json:"fight_date,omitempty"`
}
Fight is a structure with information about the fight and contains the structures of the participating fighters
type FightResultRequest ¶
type FightResultRequest struct {
FightId int32 `json:"fight_id"`
WinnerId int32 `json:"winner_id"`
IsCanceled bool `json:"is_canceled"`
IsDraw bool `json:"is_draw"`
NotContest bool `json:"not_contest"`
Method string `json:"method"`
Round int `json:"round"`
}
FightResultRequest represents a request for fight result with fight id, winner id and not contest flag.
func FightResultFromProto ¶
func FightResultFromProto(p *gen.FightResultRequest) *FightResultRequest
type FullEventResponse ¶
type FullEventResponse struct {
EventId int32 `json:"event_id"`
Name string `json:"name"`
Fights []FightResponse `json:"fights"`
IsDone bool `json:"is_done"`
}
EventResponse represents a event response with []FightsResponse
type HealthStatus ¶
Click to show internal directories.
Click to hide internal directories.