diff options
author | Emile <hanemile@protonmail.com> | 2019-10-20 00:38:04 +0200 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2019-10-20 00:38:04 +0200 |
commit | be51cb0c773fbe8752e1e1e4d1f3ceae56fbcd37 (patch) | |
tree | 0f747fb0943cc69e76d4c200ca0593bab199344e /src | |
parent | fffe9721311182163db13859b901d32d02a75591 (diff) |
formatting
Diffstat (limited to 'src')
-rw-r--r-- | src/challenge.go | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/challenge.go b/src/challenge.go index 3fb26d7..547a5c8 100644 --- a/src/challenge.go +++ b/src/challenge.go @@ -3,53 +3,53 @@ package main import "time" type Challenge struct { - Name string + Name string Description string - Flag string // this should never leave the server - FoundFlag time.Time - FlagTries uint - Container string // this could, but is not required as well - Category string - Points int + Flag string // this should never leave the server + FoundFlag time.Time + FlagTries uint + Container string // this could, but is not required as well + Category string + Points int } // TODO: The name "Stripped" is a bit inaccurate now. Rename. type StrippedChallenge struct { - Name string `json:"name"` - Description string `json:"description"` - Category string `json:"category"` - FoundFlag int64 `json:"foundFlag"` - FlagTries uint `json:"flagTries"` - ContainsLaunchable bool `json:"ContainsLaunchable"` - IPAddress string `json:"IPAddress"` - Points int `json:"points"` + Name string `json:"name"` + Description string `json:"description"` + Category string `json:"category"` + FoundFlag int64 `json:"foundFlag"` + FlagTries uint `json:"flagTries"` + ContainsLaunchable bool `json:"ContainsLaunchable"` + IPAddress string `json:"IPAddress"` + Points int `json:"points"` } type StatsStrippedChallenge struct { - Name string `json:"name"` - FoundFlag int64 `json:"foundFlag"` - FlagTries uint `json:"flagTries"` - Points int `json:"points"` + Name string `json:"name"` + FoundFlag int64 `json:"foundFlag"` + FlagTries uint `json:"flagTries"` + Points int `json:"points"` } -func stripChallenge(c Challenge) (StrippedChallenge) { +func stripChallenge(c Challenge) StrippedChallenge { return StrippedChallenge{ - Name: c.Name, - Description: c.Description, - Category: c.Category, - FoundFlag: c.FoundFlag.Unix(), - FlagTries: c.FlagTries, + Name: c.Name, + Description: c.Description, + Category: c.Category, + FoundFlag: c.FoundFlag.Unix(), + FlagTries: c.FlagTries, ContainsLaunchable: c.Container != "", - IPAddress: getAddressForChallengeContainer(c.Container), - Points: c.Points, + IPAddress: getAddressForChallengeContainer(c.Container), + Points: c.Points, } } -func stripChallengeForStatistics(c Challenge) (StatsStrippedChallenge) { +func stripChallengeForStatistics(c Challenge) StatsStrippedChallenge { return StatsStrippedChallenge{ - Name: c.Name, + Name: c.Name, FoundFlag: c.FoundFlag.Unix(), FlagTries: c.FlagTries, - Points: c.Points, + Points: c.Points, } } |