Documentation
¶
Overview ¶
Package config contains structures and functions for contest and application config
Package config contains structures and functions for contest and application config ¶
Package config contains structures and functions for contest and application config
Index ¶
Constants ¶
This section is empty.
Variables ¶
var TestDir string = "temp"
Functions ¶
This section is empty.
Types ¶
type ApplicationConfig ¶
AplicationConfig represents config for application Port is listening port for the web server ConfigPath is path to the config for the contest LanguagesPath is path to the config for the programming languages If Generate is true that application will generate new contest, otherwise that will use existing contest
func ParseArgs ¶
func ParseArgs() *ApplicationConfig
ParseArgs parses arguments from command line returns pointer to ApplicationConfig that constructued from command line arguments
type Config ¶
type Config struct {
TestsInfo map[string]struct {
Path string `json:"path"`
TestsCount int `json:"count"`
} `json:"tests"`
OutputPath string `json:"outputPath"`
StartTime string `json:"startTime"`
Contestants []struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"contestants"`
Credentials map[string]struct {
Id string `json:"id"`
Password string `json:"password"`
Role string `json:"role"`
} `json:"credentials"`
Problems []string `json:"problems"`
Duration int64 `json:"duration"`
}
Config represents information about the contest. TestsInfo represents information about count of the test and path to the directory with tests OutputPath represents path to output json file with contest info StartTime represents start time of the contest Contestans represents basic information about contestans Name and Id Credentials represents id/login/password/role for every contestant (Role = user/admin) Problems represents array of the problem names in the contest. For example: ["A", "B", "C"] Duration is duration of the contest in seconds
var TestConfig *Config
func ParseConfig ¶
ParseConfig parses Config from json file with specified path.
type Language ¶
Langauge represents information about programming language Name is a full name of programming language Value is a short name of programming language For example: Name = "C++ 20 (gcc)", Value = "cpp20"
type Languages ¶
type Languages struct {
Langs []Language `json:"languages"`
CompileFiles map[string]string `json:"compileFiles"`
}
Languages represents information about all using programming languages in the contest Langs is array of Language with base information about each language CompileFiles is map that associate short name of the programming language with path to the compilation shell script
var LangaugesConfig *Languages
func ParseLangauges ¶
ParseLanguages parses Languages from the specifed json file. returns pointer to Languages
func (*Languages) GetCompileFileName ¶
GetCompileFileName returns path to the compilation shell script for the specified programming languages language specifies programming language
func (*Languages) GetLanguages ¶
GetLangauges returns array of basic information about programming languages in the contest as array of Language