mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
813 B
Go
52 lines
813 B
Go
package conf
|
|
|
|
import (
|
|
"github.com/synctv-org/synctv/utils"
|
|
)
|
|
|
|
type Config struct {
|
|
// Log
|
|
Log LogConfig `yaml:"log"`
|
|
|
|
// Server
|
|
Server ServerConfig `yaml:"server"`
|
|
|
|
// Jwt
|
|
Jwt JwtConfig `yaml:"jwt"`
|
|
|
|
// Database
|
|
Database DatabaseConfig `yaml:"database"`
|
|
|
|
// Oauth2Plugins
|
|
Oauth2Plugins Oauth2Plugins `yaml:"oauth2_plugins"`
|
|
|
|
// RateLimit
|
|
RateLimit RateLimitConfig `yaml:"rate_limit"`
|
|
}
|
|
|
|
func (c *Config) Save(file string) error {
|
|
return utils.WriteYaml(file, c)
|
|
}
|
|
|
|
func DefaultConfig() *Config {
|
|
return &Config{
|
|
// Log
|
|
Log: DefaultLogConfig(),
|
|
|
|
// Server
|
|
Server: DefaultServerConfig(),
|
|
|
|
// Jwt
|
|
Jwt: DefaultJwtConfig(),
|
|
|
|
// Database
|
|
Database: DefaultDatabaseConfig(),
|
|
|
|
// OAuth2
|
|
Oauth2Plugins: DefaultOauth2Plugins(),
|
|
|
|
// RateLimit
|
|
RateLimit: DefaultRateLimitConfig(),
|
|
}
|
|
}
|