setting

package
v0.0.0-...-d402f94 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// PageSize RunMode string
	PageSize int
)

Functions

func LoadInI

func LoadInI()

LoadInI 载入配置

func SetApp

func SetApp()

func SetMeta

func SetMeta()

func SetSite

func SetSite()

Types

type AliyunConfig

type AliyunConfig struct {
	AccessKey       string `toml:"access_key" mapstructure:"access_key"`
	SecretAccessKey string `toml:"secret_access_key" mapstructure:"secret_access_key"`
	BucketName      string `toml:"bucket_name" mapstructure:"bucket_name"`
	Endpoint        string
	InnerNet        string `toml:"inner_net" mapstructure:"inner_net"`
	OuterNet        string `toml:"outer_net" mapstructure:"outer_net"`
	AliyunNet       string `toml:"aliyun_net" mapstructure:"aliyun_net"`
}

type AllConfig

type AllConfig struct {
	Redis     string
	Database  DatabaseConfig
	App       AppConfig
	Site      SiteMap
	Server    ServerConfig
	Security  SecurityConfig
	Xorm      XormConfig
	Sensitive SensitiveConfig
	Search    SearchConfig
	Aliyun    AliyunConfig
}

AllConfig 读取配置文件config

var Config AllConfig

type AppConfig

type AppConfig struct {
	Env          string
	LogLevel     string
	CookieSecret string
	DataPath     string
	PageSize     int `toml:"page_size" mapstructure:"page_size"`
	Key          string
	UploadOss    bool   `toml:"upload_oss" mapstructure:"upload_oss"`
	LogFilePath  string `toml:"log_file_path" mapstructure:"log_file_path"`
	LogFileName  string `toml:"log_file_name" mapstructure:"log_file_name"`
	StaticDomain string `toml:"static_domain" mapstructure:"static_domain"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Type        string
	Host        string
	Port        string
	User        string
	Password    string
	DbName      string
	Charset     string
	TablePrefix string `toml:"table_prefix" mapstructure:"table_prefix"`
	MaxIdle     int    `toml:"max_idle" mapstructure:"max_idle"`
	MaxConn     int    `toml:"max_conn" mapstructure:"max_conn"`
}

type SearchConfig

type SearchConfig struct {
	EngineUrl string
}

type SecurityConfig

type SecurityConfig struct {
	UnsubscribeTokenKey string
	ActivateSignSalt    string
}

type SensitiveConfig

type SensitiveConfig struct {
	Title   string
	Content string
}

type ServerConfig

type ServerConfig struct {
	Host          string
	Port          string
	ReaderTimeout int
	WriteTimeout  int
}

type SiteMap

type SiteMap struct {
	Domain      string
	Title       string
	Keyword     string
	Description string
	Slogon      Slogon
	Email       string
	Contact     string
	Company     string
	Record      string
	Phone       string
	Icp         string
	Address     string
	Tpl         string
}

type Slogon

type Slogon struct {
	// contains filtered or unexported fields
}

type XormConfig

type XormConfig struct {
	ShowSql  bool
	LogLevel int
}

Jump to

Keyboard shortcuts

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