configs

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package configs 配置操作公共类

Index

Constants

This section is empty.

Variables

View Source
var Config = struct {
	AppName           string
	Slack             Slack
	Email             Email
	AlarmThreshold    map[string]int64
	TraverseSleepTime map[string]int64
	ExplorerDatabase  map[string]MySQLDB
	Redis             struct {
		Prefix  string
		Type    string
		Redis   RedisDB
		Cluster RedisClusterDB
	}
	SupportCoins     string
	MonitorExplorers []string
	MonitorCoins     []string
	Interval         int
	Health           Health
}{}

Functions

func AddDatabaseConfig

func AddDatabaseConfig(value *MySQLDB, configs map[string]MySQLDSN)

AddDatabaseConfig 添加数据库配置

func InitConfig

func InitConfig(files string)

Types

type ConfigURL

type ConfigURL struct {
	Enabled bool   `json:"enabled"`
	Host    string `json:"host"`
	Port    int64  `json:"port"`
}

type Email

type Email struct {
	SenderName     string
	SenderPassword string
	Host           string
	Port           int
	IsEnable       bool
}

type Health

type Health struct {
	Port            int
	IntervalSeconds int
}

type Log

type Log struct {
	Level      string
	ShowSource bool
	Path       string
}

Log 代表日志配置

type MySQLDB

type MySQLDB struct {
	Read     MySQLDSN
	Write    MySQLDSN
	Timezone string
	Region   string
	CoinType string
}

MySQLDB 代表一个 mysql 连接信息

type MySQLDSN

type MySQLDSN struct {
	Name    string
	DSN     string
	Type    string
	SSHName string
}

MySQLDSN 代表一个 mysql dsn 连接信息

type RPCClient

type RPCClient struct {
	Host string
	Port int64
	User string
	Pass string
}

RPCClient 代表一个 rpc 连接信息

type RedisClusterDB

type RedisClusterDB struct {
	Address  []string
	Password string
}

RedisClusterDB 代表一个 redis 集群连接信息

type RedisDB

type RedisDB struct {
	Address  string
	Password string
}

RedisDB 代表一个 redis 连接信息

type Slack

type Slack struct {
	WebHookURL string
	IsEnable   bool
}

Jump to

Keyboard shortcuts

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