config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonConfig

type CommonConfig struct {
	SvcName        string `toml:"svc-name"`
	ListenHost     string `toml:"listen-host"`
	DebugPort      string `toml:"debug-port"`
	SRDETCDServers string `toml:"srd-etcd-servers"`
	SRDETCDCaCert  string `toml:"srd-etcd-ca-cert"`
	SRDETCDCert    string `toml:"srd-etcd-cert"`
	SRDETCDKey     string `toml:"srd-etcd-key"`
	SRDPrefix      string `toml:"srd-prefix"`
	RateLimit      int    `toml:"rate-limit"`
}

CommonConfig 服务通用配置部分

type ConfigFile

type ConfigFile struct {
	Common *CommonConfig `toml:"common"`
	GRPC   *GRPCConfig   `toml:"grpc"`
	HTTP   *HTTPConfig   `toml:"http"`
}

ConfigFile 服务配置对象定义

func ParseConfigFile

func ParseConfigFile(filePath string, logger log.Logger) *ConfigFile

ParseConfigFile 解析配置文件方法

type GRPCConfig

type GRPCConfig struct {
	GRPCPort string `toml:"grpc-port"`
}

GRPCConfig GRPC配置部分

type HTTPConfig

type HTTPConfig struct {
	HTTPPort string `toml:"http-port"`
}

HTTPConfig HTTP配置部分

Jump to

Keyboard shortcuts

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