config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Type     string `toml:"type" comment:"默认使用内存缓存,若需要集群部署,填写 redis"`
	Ram      int    `toml:"ram" comment:"内存缓存使用大小,单位 b"`
	Addr     string `toml:"addr" comment:"redis 服务端地址,如 127.0.0.1:6379"`
	Password string `toml:"password" comment:"redis 密码"`
}

type Captcha

type Captcha struct {
	Type    string `toml:"type" comment:"验证码类型,目前只支持 cloudflare turnstile,若需要填写 turnstile"`
	SiteKey string `toml:"siteKey"`
	Secret  string `toml:"secret"`
}

type Config

type Config struct {
	OfflineUUID    bool        `` /* 175-byte string literal not displayed */
	Port           string      `toml:"port"`
	Log            Log         `toml:"log"`
	Sql            Sql         `toml:"sql"`
	Debug          bool        `toml:"debug" comment:"输出每条执行的 sql 语句"`
	Cache          Cache       `toml:"cache"`
	RaelIP         bool        `` /* 137-byte string literal not displayed */
	MaxIpUser      int         `toml:"maxIpUser" comment:"ip 段最大注册用户,ipv4 为 /24 ipv6 为 /48"`
	RsaPriKey      string      `toml:"rsaPriKey,multiline" comment:"运行后勿修改,若为集群需设置为一致"`
	TexturePath    string      `toml:"texturePath" comment:"材质文件保存路径,如果需要对象存储可以把对象储存挂载到本地目录上"`
	TextureBaseUrl string      `` /* 336-byte string literal not displayed */
	WebBaseUrl     string      `toml:"webBaseUrl" comment:"用于在支持的启动器中展示本站的注册地址\n填写类似 https://example.com"`
	ServerName     string      `toml:"serverName" comment:"皮肤站名字,用于在多个地方展示"`
	Captcha        Captcha     `toml:"captcha"`
	Email          EmailConfig `toml:"email"`
}

func Default

func Default() Config

type EmailConfig added in v0.0.3

type EmailConfig struct {
	Enable      bool       `toml:"enable" comment:"注册验证邮件,且允许使用邮箱找回账号"`
	Smtp        []SmtpUser `toml:"smtp"`
	AllowDomain []string   `toml:"allow_domain" comment:"允许用于注册的邮箱域名,留空则允许全部"`
	EmailReg    string     `toml:"email_reg" comment:"邮箱正则,留空则不处理,如 ^[0-9]+@qq.com$|^[^+\\.A-Z]+@gmail.com$"`
	EmailRegMsg string     `toml:"email_reg_msg" comment:"不满足要求时的提示信息"`
}

type Log

type Log struct {
	Level string `toml:"level"`
	Json  bool   `toml:"json" comment:"json 格式输出"`
}

type SmtpUser added in v0.0.3

type SmtpUser struct {
	Host string `toml:"host"`
	Port int    `toml:"port"`
	SSL  bool   `toml:"SSL" comment:"启用 ssl"`
	Name string `toml:"name"`
	Pass string `toml:"password"`
}

type Sql

type Sql struct {
	DriverName string `toml:"driverName" comment:"可填 mysql 或 sqlite3"`
	Dsn        string `` /* 265-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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