config

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTmpPath     = "tmp"
	DefaultTaskTmpPath = "tasks"
	UploadPath         = "upload"
	PluginPath         = "plugin"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name     string        `yaml:"name"`
	Addr     string        `yaml:"addr"`
	Port     int           `yaml:"port"`
	Mode     string        `yaml:"mode"`
	RunStart bool          `yaml:"run_start"`
	DataPath string        `yaml:"data_path"` // db file and tmp path
	TempDate time.Duration `yaml:"temp_date"`
	Logger   string        `yaml:"logger"`
}

type Conf

type Conf struct {
	Db  DB  `yaml:"db"`
	App App `yaml:"app"`
}

func NewServerConfig

func NewServerConfig(path string) (*Conf, error)

NewServerConfig 加载优先级路径 > 当前目录的config.yaml > 打包在可执行文件里的config.yaml.example

type DB

type DB struct {
	Driver   string `yaml:"driver"`
	UserName string `yaml:"user"`
	PassWord string `yaml:"password"`
	Dsn      string `yaml:"dsn"`
	DbName   string `yaml:"db_name"`
}

Jump to

Keyboard shortcuts

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