global

package
v0.0.0-...-3b0f332 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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"`
}

Jump to

Keyboard shortcuts

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