setting

package
v0.0.0-...-7230577 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Tracer opentracing.Tracer
	// 保存所有配置信息
	Conf = new(Config)
)

Functions

func Init

func Init() (err error)

Types

type App

type App struct {
	Name      string   `mapstructure:"name"`
	RunMode   string   `mapstructure:"run_mode"`
	HttpPort  int      `mapstructure:"http_port"`
	GrpcPort  int      `mapstructure:"grpc_port"`
	Node_Addr []string `mapstructure:"node_addr"`
}

type Config

type Config struct {
	App       `mapstructure:"app"`
	Log       `mapstructure:"log"`
	DB        `mapstructure:"db"`
	Redis     `mapstructure:"redis"`
	TokenList map[string]Token `mapstructure:"tokenList" json:"tokenList"`
	Metrics   `mapstructure:"metrics"`
	Trace     `mapstructure:"trace"`
}

type DB

type DB struct {
	Driver          string `mapstructure:"driver"`
	Host            string `mapstructure:"host"`
	Port            int    `mapstructure:"port"`
	User            string `mapstructure:"user"`
	Password        string `mapstructure:"password"`
	DbName          string `mapstructure:"db_name"`
	MaxOpenConns    int    `mapstructure:"max_open_conns"`
	MaxIdleConns    int    `mapstructure:"max_idle_conns"`
	ConnMaxLifeTime int    `mapstructure:"conn_max_lifetime"`
}

type Log

type Log struct {
	Level      string `mapstructure:"level"`
	Filename   string `mapstructure:"filename"`
	MaxSize    int    `mapstructure:"max_size"`
	MaxAge     int    `mapstructure:"max_age"`
	MaxBackups int    `mapstructure:"max_backups"`
}

type Metrics

type Metrics struct {
	URL         string `mapstructure:"url"`
	ServiceName string `mapstructure:"service_name"`
}

type Redis

type Redis struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Password string `mapstructure:"password"`
	DB       int    `mapstructure:"db"`
	PoolSize int    `mapstructure:"pool_size"`
}

type Token

type Token struct {
	Name         string `mapstructure:"name" json:"name"`
	Decimal      uint   `mapstructure:"decimal" json:"decimal"`
	ContractAddr string `mapstructure:"contractAddr" json:"contractAddr"`
}

type Trace

type Trace struct {
	Enable      bool   `mapstructure:"enable"`
	Endpoint    string `mapstructure:"endpoint"`
	ServiceName string `mapstructure:"service_name"`
	LogSpans    bool   `mapstructure:"log_spans"`
}

Jump to

Keyboard shortcuts

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