config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config moon配置

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultQMoonDir = ".qmoon"
)

Functions

func DefaultLogLevel

func DefaultLogLevel() string

DefaultLogLevel returns a default log level of "error"

func WriteConfigFile

func WriteConfigFile(configFilePath string, config *Config)

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

func TestBaseConfig

func TestBaseConfig() BaseConfig

TestBaseConfig returns a base configuration

type Config

type Config struct {
	BaseConfig `mapstructure:",squash"`
	HttpServer *HttpServerConfig `mapstructure:"http"`
	DB         *DBConfig         `mapstructure:"db"`
	Email      *EmailConfig
}

Config moon配置

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration

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

func (dc *DBConfig) DataSource() string

type EmailConfig

type EmailConfig struct {
	SmtpServer string
	User       string
	Password   string
}

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

Jump to

Keyboard shortcuts

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