-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add template package, update models, and enhance challenge management
WIP: Should print a functioning yaml compose, still doesn't for now, mostly due to placeholder not being filled + type issue making some parameters list of strings instead of simple strings
- Loading branch information
1 parent
3efac7a
commit 09f9206
Showing
13 changed files
with
533 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/Lolozendev/CTFManager/internal" | ||
"github.com/Lolozendev/CTFManager/serializer" | ||
) | ||
|
||
func main() { | ||
logger := internal.GetLogger() | ||
defer logger.Sync() | ||
logger.Info("Hello, World!") | ||
logger.Warn("This is a warning!") | ||
logger.Error("This is an error!") | ||
|
||
logger.Info("only usable command for now is 'team create <teamname>'") | ||
|
||
if len(os.Args) < 4 { | ||
logger.Error("Error: Missing arguments") | ||
return | ||
} | ||
|
||
logger.Info("creating team ", os.Args[3]) | ||
|
||
serialized, err := serializer.SerializeTeam(1, os.Args[3], []string{"user1", "user2"}) | ||
if err != nil { | ||
logger.Error("Error: ", err) | ||
return | ||
} | ||
|
||
fmt.Println(serialized) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package constants | ||
|
||
// This holds the constants for the paths of the challenges and teams used in multiple part of the project | ||
const ( | ||
ChallengesPath string = "/challenges" | ||
ChallengesFirstNetworkPosition int = 11 | ||
ChallengesLastNetworkPosition int = 249 | ||
TeamsPath string = "/equipes" | ||
TeamsFirstNetworkPosition int = 1 | ||
TeamsLastNetworkPosition int = 254 | ||
DnsMasqTemplatePath string = "/dnsconf/dnsmasq.template" | ||
|
||
//placeholders | ||
TeamNamePlaceholder string = "<TEAM_NAME>" | ||
TeamNumberPlaceholder string = "<TEAM_NUMBER>" | ||
ChallengeNamePlaceholder string = "<CHALLENGE_NAME>" | ||
ChallengeNumberPlaceholder string = "<CHALLENGE_NUMBER>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package template | ||
|
||
type Placeholder struct { | ||
TeamName string | ||
ChallengeName string | ||
} |
Oops, something went wrong.