config

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// All logs redirected to file
	LogFile string

	// Path to directory contains task xml files
	TaskDir string

	Database struct {
		Connection     string
		MaxConnections int
		SafeReinit     bool
	}

	Scoreboard struct {
		WwwPath       string
		TemplatePath  string
		Addr          string
		RecalcTimeout _duration
		UnderProxy    bool
	}

	WebsocketTimeout struct {
		Info       _duration
		Scoreboard _duration
		Tasks      _duration
	}

	TaskPrice struct {
		UseNonLinear           bool
		UseTeamsBase           bool
		TeamsBase              int
		P500, P400, P300, P200 int
	}

	Game struct {
		Start _time
		End   _time
	}

	Flag struct {
		// Timeout between send flags
		SendTimeout _duration
	}

	Task struct {
		// Timeout after send correct flag before open next task
		OpenTimeout _duration
		// Auto open task after previous solved
		AutoOpen        bool
		AutoOpenTimeout _duration
	}

	Teams []struct {
		Name        string
		Description string
		Token       string
		Test        bool
	}
}

Config is a configuration of henhouse

func ReadConfig

func ReadConfig(path string) (cfg Config, err error)

ReadConfig read file and return configuration

type Task

type Task struct {
	Name          string
	Description   string
	NameEn        string
	DescriptionEn string
	Category      string
	Tags          string
	Level         int
	ForceClosed   bool
	Flag          string
	Author        string
}

Task is xml task data model

func ParseXMLTask

func ParseXMLTask(rawXML []byte) (task Task, err error)

ParseXMLTask parse xml task

Jump to

Keyboard shortcuts

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