api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DayDuration

type DayDuration int

func (DayDuration) String

func (d DayDuration) String() string

based on day work time

type Gamelog added in v1.0.1

type Gamelog struct {
	ID    primitive.ObjectID `json:"id" bson:"_id"`
	Kills []Kill             `json:"kills" bson:"kills"`
	Date  time.Time          `json:"date" bson:"date"`
}

type Item

type Item struct {
	Name    string `json:"name" bson:"_id"`
	Pickups uint   `json:"pickups" bson:"pickups"`
	Time    uint   `json:"time,omitempty" bson:"time,omitempty"`
}

type Kill added in v1.0.1

type Kill struct {
	Killer string `json:"killer" bson:"killer"`
	Victim string `json:"victim" bson:"victim"`
}

type Map

type Map struct {
	Name    string      `json:"name" bson:"_id"`
	Winners []MapWinner `json:"winners" bson:"winners"`
}

type MapWinner

type MapWinner struct {
	Name string `json:"name" bson:"playername"`
	Wins int    `json:"wins" bson:"wins"`
}

type Match

type Match struct {
	ID       primitive.ObjectID `json:"id" bson:"_id"`
	Map      string             `json:"map" bson:"map"`
	Type     string             `json:"type" bson:"type"`
	Duration uint               `json:"duration" bson:"duration"`
	Datetime string             `json:"datetime" bson:"datetime"`
	Players  []struct {
		Name        string `json:"name" bson:"name"`
		Score       int    `json:"score" bson:"score"`
		Kills       uint   `json:"kills" bson:"kills"`
		Deaths      uint   `json:"deaths" bson:"deaths"`
		Suicides    uint   `json:"suicides" bson:"suicides"`
		DamageGiven uint   `json:"damage_given" bson:"damage_given"`
		DamageTaken uint   `json:"damage_taken" bson:"damage_taken"`
		HealtTotal  uint   `json:"health_total" bson:"health_total"`
		ArmorTotal  uint   `json:"armor_total" bson:"armor_total"`
		Weapons     []struct {
			Name  string `json:"name" bson:"name"`
			Hits  uint   `json:"hits" bson:"hits"`
			Shots uint   `json:"shots" bson:"shots"`
			Kills uint   `json:"kills" bson:"kills"`
		} `json:"weapons" bson:"weapons"`
		Items []struct {
			Name    string `json:"name" bson:"name"`
			Pickups uint   `json:"pickups" bson:"pickups"`
		} `json:"items" bson:"items"`
		Powerups []struct {
			Name    string `json:"name" bson:"name"`
			Pickups uint   `json:"pickups" bson:"pickups"`
			Time    uint   `json:"time" bson:"time"`
		} `json:"powerups" bson:"powerups"`
	} `json:"players" bson:"players"`
}

type MatchRepository

type MatchRepository struct {
	Ctx context.Context
	DB  *mongo.Database
}

type Player

type Player struct {
	Name        string   `json:"name" bson:"_id"`
	Games       int      `json:"games" bson:"games"`
	Score       int      `json:"score" bson:"score"`
	Kills       uint     `json:"kills" bson:"kills"`
	Deaths      uint     `json:"deaths" bson:"deaths"`
	Suicides    uint     `json:"suicides" bson:"suicides"`
	DamageGiven uint     `json:"damage_given" bson:"damage_given"`
	DamageTaken uint     `json:"damage_taken" bson:"damage_taken"`
	HealtTotal  uint     `json:"health_total" bson:"health_total"`
	ArmorTotal  uint     `json:"armor_total" bson:"armor_total"`
	Weapons     []Weapon `json:"weapons" bson:"weapons"`
	Items       []Item   `json:"items" bson:"items"`
	Powerups    []Item   `json:"powerups,omitempty" bson:"powerups,omitempty"`
}

type Server

type Server struct {
	Port     string
	DbClient *mongo.Client
	DbName   string
	// contains filtered or unexported fields
}

func (*Server) Run

func (s *Server) Run()

type Weapon

type Weapon struct {
	Name  string `json:"name" bson:"_id"`
	Hits  uint   `json:"hits" bson:"hits"`
	Shots uint   `json:"shots" bson:"shots"`
	Kills uint   `json:"kills" bson:"kills"`
}

type Winner

type Winner struct {
	Name string `json:"name" bson:"_id"`
	Wins int    `json:"wins" bson:"wins"`
}

Jump to

Keyboard shortcuts

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