scoreboard

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountScoreAndSort

func CountScoreAndSort(r *Result)

CountScoreAndSort update scoreboard helper

func DisableAdvisory

func DisableAdvisory()

DisableAdvisory turn off advisory in overall score

func Scoreboard

func Scoreboard(db *sql.DB, attackFlow chan Attack, wwwPath, addr string,
	updateTimeout time.Duration, start time.Time, half, lunch,
	darkest time.Duration) (err error)

Scoreboard run scoreboard page

Types

type Attack

type Attack struct {
	Attacker  int
	Victim    int
	Service   int
	Timestamp int64
}

Attack describe attack for api

type ByScore

type ByScore []TeamResult

ByScore sort team result by score

func (ByScore) Len

func (tr ByScore) Len() int

func (ByScore) Less

func (tr ByScore) Less(i, j int) bool

func (ByScore) Swap

func (tr ByScore) Swap(i, j int)

type Result

type Result struct {
	Teams    []TeamResult
	Services []string
}

Result contain result and services for scoreboard

func CollectLastResult

func CollectLastResult(db *sql.DB) (r Result, err error)

CollectLastResult returns actual scoreboard

func (Result) ToHTML

func (r Result) ToHTML(hideScore bool) string

ToHTML convert Result to HTML

type TeamResult

type TeamResult struct {
	ID              int
	Rank            int
	Name            string
	Score           float64
	ScorePercent    float64
	Attack          float64
	AttackPercent   float64
	Defence         float64
	DefencePercent  float64
	Advisory        int
	AdvisoryPercent float64
	Status          []steward.ServiceState
}

TeamResult contain info for scoreboard

func (TeamResult) ToHTML

func (tr TeamResult) ToHTML(hideScore bool) string

ToHTML convert TeamResult to HTML

Jump to

Keyboard shortcuts

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