conf

package
v0.0.0-...-2926792 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UploadSetting = &Upload{}

Functions

This section is empty.

Types

type Config

type Config struct {
	ServerConfig     Server     `yaml:"listen"`
	SeoConfig        Seo        `yaml:"seo"`
	DatasourceConfig Datasource `yaml:"datasource"`
	UploadConfig     Upload     `yaml:"upload"`
}

配置文件

func GetConfig

func GetConfig() (e *Config, err error)

外部方法调用

type Datasource

type Datasource struct {
	Host        string `yaml:"host"`
	Port        string `yaml:"port"`
	User        string `yaml:"user"`
	Pwd         string `yaml:"pwd"`
	Dbname      string `yaml:"dbname"`
	Connections int    `yaml:"connections"`
	Idles       int    `yaml:"idles"`
	TablePrefix string `yaml:"table_prefix"`
}

数据源

type Seo

type Seo struct {
	Title       string `yaml:"title"`
	Keywords    string `yaml:"keywords"`
	Description string `yaml:"description"`
}

站点seo

type Server

type Server struct {
	Port         string `yaml:"port"`
	ReadTimeout  int    `yaml:"readtimeout"`
	WriteTimeout int    `yaml:"writetimeout"`
}

type Upload

type Upload struct {
	ImagePrefixUrl  string   `yaml:"ImagePrefixUrl"`
	ImageSavePath   string   `yaml:"ImageSavePath"`
	ImageMaxSize    int      `yaml:"ImageMaxSize"`
	ImageAllowExts  []string `yaml:"ImageAllowExts"`
	RuntimeRootPath string   `yaml:"RuntimeRootPath"`
}

文件上传配置

Jump to

Keyboard shortcuts

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