config

package
v0.0.0-...-fa9b265 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parseconfig

func Parseconfig(filepath string, out interface{})

Parseconfig parse json config out must be pointer

Types

type BaseCfg

type BaseCfg struct {
	Etcd   EtcdCfg   `json:"etcdCfg"`
	Zipkin ZipkinCfg `json:"zipkinCfg"`
	Staff  StaffCfg  `json:"staffCfg"`
}

BaseCfg 服务基础配置

type EtcdCfg

type EtcdCfg struct {
	EndPoints []string      `json:"endpoints" yaml:"endpoints"`
	User      string        `json:"user" yaml:"user"`
	Psw       string        `json:"psw" yaml:"psw"`
	Timeout   time.Duration `json:"timeout" yaml:"timeout"`
}

EtcdCfg 对应配置文件中关于etcd配置内容

type MysqlCfg

type MysqlCfg struct {
	Host struct {
		Read  string `json:"read"`
		Write string `json:"write"`
	} `json:"Host"`
	Port   int    `json:"Port"`
	User   string `json:"User"`
	Psw    string `json:"Psw"`
	DbName string `json:"DbName"`
}

MysqlCfg mysql config

type RedisCfg

type RedisCfg struct {
	Addr string `json:"Addr"`
	Psw  string `json:"Psw"`
	DBNo int    `json:"DBNo"`
}

RedisCfg config

type StaffCfg

type StaffCfg struct {
	Name        string `json:"name" yaml:"name"`     // 服务名称
	Email       string `json:"email" yaml:"email"`   // 通知邮箱
	MobilePhone string `json:"mobile" yaml:"mobile"` // 通知手机号 ,暂未实现
}

StaffCfg 服务监控人员

type ZipkinCfg

type ZipkinCfg struct {
	EndPoints  string `json:"endpoints"`  //
	SampleRate string `json:"samplerate"` // 采样率
}

ZipkinCfg Zipkin配置

Jump to

Keyboard shortcuts

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