config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JWT_SECRET []byte

Functions

func GetJWTSecret

func GetJWTSecret() []byte

获取JWT密钥

func LoadConfig

func LoadConfig() error

Types

type AppConfig

type AppConfig struct {
	Server struct {
		Port string `yaml:"port"`
		Host string `yaml:"host"`
		Mode string `yaml:"mode"`
	} `yaml:"server"`
	Database struct {
		Type string `yaml:"type"`
		Path string `yaml:"path"`
	} `yaml:"database"`
	Setting struct {
		SiteTitle     string `yaml:"sitetitle"`
		Servername    string `yaml:"servername"`
		Serverurl     string `yaml:"serverurl"`
		AllowRegister bool   `yaml:"allowregister"`
		Icpnumber     string `yaml:"icpnumber"`
	}
	Upload struct {
		ImageMaxSize int      `yaml:"imagemaxsize"`
		AudioMaxSize int      `yaml:"audiomaxsize"`
		AllowedTypes []string `yaml:"allowedtypes"`
		ImagePath    string   `yaml:"imagepath"`
		AudioPath    string   `yaml:"audiopath"`
	} `yaml:"upload"`
	Auth struct {
		Jwt struct {
			Expires  int    `yaml:"expires"`
			Issuer   string `yaml:"issuer"`
			Audience string `yaml:"audience"`
		} `yaml:"jwt"`
	} `yaml:"auth"`
}
var Config AppConfig

Jump to

Keyboard shortcuts

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