conf

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CurrentVersion 当前版本
	CurrentVersion = "1.0.0"
	// CurrentBranch 当前版本
	CurrentBranch = ""
	// CurrentCommit 当前版本
	CurrentCommit = ""
	// BuildTime 编译时间
	BuildTime = ""
	// ConfigFilePath 默认配置文件路径
	ConfigFilePath = "./tcip_relayer.yml"
	// BaseConf 基本配置全局变量
	BaseConf = &BaseConfig{}
	// Config 配置全局变量
	Config = &LocalConfig{}
)

Functions

func GetAbsPath

func GetAbsPath(ymlFile string) string

GetAbsPath 获取绝对路径

@param ymlFile
@return string

func InitLocalConfig

func InitLocalConfig(cmd *cobra.Command) error

InitLocalConfig init local config

@param cmd
@return error

Types

type BaseConfig

type BaseConfig struct {
	GatewayID      string `mapstructure:"gateway_id"`      // 中继网关ID
	GatewayName    string `mapstructure:"gateway_name"`    // 中继网关名称
	DefaultTimeout int64  `mapstructure:"default_timeout"` // 默认的全局超时时间
}

BaseConfig 中继网关基本配置

type LocalConfig

type LocalConfig struct {
	BaseConfig *BaseConfig               `mapstructure:"base"`        // 中继网关基本配置,目前没什么用,留一个扩展
	RpcConfig  *RpcConfig                `mapstructure:"rpc"`         // Web监听配置
	RelayChain *RelayChain               `mapstructure:"relay_chain"` // Web监听配置
	LogConfig  []*logger.LogModuleConfig `mapstructure:"log"`         // 日志配置
}

LocalConfig 本地配置信息

type RelayChain

type RelayChain struct {
	ChainmakerSdkConfigPath string  `mapstructure:"chainmaker_sdk_config_path"`
	Users                   []*User `mapstructure:"users"`
}

RelayChain 中继链配置

type RpcConfig

type RpcConfig struct {
	Port           int           `mapstructure:"port"`      // 服务监听的端口号
	TLSConfig      tlsConfig     `mapstructure:"tls"`       // tls相关配置
	BlackList      []string      `mapstructure:"blacklist"` // 黑名单
	RestfulConfig  restfulConfig `mapstructure:"restful"`   // resultful api 网关
	MaxSendMsgSize int           `mapstructure:"max_send_msg_size"`
	MaxRecvMsgSize int           `mapstructure:"max_recv_msg_size"`
	ClientKey      string        `mapstructure:"client_key"`
	ClientCert     string        `mapstructure:"client_cert"`
}

RpcConfig rpc配置信息

type User

type User struct {
	SignKeyPath string `mapstructure:"sign_key_path"`
	SignCrtPath string `mapstructure:"sign_crt_path"`
	OrgId       string `mapstructure:"org_id"`
}

User 中继链用户信息

Jump to

Keyboard shortcuts

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