config

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	Enabled bool   `yaml:"enabled"`
	Listen  string `yaml:"listen"`
}

type Auth

type Auth struct {
	JWT    JWT    `yaml:"jwt"`
	GitLab GitLab `yaml:"gitlab"`
	Local  Local  `yaml:"local"`
}

type CORS

type CORS struct {
	AllowedOrigins []string `yaml:"allowed_origins"`
}

type Cluster

type Cluster struct {
	Name  string `yaml:"name" json:"name"`
	Nodes []Node `yaml:"node" json:"node"`
}

type Config

type Config struct {
	Cluster []Cluster `yaml:"cluster"`
	Contest []string  `yaml:"contest"`
	Logger  Logger    `yaml:"logger"`
	Storage Storage   `yaml:"storage"`
	Auth    Auth      `yaml:"auth"`
	Listen  string    `yaml:"listen"`
	Admin   Admin     `yaml:"admin"`
	CORS    CORS      `yaml:"cors"`
	Links   []Link    `yaml:"links"`
}

func Load

func Load(path string) (*Config, error)

type DockerConfig added in v0.4.3

type DockerConfig struct {
	Host      string `yaml:"host"`
	TLSVerify bool   `yaml:"tls_verify"`
	CACert    string `yaml:"ca_cert"`
	Cert      string `yaml:"cert"`
	Key       string `yaml:"key"`
}

type GitLab

type GitLab struct {
	App                 string `yaml:"app"`
	URL                 string `yaml:"url"`
	ClientID            string `yaml:"client_id"`
	ClientSecret        string `yaml:"client_secret"`
	RedirectURI         string `yaml:"redirect_uri"`
	FrontendCallbackURL string `yaml:"frontend_callback_url"`
}

type JWT

type JWT struct {
	Secret      string `yaml:"secret"`
	ExpireHours int    `yaml:"expire_hours"`
}
type Link struct {
	Name string `yaml:"name" json:"name"`
	URL  string `yaml:"url"  json:"url"`
}

type Local

type Local struct {
	Enabled bool `yaml:"enabled"`
}

Local defines configuration for username/password authentication.

type Logger

type Logger struct {
	Level string `yaml:"level"`
	File  string `yaml:"file"`
}

type Node

type Node struct {
	Name   string       `yaml:"name" json:"name"`
	CPU    int          `yaml:"cpu" json:"cpu"`
	Memory int64        `yaml:"memory" json:"memory"`
	Docker DockerConfig `yaml:"docker" json:"docker"`
}

type Storage

type Storage struct {
	UserAvatar        string `yaml:"user_avatar"`
	SubmissionContent string `yaml:"submission_content"`
	Database          string `yaml:"database"`
	SubmissionLog     string `yaml:"submission_log"`
}

Jump to

Keyboard shortcuts

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