configs

package
v0.0.0-...-9ffda5a Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MinGoVersion 最小 Go 版本
	MinGoVersion = 1.16

	// ProjectVersion 项目版本
	ProjectVersion = "v0.1.0"

	// ProjectName 项目名称
	ProjectName = "spokenai"

	// ProjectAccessLogFile 项目访问日志存放文件
	ProjectLogFile = "./logs/" + ProjectName + ".log"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MySQL struct {
		Read struct {
			Addr string `toml:"addr"`
			User string `toml:"user"`
			Pass string `toml:"pass"`
			Name string `toml:"name"`
		} `toml:"read"`
		Write struct {
			Addr string `toml:"addr"`
			User string `toml:"user"`
			Pass string `toml:"pass"`
			Name string `toml:"name"`
		} `toml:"write"`
		Base struct {
			MaxOpenConn     int           `toml:"maxOpenConn"`
			MaxIdleConn     int           `toml:"maxIdleConn"`
			ConnMaxLifeTime time.Duration `toml:"connMaxLifeTime"`
		} `toml:"base"`
	} `toml:"mysql"`

	Redis struct {
		Addr         string `toml:"addr"`
		Pass         string `toml:"pass"`
		Db           int    `toml:"db"`
		MaxRetries   int    `toml:"maxRetries"`
		PoolSize     int    `toml:"poolSize"`
		MinIdleConns int    `toml:"minIdleConns"`
	} `toml:"redis"`

	Mail struct {
		Host string `toml:"host"`
		Port int    `toml:"port"`
		User string `toml:"user"`
		Pass string `toml:"pass"`
		To   string `toml:"to"`
	} `toml:"mail"`

	HashIds struct {
		Secret string `toml:"secret"`
		Length int    `toml:"length"`
	} `toml:"hashids"`

	Language struct {
		Local string `toml:"local"`
	} `toml:"language"`

	OpenAi struct {
		Chat struct {
			ChatModel       string `toml:"chatModel"`
			ChatMaxToken    int    `toml:"chatMaxtoken"`
			ChatTemperature int    `toml:"chatTemperature"`
			ChatTopP        int    `toml:"chatTopP"`
		} `toml:"chat"`
		Audio struct {
			AudioModel string `toml:"audioModel"`
		} `toml:"audio"`
		Base struct {
			ApiKey  string `toml:"apikey"`
			ApiHost string `toml:"apihost"`
		} `toml:"base"`
	} `toml:"openai"`

	File struct {
		History struct {
			Path string `toml:"path"`
		} `toml:"history"`
		Audio struct {
			Record struct {
				Path string `toml:"path"`
			} `toml:"record"`
			Play struct {
				Enable  bool   `toml:"enable"`
				Path    string `toml:"path"`
				TtsHost string `toml:"ttshost"`
			} `toml:"play"`
		} `toml:"audio"`
	}
}

func Get

func Get() Config

Jump to

Keyboard shortcuts

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