config

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DtmMetricsPort = 8889
	Mysql          = "mysql"
	Redis          = "redis"
	BoltDb         = "boltdb"
)

Variables

View Source
var Config = configType{}

Config 配置

Functions

func MustLoadConfig

func MustLoadConfig(confFile string)

MustLoadConfig load config from env and file

Types

type MicroService

type MicroService struct {
	Driver   string `yaml:"Driver" default:"default"`
	Target   string `yaml:"Target"`
	EndPoint string `yaml:"EndPoint"`
}

MicroService config type for micro service

type Store

type Store struct {
	Driver             string `yaml:"Driver" default:"boltdb"`
	Host               string `yaml:"Host"`
	Port               int64  `yaml:"Port"`
	User               string `yaml:"User"`
	Password           string `yaml:"Password"`
	MaxOpenConns       int64  `yaml:"MaxOpenConns" default:"500"`
	MaxIdleConns       int64  `yaml:"MaxIdleConns" default:"500"`
	ConnMaxLifeTime    int64  `yaml:"ConnMaxLifeTime" default:"5"`
	DataExpire         int64  `yaml:"DataExpire" default:"604800"` // Trans data will expire in 7 days. only for redis/boltdb.
	RedisPrefix        string `yaml:"RedisPrefix" default:"{a}"`   // Redis storage prefix. store data to only one slot in cluster
	TransGlobalTable   string `yaml:"TransGlobalTable" default:"dtm.trans_global"`
	TransBranchOpTable string `yaml:"BranchTransOpTable" default:"dtm.trans_branch_op"`
}

func (*Store) GetDBConf

func (s *Store) GetDBConf() dtmcli.DBConf

func (*Store) IsDB

func (s *Store) IsDB() bool

Jump to

Keyboard shortcuts

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