Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var App = new(Application)
Functions ¶
func InitializeConfig ¶
func InitializeConfig()
func InitializeLog ¶
func InitializeLog() *zap.SugaredLogger
func OnceInitializeConfig ¶
func OnceInitializeConfig(config string)
Types ¶
type Application ¶
type Application struct { Config Configuration // 项目配置 Log *zap.SugaredLogger // 日志系统 Db *database.ChatDb }
type Configuration ¶
type Configuration struct { ApiKey string `mapstructure:"api_key"` CustomUrl string `mapstructure:"custom_url"` Model string `mapstructure:"model"` Proxy string `mapstructure:"proxy"` ServerPort string `mapstructure:"server_port"` Timeout int `mapstructure:"timeout"` Version string `mapstructure:"version"` Log Log `mapstructure:"log"` }
type Log ¶
type Log struct { Level string `mapstructure:"level"` RootDir string `mapstructure:"root_dir"` Filename string `mapstructure:"filename"` Format string `mapstructure:"format"` ShowLine bool `mapstructure:"show_line"` MaxBackups int `mapstructure:"max_backups"` MaxSize int `mapstructure:"max_size"` // MB MaxAge int `mapstructure:"max_age"` // day Compress bool `mapstructure:"compress"` }
Click to show internal directories.
Click to hide internal directories.