config

package
v0.0.0-...-25da3cc Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigPath = "./conf/"

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath(file string) string

Types

type ClusterSection

type ClusterSection struct {
	ClusterId             string //cluster Id
	RegistryServer        string //Registry Server
	WatchLeaderRetryLimit int
	QueryResourceInterval int //the interval time for QueryResource, unit for second
}

type GlobalSection

type GlobalSection struct {
	RetryLimit            int
	CheckNetInterval      int //the interval time for check net, unit for second
	DataBaseConnectString string
}

type LoggerSection

type LoggerSection struct {
	LogPath string
}

type NodeSection

type NodeSection struct {
	NodeId                      string
	NodeName                    string
	IsMaster                    bool
	IsWorker                    bool
	LeaderCheckExecutorInterval int //the interval time for CheckExecutor from db, unit for second
}

type Profile

type Profile struct {
	Global     *GlobalSection
	Node       *NodeSection
	Rpc        *RpcSection
	WebUI      *WebUISection
	Runtime    *RuntimeSection
	Logger     *LoggerSection
	Cluster    *ClusterSection
	Prometheus *PrometheusSection
}
var CurrentProfile *Profile

func DefaultProfile

func DefaultProfile() *Profile

DefaultProfile return default profile used to full node role

func GetProfile

func GetProfile() *Profile

func LoadConfig

func LoadConfig(configFile string) (*Profile, error)

LoadConfig load config from yaml file

type PrometheusSection

type PrometheusSection struct {
	IsRun    bool
	HttpHost string
	HttpPort string
}

type RpcSection

type RpcSection struct {
	OuterHost      string
	OuterPort      string
	RpcHost        string
	RpcPort        string
	RpcProtocol    string //now is json-rpc
	EnableTls      bool
	ServerCertFile string
	ServerKeyFile  string
	ClientCertFile string
	ClientKeyFile  string
}

type RuntimeSection

type RuntimeSection struct {
	IsRun             bool
	LogPath           string
	EnableShellScript bool
}

type WebUISection

type WebUISection struct {
	HttpHost string
	HttpPort string
}

Jump to

Keyboard shortcuts

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