config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 1 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 {
	// Server configuration
	ServerAddress     string `envconfig:"SERVER_ADDRESS" default:":3000"`
	LogLevel          int    `envconfig:"LOG_LEVEL" default:"4"`
	MaxParallelJudges int    `envconfig:"MAX_PARALLEL_JUDGES" default:"5"`
	TestPath          string `envconfig:"TESTS_PATH" default:"test_cases"`

	// Database
	DatabasePath string `envconfig:"DB_PATH" default:"database/"`
	DatabaseTTL  int    `envconfig:"DB_TTL" default:"0"`

	// PDF
	PDFFooterCopyright     string `envconfig:"PDF_FOOTER_COPYRIGHT" default:""`
	PDFFooterGeneratedWith string `envconfig:"PDF_FOOTER_GENERATEDWITH" default:"Generated with https://github.com/Gurkengewuerz/GitCodeJudge"`

	// Gitea configuration
	GiteaURL           string `envconfig:"GITEA_URL" required:"true"`
	GiteaToken         string `envconfig:"GITEA_TOKEN" required:"true"`
	GiteaWebhookSecret string `envconfig:"GITEA_WEBHOOK_SECRET" required:"true"`

	// Docker configuration
	DockerImage   string `envconfig:"DOCKER_IMAGE" default:"ghcr.io/gurkengewuerz/gitcodejudge-judge:latest"`
	DockerNetwork string `envconfig:"DOCKER_NETWORK" default:"none"`
	DockerTimeout int    `envconfig:"DOCKER_TIMEOUT" default:"30"`
}
var CFG *Config

func Load

func Load() (*Config, error)

Jump to

Keyboard shortcuts

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