config

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(conf *Config) (bool, error)

func Save

func Save(conf *Config) error

Types

type AppConfig

type AppConfig struct {
	Debug            bool   `yaml:"debug"`
	Key              string `yaml:"key"`
	Locale           string `yaml:"locale"`
	Timezone         string `yaml:"timezone"`
	Root             string `yaml:"root"`
	APIEndpoint      string `yaml:"api_endpoint"`
	DownloadEndpoint string `yaml:"download_endpoint"`
}

type Config

type Config struct {
	App      AppConfig      `yaml:"app"`
	HTTP     HTTPConfig     `yaml:"http"`
	Database DatabaseConfig `yaml:"database"`
	Session  SessionConfig  `yaml:"session"`
}

Config 面板配置结构体

func Load

func Load() (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Debug bool `yaml:"debug"`
}

type HTTPConfig

type HTTPConfig struct {
	Debug         bool     `yaml:"debug"`
	Port          uint     `yaml:"port"`
	Entrance      string   `yaml:"entrance"`
	EntranceError string   `yaml:"entrance_error"`
	TLS           string   `yaml:"tls"` // off, acme, self-signed, custom
	LoginCaptcha  bool     `yaml:"login_captcha"`
	IPHeader      string   `yaml:"ip_header"`
	BindDomain    []string `yaml:"bind_domain"`
	BindIP        []string `yaml:"bind_ip"`
	BindUA        []string `yaml:"bind_ua"`
}

func (*HTTPConfig) IsHTTPS added in v3.2.0

func (c *HTTPConfig) IsHTTPS() bool

IsHTTPS 判断是否启用 HTTPS

type SessionConfig

type SessionConfig struct {
	Lifetime uint `yaml:"lifetime"`
}

Jump to

Keyboard shortcuts

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