Documentation
¶
Overview ¶
Package config moon配置
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DefaultQMoonDir = ".qmoon"
)
Functions ¶
func DefaultLogLevel ¶
func DefaultLogLevel() string
DefaultLogLevel returns a default log level of "error"
func WriteConfigFile ¶
WriteConfigFile renders config using the template and writes it to configFilePath.
func WriteDefaultConfigFile ¶
func WriteDefaultConfigFile(rootDir string)
WriteDefaultConfigFile 初始化默认配置文件
Types ¶
type BaseConfig ¶
type BaseConfig struct {
// RootDir 数据根目录
RootDir string `mapstructure:"home"`
// LogLevel 日志输出级别 debug info warning error fatal panic
LogLevel string `mapstructure:"log_level"`
}
BaseConfig defines the base configuration for a Tendermint node
func DefaultBaseConfig ¶
func DefaultBaseConfig() BaseConfig
DefaultBaseConfig returns a default base configuration
type Config ¶
type Config struct {
BaseConfig `mapstructure:",squash"`
HttpServer *HttpServerConfig `mapstructure:"http"`
DB *DBConfig `mapstructure:"db"`
Email *EmailConfig
}
Config moon配置
func TestConfig ¶
func TestConfig() *Config
TestConfig returns a configuration that can be used for testing
type DBConfig ¶
type DBConfig struct {
DriverName string `mapstructure:"driver"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
Addr string `mapstructure:"addr"`
Database string `mapstructure:"database"`
}
DBConfig
func DefaultDBConfig ¶
func DefaultDBConfig() *DBConfig
DefaultRPCConfig returns a default configuration for the HttpServer server
func TestDBConfig ¶
func TestDBConfig() *DBConfig
TestRPCConfig returns a configuration for testing the HttpServer server
func (*DBConfig) DataSource ¶
type EmailConfig ¶
EmailConfig 邮件配置
func DefaultEmailConfig ¶
func DefaultEmailConfig() *EmailConfig
DefaultEmailConfig returns a default configuration for the HttpServer server
func TestEmailConfig ¶
func TestEmailConfig() *EmailConfig
TestEmailConfig returns a configuration for testing the HttpServer server
type HttpServerConfig ¶
type HttpServerConfig struct {
// TCP or UNIX socket address for the HttpServer server to listen on
ListenAddress string `mapstructure:"laddr"`
}
HttpServerConfig defines the configuration options for the HttpServer server
func DefaultRPCConfig ¶
func DefaultRPCConfig() *HttpServerConfig
DefaultRPCConfig returns a default configuration for the HttpServer server
func TestRPCConfig ¶
func TestRPCConfig() *HttpServerConfig
TestRPCConfig returns a configuration for testing the HttpServer server