Documentation
¶
Index ¶
Constants ¶
View Source
const ConfigFileName = "config.json"
Variables ¶
View Source
var DefaultConfigJsonByte []byte
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶ added in v1.9.0
type AuthConfig struct {
Password string `json:"password"` // 认证密码
JwtSecret string `json:"jwtSecret"` // JWT密钥
TokenExpiration int `json:"tokenExpiration"` // 令牌过期时间(小时)
}
AuthConfig 认证配置结构体
type Config ¶
type Config struct {
Port string `json:"port"`
Debug bool `json:"debug"`
NotAllowedDeleteLog bool `json:"notAllowedDeleteLog"`
RpcAddress []*Address `json:"rpcAddress"`
SelfRpcAddress *Address `json:"selfRpcAddress"`
CorsConfig *CorsConfig `json:"corsConfig"`
StorageConfig *StorageConfig `json:"storageConfig"`
DatabaseConfig *DatabaseConfig `json:"databaseConfig"`
MaxRoomNumber int `json:"maxRoomNumber"`
// max log file size, unit is mb
MaxLogFileSizeOfMB int64 `json:"maxLogFileSizeOfMB"`
// max log file size, unit is day
MaxLogLifeTimeOfHour int64 `json:"maxLogLifeTimeOfHour"`
AuthConfig *AuthConfig `json:"authConfig"`
}
Config 应用配置结构体
func LoadConfig ¶
func (*Config) GetMaxLogFileSizeOfMB ¶
func (*Config) GetMaxLogLifeTimeOfHour ¶
func (*Config) GetMaxRoomNumber ¶
func (*Config) IsRemoteStorage ¶
type CorsConfig ¶
type DatabaseConfig ¶ added in v1.10.0
type DatabaseConfig struct {
MySQLURL string `json:"mysqlUrl"` // MySQL connection URL, if empty use SQLite
}
type StaticConfig ¶
type StorageConfig ¶
type StorageConfig struct {
LogDirName string `json:"logDir"`
BaseDir string `json:"baseDir"`
KeyId string `json:"keyId"`
Secret string `json:"secret"`
Region string `json:"region"`
Endpoint string `json:"endpoint"`
Bucket string `json:"bucket"`
S3ForcePathStyle bool `json:"s3ForcePathStyle"`
}
func (*StorageConfig) GetLogDir ¶ added in v1.7.2
func (s *StorageConfig) GetLogDir() string
Click to show internal directories.
Click to hide internal directories.